Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 2 additions & 21 deletions apps/admin/components/layout/admin-shell.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { Badge, ThemeToggle } from "@wikipefia/ui";
import { AppHeader } from "@wikipefia/ui";
import Link from "next/link";
import { usePathname } from "next/navigation";
import type { ReactNode } from "react";
Expand Down Expand Up @@ -36,26 +36,7 @@ export function AdminShell({ children }: { children: ReactNode }) {
style={{ backgroundColor: "var(--background)" }}
>
{/* Header */}
<header
className="h-11 flex items-center justify-between px-4 border-b shrink-0"
style={{ borderColor: C.border, backgroundColor: C.headerBg }}
>
<div className="flex items-center gap-3">
<span
className="text-[13px] font-bold uppercase tracking-[0.08em]"
style={{ fontFamily: "var(--font-mono)", color: C.headerText }}
>
Wikipefia Admin
</span>
<Badge variant="accent" className="text-[9px] tracking-[0.15em]">
Console
</Badge>
</div>
<ThemeToggle
size="icon-sm"
className="border-invert-fg/20 text-invert-fg"
/>
</header>
<AppHeader product="Admin" />

{/* Body */}
<div className="flex flex-1 min-h-0">
Expand Down
3 changes: 2 additions & 1 deletion apps/chat/components/ChatProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export function ChatProvider({ children }: { children: ReactNode }) {
models: MODELS,
defaultModelId: DEFAULT_MODEL_ID,
brand: {
productName: "Wikipefia Chat",
productName: "Wikipefia",
product: "Chat",
tagline: "AI tutor for university students",
},
}}
Expand Down
2 changes: 1 addition & 1 deletion apps/chat/tsconfig.tsbuildinfo

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions apps/library/app/file/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

import { api } from "@wikipefia/backend/api";
import type { Id } from "@wikipefia/backend/dataModel";
import { Badge, Button, SectionHeading } from "@wikipefia/ui";
import {
Badge,
Button,
buttonVariants,
cn,
SectionHeading,
} from "@wikipefia/ui";
import { useMutation, useQuery } from "convex/react";
import { motion } from "motion/react";
import Link from "next/link";
Expand Down Expand Up @@ -139,7 +145,10 @@ export default function FileDetailPage() {
href={downloadUrl}
target="_blank"
rel="noopener noreferrer"
className="inline-flex h-[28px] cursor-pointer items-center justify-center gap-1.5 border border-accent bg-accent px-2.5 text-[10px] font-bold uppercase tracking-[0.1em] text-white transition-opacity hover:opacity-80"
className={cn(
buttonVariants({ size: "sm" }),
"border-accent bg-accent text-white",
)}
style={{ fontFamily: FONT.mono }}
>
↓ Download
Expand Down
59 changes: 22 additions & 37 deletions apps/library/components/masthead.tsx
Original file line number Diff line number Diff line change
@@ -1,48 +1,33 @@
"use client";

import { Button, ThemeToggle } from "@wikipefia/ui";
import { AppHeader, AppWordmark, Button } from "@wikipefia/ui";
import Link from "next/link";
import { FONT } from "@/lib/theme";

/**
* Inverted dark top bar carrying the wordmark + actions. Shared by all pages
* so the app reads as one piece. `onUpload`, when provided, renders the Upload
* action button.
* Inverted dark top bar carrying the wordmark + actions. Built on the shared
* {@link AppHeader} so it stays identical to the other Wikipefia apps.
* `onUpload`, when provided, renders the Upload action button.
*/
export function Masthead({ onUpload }: { onUpload?: () => void }) {
return (
<header className="noise-overlay relative z-20 border-b border-white/10 bg-invert text-invert-fg">
<div className="relative z-10 mx-auto flex h-12 max-w-6xl items-center justify-between px-5">
<Link href="/" className="flex items-baseline gap-2">
<span
className="text-[11px] font-bold uppercase tracking-[0.28em]"
style={{ fontFamily: FONT.mono }}
>
Wikipefia
</span>
<span
className="text-[11px] uppercase tracking-[0.28em] text-accent"
style={{ fontFamily: FONT.mono }}
>
Library
</span>
<AppHeader
innerClassName="mx-auto max-w-6xl"
brand={
<Link href="/">
<AppWordmark product="Library" />
</Link>
<div className="flex items-center gap-2">
{onUpload && (
<Button
size="sm"
onClick={onUpload}
className="border-accent bg-accent text-white hover:opacity-80"
>
+ Upload
</Button>
)}
<ThemeToggle
size="icon-sm"
className="border-white/25 text-invert-fg hover:border-accent hover:text-accent"
/>
</div>
</div>
</header>
}
right={
onUpload ? (
<Button
size="sm"
onClick={onUpload}
className="border-accent bg-accent text-white hover:opacity-80"
>
+ Upload
Comment on lines +22 to +27

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use theme color tokens and uppercase label for the Upload action.

This new button uses a hardcoded color (text-white) and a mixed-case label, which breaks the TSX styling conventions in this repo.

Suggested patch
 import { AppHeader, AppWordmark, Button } from "`@wikipefia/ui`";
 import Link from "next/link";
+import { C } from "`@/lib/theme`";
@@
           <Button
             size="sm"
             onClick={onUpload}
-            className="border-accent bg-accent text-white hover:opacity-80"
+            className="uppercase tracking-wider hover:opacity-80"
+            style={{
+              borderColor: C.accent,
+              backgroundColor: C.accent,
+              color: C.bgWhite,
+              fontFamily: "var(--font-mono)",
+            }}
           >
-            + Upload
+            + UPLOAD
           </Button>

As per coding guidelines, "Use CSS variables (C.bg, C.bgWhite, C.text, C.textMuted, C.accent, C.border, C.borderLight, C.headerBg, C.headerText) imported from @/lib/theme for all styling; never hardcode colors except for subject palette colors" and "Apply uppercase styling to all headers, labels, navigation, badges, and breadcrumbs using text-transform or Tailwind uppercase utility".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/library/components/masthead.tsx` around lines 22 - 27, The Button
component in the Upload action has two issues: it uses a hardcoded color
className text-white instead of theme color tokens, and the button label is
mixed-case. Replace the hardcoded text-white in the className with the
appropriate theme color token from the imported theme constants (similar to how
border-accent and bg-accent are already used), and change the button label from
plus Upload to uppercase format (either as UPLOAD or by applying the appropriate
text-transform or Tailwind uppercase utility class) to align with the
repository's styling conventions for headers, labels, and navigation elements.

Source: Coding guidelines

</Button>
) : null
}
/>
);
}
31 changes: 17 additions & 14 deletions apps/portal/components/shared/page-shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { useState, useEffect, Fragment } from "react";
import Link from "next/link";
import { useTranslations } from "next-intl";
import { ThemeToggle, Button, Kbd, useTheme } from "@wikipefia/ui";
import { AppWordmark, ThemeToggle, Button, Kbd, useTheme } from "@wikipefia/ui";
import { C } from "@/lib/theme";
import { SearchDialog } from "@/components/search/search-dialog";
import { LocaleSwitcher } from "@/components/navigation/locale-switcher";
Expand All @@ -28,7 +28,8 @@ interface PageShellProps {
function LocalizedThemeToggle() {
const t = useTranslations("common");
const { resolvedTheme } = useTheme();
const label = resolvedTheme === "dark" ? t("switchToLight") : t("switchToDark");
const label =
resolvedTheme === "dark" ? t("switchToLight") : t("switchToDark");
return <ThemeToggle aria-label={label} title={label} />;
}

Expand Down Expand Up @@ -63,11 +64,8 @@ export function PageShell({ children, breadcrumbs, locale }: PageShellProps) {
>
<div className="max-w-7xl mx-auto px-4">
<div className="h-14 flex items-center justify-between">
<Link
href="/"
className="text-base font-bold tracking-wider uppercase"
>
WIKIPEFIA
<Link href="/">
<AppWordmark />
</Link>
<div className="flex items-center gap-2">
<Button
Expand All @@ -76,7 +74,10 @@ export function PageShell({ children, breadcrumbs, locale }: PageShellProps) {
className="group gap-2 tracking-normal"
style={{ borderColor: C.borderLight }}
>
<span className="text-xs uppercase font-medium group-hover:underline" style={{ color: C.textMuted }}>
<span
className="text-xs uppercase font-medium group-hover:underline"
style={{ color: C.textMuted }}
>
{t("search")}
</span>
<Kbd style={{ borderColor: C.borderLight, color: C.textMuted }}>
Expand Down Expand Up @@ -121,13 +122,18 @@ export function PageShell({ children, breadcrumbs, locale }: PageShellProps) {
<main className="flex-1">{children}</main>

{/* ── FOOTER ── */}
<footer className="border-t mt-auto" style={{ borderColor: C.borderLight }}>
<footer
className="border-t mt-auto"
style={{ borderColor: C.borderLight }}
>
<div className="max-w-7xl mx-auto px-4 py-8">
<div className="flex items-center justify-between text-[11px] uppercase tracking-wider">
<div>
<span className="font-bold">WIKIPEFIA</span>
<span className="mx-3 opacity-20">·</span>
<span style={{ color: C.textMuted }}>{t("educationalDatabase")}</span>
<span style={{ color: C.textMuted }}>
{t("educationalDatabase")}
</span>
</div>
<div className="flex items-center gap-4">
<Link
Expand All @@ -144,10 +150,7 @@ export function PageShell({ children, breadcrumbs, locale }: PageShellProps) {
</footer>

{/* ── SEARCH ── */}
<SearchDialog
open={searchOpen}
onClose={() => setSearchOpen(false)}
/>
<SearchDialog open={searchOpen} onClose={() => setSearchOpen(false)} />
</div>
);
}
4 changes: 2 additions & 2 deletions apps/portal/lib/theme.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** Re-export shared design tokens */
export { C } from "@wikipefia/mdx-renderer";
/** Re-export shared design tokens from the canonical design system. */
export { C } from "@wikipefia/ui";

/* ── Subject color coding (app-specific) ── */

Expand Down
84 changes: 16 additions & 68 deletions apps/studio/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
"use client";

import { api } from "@wikipefia/backend/api";
import { Badge, Button, Kbd } from "@wikipefia/ui";
import {
AppHeader,
AppWordmark,
Button,
Kbd,
ThemeToggle,
} from "@wikipefia/ui";
import { useAction, useQuery } from "convex/react";
import { AnimatePresence, motion } from "motion/react";
import { useCallback, useEffect, useRef, useState } from "react";
Expand All @@ -14,7 +20,6 @@ import { ComponentMenu } from "@/components/editor/component-menu";
import { FrontmatterPanel } from "@/components/editor/frontmatter-panel";
import { LivePreview } from "@/components/editor/live-preview";
import { type CompileStatus, StatusBar } from "@/components/editor/status-bar";
import { useTheme } from "@/components/shared/theme-provider";
import { MetadataPanel } from "@/components/workspace/metadata-panel";
import { ProjectPicker } from "@/components/workspace/project-picker";
import { Sidebar } from "@/components/workspace/sidebar";
Expand Down Expand Up @@ -71,7 +76,6 @@ export default function EditorPage() {
// memoization wins, since most expensive children (CodeEditor,
// LivePreview) own their own internal memoization already.
"use no memo";
const { toggleTheme, resolvedTheme } = useTheme();

// ── Convex ──
const projects = useQuery(api.projects.list) as ProjectRecord[] | undefined;
Expand Down Expand Up @@ -645,10 +649,7 @@ export default function EditorPage() {
className="flex flex-col h-screen"
style={{ backgroundColor: "var(--background)" }}
>
<WelcomeHeader
resolvedTheme={resolvedTheme}
toggleTheme={toggleTheme}
/>
<WelcomeHeader />

<div
className="flex-1 flex flex-col items-center justify-center"
Expand Down Expand Up @@ -810,17 +811,9 @@ export default function EditorPage() {
style={{ backgroundColor: "var(--background)" }}
>
{/* Header */}
<header
className="h-11 flex items-center justify-between px-4 border-b shrink-0"
style={{ borderColor: C.border, backgroundColor: C.headerBg }}
>
<header className="flex h-12 shrink-0 items-center justify-between border-b border-line bg-invert px-5 text-invert-fg">
<div className="flex items-center gap-3">
<span
className="text-[13px] font-bold uppercase tracking-[0.08em]"
style={{ fontFamily: "var(--font-mono)", color: C.headerText }}
>
Wikipefia Studio
</span>
<AppWordmark product="Studio" />
<button
type="button"
onClick={() => setPickerOpen(true)}
Expand Down Expand Up @@ -879,19 +872,10 @@ export default function EditorPage() {
/>
</motion.div>
</AnimatePresence>
<button
type="button"
onClick={toggleTheme}
className="h-[30px] w-[30px] flex items-center justify-center border cursor-pointer transition-colors"
style={{
borderColor: "rgba(255,255,255,0.15)",
color: C.headerText,
}}
>
<span className="text-[14px]">
{resolvedTheme === "dark" ? "\u2600" : "\u263E"}
</span>
</button>
<ThemeToggle
size="icon-sm"
className="border-invert-fg/25 text-invert-fg hover:border-accent hover:text-accent"
/>
</div>
</header>

Expand Down Expand Up @@ -1171,42 +1155,6 @@ export default function EditorPage() {
);
}

function WelcomeHeader({
resolvedTheme,
toggleTheme,
}: {
resolvedTheme: string;
toggleTheme: () => void;
}) {
return (
<header
className="h-11 flex items-center justify-between px-4 border-b shrink-0"
style={{ borderColor: C.border, backgroundColor: C.headerBg }}
>
<div className="flex items-center gap-3">
<span
className="text-[13px] font-bold uppercase tracking-[0.08em]"
style={{ fontFamily: "var(--font-mono)", color: C.headerText }}
>
Wikipefia Studio
</span>
<Badge variant="accent" className="text-[9px] tracking-[0.15em]">
MDX Editor
</Badge>
</div>
<button
type="button"
onClick={toggleTheme}
className="h-[30px] w-[30px] flex items-center justify-center border cursor-pointer transition-colors"
style={{
borderColor: "rgba(255,255,255,0.15)",
color: C.headerText,
}}
>
<span className="text-[14px]">
{resolvedTheme === "dark" ? "\u2600" : "\u263E"}
</span>
</button>
</header>
);
function WelcomeHeader() {
return <AppHeader product="Studio" />;
}
2 changes: 1 addition & 1 deletion apps/studio/lib/theme.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { C } from "@wikipefia/mdx-renderer";
export { C } from "@wikipefia/ui";
Loading