ux: extract the three surfaces every screen was rewriting - #387
Open
huyplb wants to merge 2 commits into
Open
Conversation
Counted, not judged by eye: the frontend held 85 distinct card/panel class strings, and the small uppercase label above a group came in eight spellings across some seventy uses — text-[10px] and text-[11px], tracking-wide and tracking-wider, text-slate-400 and text-slate-500. None of that variation carried meaning. It is what screens look like when each is written alone. shared/components/surfaces.tsx now holds SectionLabel, Panel and StatCard. Named for the set and lowercase, per CONVENTIONS: a components file is PascalCase only when it exports one component. The access feature already had `labelCls` saying this once, but a feature cannot lend a primitive to another feature — architecture.test.ts forbids reaching into `features/*/lib`, and rightly. It now defers to the shared string so there is a single definition rather than a matching pair. Migrated the two places that had each grown their own stat card: Peek Insight (Rows / Null-heavy / High distinct) and the snapshot briefing. The briefing was a run of coloured numbers — "+3 ~2 −0" — which asks the reader to supply the nouns; it now names them, which is what the mockup shows. StatCard keeps the hint line optional on purpose. A row count estimated from a catalog and one arrived at by counting are different claims, and that line is where the difference gets said; rendering it empty would read as a value that failed to load. Eight tests, A/B'd against three deliberate breaks — tone moved to the label, hint rendered unconditionally, a falsy value blanked to an em dash. Each break fails the test written for it. Suite: 3625 passed, 0 failed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_eb93ab0c-fb99-4e6b-8d14-4627e89091f7) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First of three slices toward the mockups. Retargeted at
main, since #385 landed there and its branch is gone.What the mockups actually needed
Most of the mockup functionality already exists — #385 shipped it. What did not exist was a consistent surface to render it on. Counted, not judged by eye:
text-[10px]vstext-[11px],tracking-widevstracking-wider,text-slate-400vstext-slate-500None of that variation carried meaning. It is what screens look like when each is written alone, and it is the main reason the UI reads as less finished than the mockups do.
The change
shared/components/surfaces.tsx—SectionLabel,Panel,StatCard. Lowercase filename per CONVENTIONS: a components file is PascalCase only when it exports a single component.The access feature already said this once with
labelCls, but a feature cannot lend a primitive to another feature —architecture.test.tsforbids reaching intofeatures/*/lib, correctly. It now defers to the shared string, so there is one definition instead of a matching pair free to drift.Migrated the two places that had each grown their own stat card:
+3 ~2 −0, which asks the reader to supply the nouns. It names them now, as the mockup shows.StatCardkeeps the hint optional deliberately. A row count estimated from a catalog and one arrived at by counting are different claims; that line is where the difference gets said, and rendering it empty would read as a value that failed to load.Verification
Eight tests, A/B'd against three deliberate breaks — tone moved from value to label, hint rendered unconditionally, a falsy value blanked to an em dash. Each break fails the test written for it, so none are vacuous.
Suite: 3627 passed, 0 failed. Typecheck clean.
The next two slices, and what they cost
sizeBytesneeds a different catalog expression in each of the 14 dialect probes, each worth verifying against a live engine. And the orphan figures in the mockup ("14 orphans · 99.99% matched") need a realWHERE NOT EXISTSscan, which contradicts the contracttable-insight.service.tsstates in its own header — "Catalog-only … Never COUNT(DISTINCT)". I plan to make orphans an explicit opt-in probe so the default load stays cheap and the two claims stay separable.🤖 Generated with Claude Code
Note
Low Risk
Presentation-layer refactor with preserved test IDs and unit tests; no API, auth, or data-path changes.
Overview
Introduces
shared/components/surfaces(SectionLabel,Panel,StatCard, plussectionLabelCls/panelCls) so card layout and micro-labels stop diverging across features. AccesslabelClsnow re-exportssectionLabelClsinstead of a duplicate Tailwind string.Data Peek Insight and Lokee version briefing drop hand-rolled stat boxes in favor of
StatCard(named labels, optional hints, tone on the value). The briefing moves from a single row of+ / ~ / −numbers to a three-column card grid.Adds
surfaces.test.tsx(label consistency, tone/hint/zero-value behavior, optional panel padding). The diff also adds planning docsexcel-and-sheets-import.mdandrestructure.mdwith no runtime changes.Reviewed by Cursor Bugbot for commit b9a6708. Bugbot is set up for automated code reviews on this repo. Configure here.