Skip to content

fix(frontend): match chart fair/target reference lines + always-show price chips (post-#322)#323

Merged
dackclup merged 5 commits into
mainfrom
claude/optimistic-brown-UUcXA
May 29, 2026
Merged

fix(frontend): match chart fair/target reference lines + always-show price chips (post-#322)#323
dackclup merged 5 commits into
mainfrom
claude/optimistic-brown-UUcXA

Conversation

@dackclup
Copy link
Copy Markdown
Owner

@dackclup dackclup commented May 29, 2026

What

Two post-#322 follow-ups to the per-stock price chart, bundled on this branch.

1. Chart fair/target reference-line + chip restyle (user request) — 2aed22b · 247478e2 · ede3653f

Tweaks to PriceHistoryChart.tsx:

  1. Target line same thickness as the fair-value line — both strokeWidth={1.5} (were both implicit default 1; the mismatch the user saw was reinforced by the 1px-vs-2px legend swatches).
  2. Fair-value line the same "white" as the target line — fair stroke flips from the always-gray #94a3b8 to the target's theme-aware isDark ? '#e2e8f0' : '#0f172a'. Near-white in dark mode (the user's mode), near-black on #FAFAFA in light mode (~19:1 contrast — deliberately not literally white, which would vanish on the light bg). Distinguishable by dash only (fair 5 3 dashed, target solid).
  3. In-chart text labels removed — dropped the label={{...}} prop from both <ReferenceLine>s (no more "Fair $X" / "Target $X" floating on the lines).
  4. Fair/target chips below the price headline now always shown — render condition flips from fairOffChart/targetOffChart (off-y-domain only) → fairIsNumber/targetEligible (whenever the value exists); the chips are now the canonical number read. Removed the now-unused *OffChart consts; legend swatches updated to match the new lines; chip price spans gained tabular-nums.
  5. Signed % delta after each chip value (247478e2) — each chip shows the % distance from the current price after the dollar value, e.g. Fair $125.92 (-14.7%) / Target $169.82 (+15.0%). + = upside / − = downside, sign matching the green/red cue; one decimal; suppressed if current price is missing/≤0.
  6. Current-price as-of date (ede3653f) — the latest close's date renders as a third muted line below the change indicator (as of May 28, 2026, via the existing formatTooltipLabel). Constant across period switches — it's the current price's date, matching the headline price + the latest-point tooltip.

Frontend-only; no schema / compute / scoring / valuation change.

Verified: frontend-design-reviewer zero-FAIL (READY-FOR-SPOT-CHECK) — light-mode contrast OK (#0f172a on #FAFAFA ≈ 19:1; no white-on-white), a11y floor holds (color + dash + text = three signals). DOM inspection + dark-mode mobile (414×896, isMobile) Playwright screenshots — APH (lines in-range; Fair $125.92 (-14.7%) / Target $169.82 (+15.0%)), AAPL (off-chart, chip-only; Fair $172.51 (-44.8%) / Target $342.37 (+9.6%)), AMD (well-separated) — confirm both <line>s render stroke #e2e8f0 / width 1.5 / fair dashed / target solid / no label, chips show value + signed %, and the as-of date renders below the change row. ruff + tsc + next build (506 routes) clean.

2. Document the overflow-x: clip invariant (§Gotcha) — eba33f7

Fast-follow to #322 (merged fd045277), recommended by both quantrank-reviewer (opus) and phase-coordinator at the #322 merge gate. The html, body { overflow-x: clip } added in #322 is a non-obvious site-wide invariant; this gives it a durable home in CLAUDE.md §Gotchas (+ an AGENTS.md §Code-style mirror): keep clip NOT hidden (hidden creates a scroll container → breaks the sticky sidebar/header); page-level horizontal scroll is intentionally impossible → wide content nests its own overflow-x-auto (the RankingTable pattern); the chart-remount + fixed-backdrop root cause; Safari 16+ / Chrome 90+ support floor. Doc-only.

Lockstep

CLAUDE.md + AGENTS.md substance diff (the §Gotcha) + PHASE_STATUS_INFLIGHT.md entries for the chart change.

https://claude.ai/code/session_0144kHrCYNaamMPH57b7xdM7


Generated by Claude Code

Fast-follow to PR #322 (recommended by quantrank-reviewer + phase-coordinator at
the merge gate). The html, body { overflow-x: clip } added in #322 is a
non-obvious site-wide invariant; document it durably so a future frontend author
doesn't break it.

CLAUDE.md §Gotchas + AGENTS.md §Code-style mirror record: keep clip NOT hidden
(hidden creates a scroll container and breaks the sticky sidebar/header; clip
does not); page-level horizontal scroll is intentionally impossible, so wide
content nests its own overflow-x-auto (RankingTable pattern); the chart-remount +
fixed-backdrop root cause; Safari 16+ / Chrome 90+ support (older degrades to
prior behavior, not a regression).

Doc-only; lockstep via the CLAUDE.md + AGENTS.md substance diff. ruff clean.

https://claude.ai/code/session_0144kHrCYNaamMPH57b7xdM7
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
quantrank Ready Ready Preview, Comment May 29, 2026 6:55pm

…price chips

Per user request, four coupled tweaks to PriceHistoryChart's fair-value +
target reference lines and the chip row below the price headline:

1. Target line same stroke-width as the fair-value line (both strokeWidth=1.5;
   were both implicit default 1).
2. Fair-value line adopts the target's theme-aware color
   (isDark ? #e2e8f0 : #0f172a) — near-white in dark mode (the user's mode),
   near-black on #FAFAFA in light mode (~19:1, deliberately not literally
   white). The two lines stay distinguishable by dash only (fair dashed 5 3,
   target solid).
3. Remove the in-chart "Fair $X" / "Target $X" text labels from both
   ReferenceLines (dropped the label prop).
4. Always show the fair/target chips below the price headline (condition was
   off-y-domain-only -> now whenever the value exists; the chip is the
   canonical number read). Removed the now-unused fairOffChart/targetOffChart
   consts; legend swatches updated to match the new lines (both near-black/
   white, equal weight, dark:*-slate-200 matching #e2e8f0); chip price spans
   gained tabular-nums.

Frontend-only; no schema/compute/scoring/valuation change. Verified:
frontend-design-reviewer zero-FAIL; ruff + tsc + next build (506) clean;
3 dark-mode mobile Playwright screenshots (APH/AAPL/AMD) confirm both lines
render white/1.5/dash-distinguished/no-label and the chips always show.

https://claude.ai/code/session_0144kHrCYNaamMPH57b7xdM7
@dackclup dackclup changed the title docs: record the global overflow-x:clip invariant in CLAUDE.md §Gotchas fix(frontend): match chart fair/target reference lines + always-show price chips (post-#322) May 29, 2026
…et chips

Each price chip below the chart headline now shows the signed % distance from
the current price after the dollar value, e.g. "Fair $125.92 (-14.7%)" /
"Target $169.82 (+15.0%)". Positive = upside (reference above current price),
negative = downside; the sign matches the chip's existing green/red cue. One
decimal; suppressed when current price is missing or <= 0.

Frontend-only; no schema/compute/scoring/valuation change. Follows 2aed22b on
this branch (PR #323).

https://claude.ai/code/session_0144kHrCYNaamMPH57b7xdM7
The price headline now renders the current price's as-of date (e.g. "as of
May 28, 2026") as a third muted line below the +/-change row, via the existing
formatTooltipLabel helper. It's the latest close's date — constant across
period switches, matching the headline price and the latest-point tooltip.

Frontend-only; no schema/compute/scoring/valuation change. Follows 247478e on
this branch (PR #323).

https://claude.ai/code/session_0144kHrCYNaamMPH57b7xdM7
…adline

Bump the current-price as-of date line from text-xs/slate-500 to
text-sm/slate-900 dark:slate-100 (same color as the $price headline), per user
request — more prominent and visually tied to the price it dates.

Frontend-only; no schema/compute/scoring/valuation change. Follows ede3653 on
this branch (PR #323).

https://claude.ai/code/session_0144kHrCYNaamMPH57b7xdM7
@dackclup dackclup marked this pull request as ready for review May 29, 2026 19:45
@dackclup dackclup merged commit 4f7edf1 into main May 29, 2026
4 checks passed
@dackclup dackclup deleted the claude/optimistic-brown-UUcXA branch May 29, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants