Repository navigation
web UI: style ranking page (comparisons, Favorite Foods, Dining Hall Ranking) - #59
Merged
Merged
Conversation
#38 AC2 requires ranked vs. unranked dining halls to be visually distinguishable, not just distinguishable by wording ("not enough data yet"). The existing assertions only checked text content, which would stay green even if the .card treatment on ranked rows regressed back to a plain list. Pin it to the actual class the WIP styling applies. Red/green: removing "card" from the ranked <li>'s class list in +page.svelte fails this assertion (toHaveClass(/card/) unexpected value "flex items-center gap-3 border-l-4 border-l-gold-500 px-4 py-3"); restoring it passes. Full 17-test e2e suite green afterward.
4 tasks
4 tasks done
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.
Closes #38
What this is
Cherry-picked
wip/rank-page-styling(d676481) onto currentmainunchanged, then added one e2e assertion the WIP itself didn't have coverage for. Two commits:d20e498— the inherited WIP, applied verbatim (no edits).e663ccd— new: e2e assertion for AC2's "not just text" requirement, with its own red/green cycle.Why the WIP was safe to reuse (not reimplement)
The issue comment flagged the WIP as written against a pre-merge shell. I checked:
git diff 1139de3:web/src/routes/rank/+page.svelte main:web/src/routes/rank/+page.svelteis empty — the rank page's script/markup onmaintoday is byte-identical to what it was at the WIP's merge-base. Nothing about the "landed vs. pre-merge shell" gap actually touched this file.git cherry-pick d676481onto currentmainapplied with zero conflicts, confirming it.The WIP's styling approach also matches the established convention in already-landed, already-reviewed code (
web/src/routes/halls/[slug]/+page.svelte): mix the listed component classes (.card,.btn*,.empty-state,.page-title,.section-title,.badge,.label-rule) with Tailwind utilities built only from the six@themetokens (maroon-900,maroon-600,gold-500,cream-100,paper-50,ink-900). No new hex colors, noapp.cssedit.Acceptance criteria
bg-maroon-900panel with large equal-weight cards; Skip is demoted to a ghost button. Ranked halls get the shared.cardsurface + gold left-border + rank number; unranked halls drop the card treatment entirely (dashed border-top, en-dash glyph, muted text) — a genuinely different surface, not just the "(not enough data yet)" caption. This is now asserted directly (see red/green below), not just eyeballed.npx playwright testpasses unchanged — ran the full suite atPORT=4301, 17/17 green, includingrank.spec.ts's existing assertions untouched. Log:pnpm --filter web checkclean, CI passes —svelte-check:396 FILES 0 ERRORS 0 WARNINGS 0 FILES_WITH_PROBLEMS.pnpm --filter web buildalso succeeds (Vite + SvelteKit build,.envfrom.env.example).Red/green evidence
Two mutation cycles (one per behavior class touched):
1. Winner/loser wiring (WIP's restructured comparison buttons) — swapped the
choose(choice, pair![1-i])args tochoose(pair![1-i], choice)on the winner button (one line). Red:Reverted the swap → full suite green again (17/17).
2. AC2 visual-distinction assertion (new spec code,
e663ccd) — removedcardfrom the ranked<li>'s class list (one line) in+page.svelte. Red:Restored
card→ green, full suite re-run 17/17.Hydration-proofing
rank.spec.tsalready used the same star-clicktoPassretry pattern asweb/e2e/shell.spec.ts'sproveHydratedbefore any client-side navigation; unchanged, no bare timeouts, nothing to add.Data residency
No Supabase calls added or touched. Ranking (pairwise comparisons + computed order) stays IndexedDB-only, as before —
syncDiningHallRanks(server-stored favorite halls only, session-gated, fire-and-forget) is pre-existing and unchanged frommain. No auth gate added to this page.Live verification
Ran the actual dev server on a non-default port (4302) and drove it with a throwaway Playwright script (not committed) mirroring
rank.spec.ts's flow: mock/api/menu, favorite+open Hampshire, log French Toast + Fried Plantain, navigate to/rank, screenshot..empty-statepanel, CTA button..cardrows, and Hampshire in the ranked list with a gold left-border card while Worcester/Franklin/Berkshire sit in the demoted dashed unranked list.Scope / what I didn't touch
Only
web/src/routes/rank/+page.svelteandweb/e2e/rank.spec.ts, per dispatch scope. Noapp.css, no+layout.svelte, no other route or e2e spec.Housekeeping
wip/rank-page-stylingis now safe to delete (fully incorporated as commitd20e498here) — left it alone per instructions, someone with delete rights should remove it.Not merging this myself, per dispatch instructions.