Skip to content

Commit 8517021

Browse files
Edwin ChanEdwin Chan
authored andcommitted
Simplify metric cards and tag contrast
1 parent c79b20b commit 8517021

11 files changed

Lines changed: 38 additions & 90 deletions

File tree

CENTRAL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Stack: Next.js, NextAuth (Google + dev bypass), Prisma, KaTeX for math, Lucide i
3333

3434
### Recently landed
3535

36-
- **Hand-drawn visual system** — `app/globals.css` now provides paper/ink design tokens, graph-paper backgrounds, asymmetric squircle cards and controls, marker-color accents, and irregular badges/tabs. Shared surfaces use native asymmetric borders instead of `border-image`, which created rigid grey rectangles outside rounded controls. Dark structural borders are intentionally quieter, and search inputs are borderless at rest with one cyan focus stroke instead of cyan-plus-yellow highlighting. Global wavy eyebrow/title underlines remain removed. A signed-in production Chrome audit of `/problem-sets/1991-ajhsme` also removed percentage shape paths from variable-height panels, fixed oversized panel-header geometry, and removed the blue statement band. Desktop navigation is a 64 px icon rail that expands to 240 px on hover/focus, while mobile retains the stable off-canvas sheet. The simplified Sigma in `public/dbsmo-mark.svg` is shared by favicon metadata and the landing brand. `app/layout.tsx` loads Shantell Sans for display/control text while Inter remains the body and math font. Route-specific coverage was visually audited across dashboard, problem catalog/detail, writeups, practice, classes, leaderboard, users/profiles, settings, and admin surfaces; FTW and Playground were intentionally excluded. Unsupported browsers retain ordinary border/radius fallbacks; details are in `docs/visual-system.md`.
36+
- **Hand-drawn visual system** — `app/globals.css` now provides paper/ink design tokens, graph-paper backgrounds, asymmetric squircle cards and controls, marker-color accents, and irregular badges/tabs. Shared surfaces use native asymmetric borders instead of `border-image`, which created rigid grey rectangles outside rounded controls. Metric cards use the same neutral border on every edge instead of decorative colored strips. Dark structural borders are intentionally quieter, search inputs are borderless at rest with one cyan focus stroke, and selected problem-set tag counts use opaque ink/paper colors for readable contrast. Global wavy eyebrow/title underlines remain removed. A signed-in production Chrome audit of `/problem-sets/1991-ajhsme` also removed percentage shape paths from variable-height panels, fixed oversized panel-header geometry, and removed the blue statement band. Desktop navigation is a 64 px icon rail that expands to 240 px on hover/focus, while mobile retains the stable off-canvas sheet. The simplified Sigma in `public/dbsmo-mark.svg` is shared by favicon metadata and the landing brand. `app/layout.tsx` loads Shantell Sans for display/control text while Inter remains the body and math font. Route-specific coverage was visually audited across dashboard, problem catalog/detail, writeups, practice, classes, leaderboard, users/profiles, settings, and admin surfaces; FTW and Playground were intentionally excluded. Unsupported browsers retain ordinary border/radius fallbacks; details are in `docs/visual-system.md`.
3737
- **Mobile/classes cleanup** — fixed mobile `/problem-sets` hiding task rows by restoring the responsive card table, stabilized the mobile sidebar grid to avoid icon reflow on tap/focus, and made dashboard auth/actions render as a compact mobile account card. `/classes` now has a teacher/admin `Announcements` subtab that lists existing class messages and supports author/admin deletion. Display-name fallbacks now treat literal `"null"`/`"undefined"` strings as empty via `lib/display-name.ts`.
3838
- **Mobile sidebar focus fix** — mobile sidebar sheet geometry now remains stable under `:hover`, `:focus`, and `:focus-within`, preventing the nav grid from jumping upward when a mobile tap focuses one of the upper links (source: `app/globals.css`).
3939
- **Answer previews and LaTeX grading** — Practice and problem-set answer boxes now render a small KaTeX preview above the input using `mathInputToTex(...)`. `lib/grading.ts` normalizes math delimiters and common LaTeX forms through `lib/math-input.ts`, so expression answers and answer keys can use `$...$`, `\sqrt{...}`, coefficients before functions like `5\sqrt{2}-7`, `\frac{...}{...}`, braced powers, and `\pi`.

DBSMO/Projects/dbsmo/Common Tasks.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Start with the final `Hand-drawn shape system` and `Hand-drawn route coverage` s
1919

2020
The public sign-in sketch markup lives in `app/page.tsx`. Keep it `aria-hidden` because it is decorative. Inter/Shantell Sans variables are configured in `app/layout.tsx`; do not apply the handwriting font to answer inputs, equations, or long body copy. Shared hand-drawn outlines use native borders with asymmetric radii and progressive `corner-shape`; do not restore `border-image`, because it paints rigid rectangular frames outside squircles. Update light and dark ink tokens together and test desktop plus mobile widths. Search inputs should remain borderless at rest inside the search panel and use one cyan focus border without an additional outline. Never use percentage-based `border-shape` paths on variable-height panels: a 7,000 px problem panel turns a 1% path offset into 70 px. Do not restore global wavy eyebrow/title underlines. Include a long problem set in visual QA. The current route audit excludes FTW and Playground. Implementation/support notes are in `docs/visual-system.md`.
2121

22+
Metric cards are deliberately neutral summary surfaces. Add new metrics with only `metric-card`; do not add `accent-*` classes or colored edge borders. Selected problem-set category counts use an opaque `--paper-raised` background and `--ink` text so both themes retain readable contrast (source: `app/globals.css`).
23+
2224
## Add or Change an Answer Type
2325

2426
Edit:

DBSMO/Projects/dbsmo/Components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This note maps important [[dbsmo]] UI/components to their source files and usage
3030
## Student Dashboard and Catalog
3131

3232
- `DashboardPage` in `app/dashboard/page.tsx`: server-rendered dashboard that loads current user, class announcements, visible sets, attempts, student rows for admins, computes completion/score/topic metrics, and renders pinned announcements, metric cards, next actions, and recent set rows.
33-
- `MetricCard` in `app/dashboard/page.tsx`: local component for dashboard metric cards.
33+
- `MetricCard` in `app/dashboard/page.tsx`: local component for dashboard metric cards. Dashboard and admin metric cards intentionally share a neutral border without per-card colored edge accents (sources: `app/dashboard/page.tsx`, `app/admin/analytics/page.tsx`, `app/admin/feedback/page.tsx`, `app/admin/sets/[id]/analytics/page.tsx`, `app/admin/students/[id]/page.tsx`, `app/globals.css`).
3434
- `AssignmentsWidget` in `app/dashboard/assignments-widget.tsx`: client component that fetches `/api/assignments/mine`, sorts assignments, and renders up to five dashboard assignment links.
3535
- `ProblemSetsPage` in `app/problem-sets/page.tsx`: route page that handles catalog filtering/sorting/views/recommendations/pagination and renders set cards/links.
3636
- `ProblemSetPage` in `app/problem-sets/[slug]/page.tsx`: route page that loads a set by slug and chooses inline-statement vs PDF/file layout.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,6 @@ Session updates from the CodeGraph/Second Brain indexing pass onward:
6060
- Replaced regex-based math splitting with an escape-aware tokenizer, fixing HTML-style `<math>\$2000</math>` imports such as 1996 AJHSME question 18; added conservative package-style aliases and security regression coverage for hostile HTML, trusted KaTeX commands, recursive macros, and macro leakage.
6161
- Fixed every unsupported expression found in a production sweep of the 1985-1998 AJHSME sets: position-qualified `tabular` layouts now convert to safe KaTeX arrays for 1987 Q8/Q23, 1989 Q14/Q22, 1990 Q9, and 1991 Q6. Added safely portable MathLive notation aliases without enabling HTML/resource-loading commands.
6262
- Removed the rectangular `border-image` frames that appeared outside existing rounded controls, simplified search focus to one cyan stroke, and softened repeated structural borders in dark mode.
63+
- Removed colored edge accents from every metric card and increased selected problem-set tag count contrast in both themes.
6364

6465
© 2026 Cosmic Crusader

app/admin/analytics/page.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -566,35 +566,35 @@ export default async function AnalyticsOverviewPage({
566566
/>
567567

568568
<section className="metric-grid analytics-metric-grid" aria-label="Overview metrics">
569-
<article className="metric-card accent-cyan">
569+
<article className="metric-card">
570570
<small>Total responses</small>
571571
<strong>{totalResponses}</strong>
572572
</article>
573-
<article className="metric-card accent-purple">
573+
<article className="metric-card">
574574
<small>Overall accuracy</small>
575575
<strong>{overallAccuracy}%</strong>
576576
</article>
577-
<article className="metric-card accent-pink">
577+
<article className="metric-card">
578578
<small>First attempt avg</small>
579579
<strong>{firstAttemptAccuracy}%</strong>
580580
</article>
581-
<article className="metric-card accent-orange">
581+
<article className="metric-card">
582582
<small>Best attempt avg</small>
583583
<strong>{bestAttemptAccuracy}%</strong>
584584
</article>
585-
<article className="metric-card accent-cyan">
585+
<article className="metric-card">
586586
<small>Active last 7d</small>
587587
<strong>{activeStudentCount}</strong>
588588
</article>
589-
<article className="metric-card accent-purple">
589+
<article className="metric-card">
590590
<small>Attempts last 7d</small>
591591
<strong>{recentAttemptCount}</strong>
592592
</article>
593-
<article className="metric-card accent-pink">
593+
<article className="metric-card">
594594
<small>Topics tracked</small>
595595
<strong>{topics.length}</strong>
596596
</article>
597-
<article className="metric-card accent-orange">
597+
<article className="metric-card">
598598
<small>Problem sets</small>
599599
<strong>{problemSets.length}</strong>
600600
</article>

app/admin/feedback/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ export default async function AdminFeedbackPage({
8686
<small>Total reports</small>
8787
<strong>{counts.all}</strong>
8888
</article>
89-
<article className="metric-card accent-pink">
89+
<article className="metric-card">
9090
<small>Open</small>
9191
<strong>{counts.open}</strong>
9292
</article>
93-
<article className="metric-card accent-orange">
93+
<article className="metric-card">
9494
<small>Reviewing</small>
9595
<strong>{counts.reviewing}</strong>
9696
</article>
97-
<article className="metric-card accent-purple">
97+
<article className="metric-card">
9898
<small>Resolved</small>
9999
<strong>{counts.resolved}</strong>
100100
</article>

app/admin/sets/[id]/analytics/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,19 @@ export default async function SetAnalyticsPage({ params }: Props) {
8181
</div>
8282
</header>
8383
<section className="metric-grid" aria-label="Set analytics">
84-
<article className="metric-card accent-cyan">
84+
<article className="metric-card">
8585
<small>Total attempts</small>
8686
<strong>{set.attempts.length}</strong>
8787
</article>
88-
<article className="metric-card accent-purple">
88+
<article className="metric-card">
8989
<small>Unique students</small>
9090
<strong>{students.size}</strong>
9191
</article>
92-
<article className="metric-card accent-pink">
92+
<article className="metric-card">
9393
<small>Average score</small>
9494
<strong>{avg}%</strong>
9595
</article>
96-
<article className="metric-card accent-orange">
96+
<article className="metric-card">
9797
<small>Questions</small>
9898
<strong>{set.problems.length}</strong>
9999
</article>

app/admin/students/[id]/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,19 @@ export default async function StudentDetailPage({ params, searchParams }: Props)
7373
</div>
7474
</header>
7575
<section className="metric-grid" aria-label="Student metrics">
76-
<article className="metric-card accent-cyan">
76+
<article className="metric-card">
7777
<small>Sets attempted</small>
7878
<strong>{sets.size}</strong>
7979
</article>
80-
<article className="metric-card accent-purple">
80+
<article className="metric-card">
8181
<small>Average score</small>
8282
<strong>{avg}%</strong>
8383
</article>
84-
<article className="metric-card accent-pink">
84+
<article className="metric-card">
8585
<small>Best score</small>
8686
<strong>{best}%</strong>
8787
</article>
88-
<article className="metric-card accent-orange">
88+
<article className="metric-card">
8989
<small>Total attempts</small>
9090
<strong>{n}</strong>
9191
</article>

app/dashboard/page.tsx

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -391,15 +391,11 @@ export default async function DashboardPage() {
391391
<AssignmentsWidget />
392392

393393
<section className="metric-grid" aria-label="Student progress metrics">
394-
<MetricCard
395-
label="Attempted"
396-
value={`${completedSets}/${totalSets || 0}`}
397-
accent="grey"
398-
/>
399-
<MetricCard label="Best average" value={`${averageScore}%`} accent="grey" />
400-
<MetricCard label="Latest score" value={`${latestScore}%`} accent="grey" />
394+
<MetricCard label="Attempted" value={`${completedSets}/${totalSets || 0}`} />
395+
<MetricCard label="Best average" value={`${averageScore}%`} />
396+
<MetricCard label="Latest score" value={`${latestScore}%`} />
401397
{currentUser.role === "ADMIN" ? (
402-
<MetricCard label="Open reports" value={`${openReports}`} accent="grey" />
398+
<MetricCard label="Open reports" value={`${openReports}`} />
403399
) : null}
404400
</section>
405401

@@ -574,17 +570,9 @@ export default async function DashboardPage() {
574570
);
575571
}
576572

577-
function MetricCard({
578-
label,
579-
value,
580-
accent,
581-
}: {
582-
label: string;
583-
value: string;
584-
accent: "cyan" | "purple" | "pink" | "orange" | "black" | "grey";
585-
}) {
573+
function MetricCard({ label, value }: { label: string; value: string }) {
586574
return (
587-
<article className={`metric-card accent-${accent}`}>
575+
<article className="metric-card">
588576
<small>{label}</small>
589577
<strong>{value}</strong>
590578
</article>

app/globals.css

Lines changed: 6 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,6 @@ body.has-site-sidebar .app-footer {
598598
border-radius: var(--radius-card);
599599
background: var(--color-card-bg);
600600
box-shadow: var(--shadow-soft);
601-
border-top: 5px solid var(--color-cyan);
602601
transition:
603602
transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
604603
box-shadow 220ms ease;
@@ -645,26 +644,6 @@ body.has-site-sidebar .app-footer {
645644
text-transform: uppercase;
646645
}
647646

648-
.accent-purple {
649-
border-top-color: var(--color-purple);
650-
}
651-
652-
.accent-pink {
653-
border-top-color: var(--color-pink);
654-
}
655-
656-
.accent-orange {
657-
border-top-color: var(--color-orange);
658-
}
659-
660-
.accent-black {
661-
border-top-color: var(--color-black);
662-
}
663-
664-
.accent-grey {
665-
border-top-color: var(--color-grey);
666-
}
667-
668647
.content-grid,
669648
.problem-layout,
670649
.import-layout {
@@ -3206,23 +3185,9 @@ html {
32063185
}
32073186

32083187
.metric-card {
3209-
border-top: 0;
3210-
border-left: 4px solid var(--color-cyan);
32113188
background: rgba(255, 255, 255, 0.96);
32123189
}
32133190

3214-
.accent-purple {
3215-
border-left-color: var(--color-purple);
3216-
}
3217-
3218-
.accent-pink {
3219-
border-left-color: var(--color-pink);
3220-
}
3221-
3222-
.accent-orange {
3223-
border-left-color: var(--color-orange);
3224-
}
3225-
32263191
.text-link {
32273192
color: var(--color-blue);
32283193
}
@@ -10764,22 +10729,6 @@ html:is(.light, .dark)
1076410729
text-wrap: balance;
1076510730
}
1076610731

10767-
html:is(.light, .dark) .metric-card {
10768-
border-left: 5px solid var(--marker-cyan);
10769-
}
10770-
10771-
html:is(.light, .dark) .metric-card.accent-purple {
10772-
border-left-color: var(--color-purple);
10773-
}
10774-
10775-
html:is(.light, .dark) .metric-card.accent-pink {
10776-
border-left-color: var(--marker-pink);
10777-
}
10778-
10779-
html:is(.light, .dark) .metric-card.accent-orange {
10780-
border-left-color: var(--marker-yellow);
10781-
}
10782-
1078310732
.problem-jump-button,
1078410733
.answer-nav-button {
1078510734
border: 2px solid var(--ink-soft);
@@ -11429,6 +11378,12 @@ html:is(.light, .dark) .class-announcement-targets label:has(input:checked) {
1142911378
color: var(--ink);
1143011379
}
1143111380

11381+
html:is(.light, .dark) .category-pill.active .category-pill-count {
11382+
border: 1px solid var(--ink-soft);
11383+
background: var(--paper-raised);
11384+
color: var(--ink);
11385+
}
11386+
1143211387
html:is(.light, .dark)
1143311388
:is(
1143411389
.search-panel input,

0 commit comments

Comments
 (0)