docs(gotchas): document PR #332 hero invariants — container-query split + sign-aware MoS#333
Merged
Merged
Conversation
…t + sign-aware MoS) PR #332 (stock-detail hero rework) merged as a fast spot-check-driven UI iteration and skipped the CLAUDE.md/AGENTS.md substance lockstep. Add the two invariants future editors must not regress: 1. The hero's two-column (name-left / stats-top-right) vs stacked decision is driven by a CSS CONTAINER QUERY on the hero's own inline-size, NOT a viewport md:/lg: breakpoint — because the sidebar eats a viewport-variable width slice (the dead-band bug that prompted the rework). JSX default is the stacked flex-col; @container only adds the row; raw CSS, no plugin/dep. 2. The MoS gauge arc is sign-aware: >=0 clockwise (like the score gauge), <0 counter-clockwise via -scale-x-100 on the container with the number span mirrored back. 329/502 of the universe is negative, so CCW is the common case. CLAUDE.md §Gotchas holds the full rationale; AGENTS.md §Code style mirrors each as a pointer (PR #327 precedent). PHASE_STATUS_INFLIGHT.md entry per the ship-with-every-PR convention. Doc-only — the hero code already shipped in #332. https://claude.ai/code/session_0148EoMmL6zakDWqHXjqQ9yq
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Documentation backstop for PR #332 (stock-detail hero rework, merged
43838c6). That PR shipped as a fast, spot-check-driven UI iteration and skipped the CLAUDE.md / AGENTS.md substance lockstep. This adds the two invariants future editors must not regress.Doc-only — no compute / schema / scoring / valuation / frontend CODE change. The hero code already landed in #332; this is the documentation only.
The two invariants documented
Hero splits on a CSS CONTAINER QUERY, not a viewport breakpoint
(
frontend/app/stock/[ticker]/page.tsx+globals.css.hero-card/@container hero (min-width: 46rem)).The left
Sidebareats a viewport-variable width slice (expanded 240px / collapsed 64px / drawer 0px), so amd:/lg:viewport gate left a dead band where the sidebar was already a desktop rail but the hero still stacked — the bug that prompted the rework. The container query measures the hero's real inline-size after the sidebar's cut. JSX default = stackedflex-col; the@containerrule only ADDS the row (pre-2023 browsers degrade to the safe stack). Raw CSS, no@tailwindcss/container-queriesplugin / no new dep.MoS gauge arc is SIGN-AWARE (
frontend/components/MoSBadge.tsx).MoS ≥ 0 sweeps clockwise (like the score gauge); MoS < 0 sweeps counter-clockwise via
-scale-x-100on the gauge container, with the number<span>carrying its own-scale-x-100to un-mirror back to readable. 329/502 of the universe is negative MoS → CCW is the common case. Both mirrors move in lockstep.Where it landed
Verification
ruff check .https://claude.ai/code/session_0148EoMmL6zakDWqHXjqQ9yq
Generated by Claude Code