Repository navigation
Polish application shell and topic navigation - #12
Merged
Merged
Conversation
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.
Two real inconsistencies in the app chrome. No behaviour, data, routing or API changes.
1. The header divider didn't line up — and it wasn't a fixed offset problem
The sidebar brand header sized itself from its contents, while the main topbar was a fixed height:
So the divider sat low, and shifted when you collapsed the rail — which is why tuning an offset
would never have held. Fixed with one shared dimension instead:
Both headers now use
h-header. Collapsing changes the header's contents, never its height, sothe two borders form one continuous line in both states. The tile fits either way (64 − 2×4 = 56px of
content; 44px collapsed, 36px expanded).
2. Topic icons: same glyph, same grey, arbitrary wrapping
Every topic rendered the same
ScrollTextat the same muted grey, so the icon communicated nothing.Long titles then wrapped and pushed the mastery percentage onto a second line.
src/lib/topicIdentity.tsresolves a topic to an icon and accent, with two rules:same, every render and session. Nothing is random or time-seeded.
strong colour; navigation stays quiet and lets typography work. Accents use the same 400-level
tones as the subject cards so the two read as one system.
Your example set now resolves to distinct identities:
CpuNetworkGitBranchBrainMessagesSquareMicroscopeUsersShoppingBagBriefcaseDSA takes
GitBranchrather than sharing the graph icon with networking — your original suggestion.The row is now a real three-column grid — fixed icon,
min-w-0 flex-1 truncatetitle, fixed count.min-w-0is the part that actually enables ellipsis; without it flex children refuse to shrink. Thefull name stays available via
titleplus anaria-labelcarrying the mastery figure, and countsuse
tabular-numsso they stop jittering.A bug worth flagging
My first matcher used patterns like
/\boperating system\b/, and the trailing\bmade everyplural fall through to the hash fallback. "Operating Systems" and "Computer Networks" — the two most
common topics — got arbitrary fallback icons, which is precisely the bug being fixed. The tests caught
it by asserting on the very topics in your screenshot. Patterns are now plural-tolerant
(
operating systems?,networks?,algorithms?,databases?,internships?,labs?).Honest limitation: a fixed icon container plus a fixed glyph size normalises box size, but two
Lucide glyphs with different internal padding can still differ slightly in visual weight. That's a
property of the icon set, not something CSS can fully solve.
Tests — 28 new, and PR #8's suite earned its keep
topicIdentity.test.ts(28): determinism across repeated calls; the screenshot's topic list producesmore than one accent; subject-appropriate icons; a specific phrase beating a broad one
("Internship Report" → briefcase, not book); unknowns still deliberate rather than defaulting;
accents restricted to 300/400 tones with matched chip colours; empty title safe.
sidebarProportions.test.tsgained a shared-height contract test — and its two existing assertionsfailed on this refactor, because they pinned the exact className strings. That is the coupling
working: an earlier commit's tests caught a later change. Both are now rewritten to assert intent
(conditional centring, conditional padding) rather than brittle literals.
Two of my own mistakes were caught before commit: the plural
\bbug above, and a danglingexpect(from a bad edit that left the suite unparseable.
Verification
Also confirmed in the built CSS:
h-header{height:var(--app-header-height)}is emitted and--app-header-height:4remis present, so the token resolves in production rather than silentlyfalling back.
Needs a human eye: expanded and collapsed, plus a long topic name. These tests pin the geometry
contract and the identity function, not the rendered pixel.