Skip to content

Research Markets: Top movers read the overview's live heat grid (D533, #1080) - #1305

Merged
guillaumelauzier merged 1 commit into
mainfrom
agent/claude-b/1080-top-movers
Oct 6, 2026
Merged

guillaumelauzier merged 1 commit into
mainfrom
agent/claude-b/1080-top-movers

Conversation

@guillaumelauzier

Copy link
Copy Markdown
Contributor

Objective

On /research/markets, the "Top movers this month" card read "Not recorded", waiting on the Research overview in #1092. #1092 closed unmerged, but the overview reached main through #1151 (D536). This PR wires the card to it, to the Markets canvas. It was the one part of S1's 2026-10-05 list that #1150 left open.

Part of #1080

Implementation

frontend/src/pages/research/MarketDirectoryZone.jsx:

  • The read. The page reads GET /api/research/overview through researchOverviewApi.get(1).
    • It uses top=1 because it needs none of the overview's top-N lists.
    • The read uses the page's own useRead, so a failure stays on this card.
  • topMovers(heat, n = 4) ranks the heat grid's cells:
    • the four largest rises and the four largest falls in delta_pct, across the 12 sectors × 6 dimensions;
    • a cell with no live row, or no change recorded, is left out, never ranked as 0.
  • previousPeriod('YYYY-MM') gives the month before, for the caption: market_intel_indexes · global · 2026-10 against 2026-09.
  • Each row links to its sector page, /research/markets/sector/<slug>, which uses the same slug as research_sectors.ts. A ▲ or ▼ shows the change's sign.
    • As on the canvas, the change has no colour. The existing guard against a red index line on this page still holds.
  • States:
    • Loading.
    • Unreadable: the read failed, or the heat section answered unreadable.
    • Not recorded: carries the Worker's own reason, such as the month's index not being computed yet. If no cell changed, it says "No live index has a change on last month yet".
    • One side empty: reads "No live index rose (or fell) on last month".

Docs: a "Top movers" section in decisions/D533.md, and the ROUTE_MAP Markets row. Both used to say the movers waited on #1092.

Files changed

Testing

  • npm run build, then npm run test:drift > drift.log 2>&1; echo EXIT=$?, gives EXIT=0.
  • research_top_movers_d533.test.mjs fails on main. It covers:
    • the ranking, four each way;
    • leaving out unchanged and unrecorded cells;
    • the period caption, including January;
    • the rendered rows with their sign and sector link;
    • one empty side, and no change at all;
    • Unreadable for both failure shapes, and Not recorded with the Worker's reason;
    • the page's wiring.
  • research_markets_pages_d533 (18 tests) and research_markets_d593 (14) pass.
  • Mutations: 18 of 18 caught, each restored from a sha256-checked copy.
    • The first run had three survivors. Two were redundant guards that the sign filters already cover, so I removed them. The third was the falling-only case, which now has a test.

Risks

  • What ships: frontend only. The page makes one more signed-in read of an existing route, which does read-only aggregates. No migration, no Worker change, no wrangler.toml change.
  • Rollback: revert the PR.

Dependencies

#1151 (D536, the overview on main). #1150 (the Markets page).

Agent

S08 · Claude Code

Review requested

S1.

🤖 Generated with Claude Code

https://claude.ai/code/session_016Q3DcWsMTSxPxJa7tMeDAs


Generated by Claude Code

…#1080)

The card waited on #1092, which closed unmerged; the Research overview
reached main through #1151 (D536). The card now ranks the four largest
rises and falls on last month across the live index cells, each linked to
its sector page, with the period caption. A cell with no change recorded
is left out, never ranked as 0; a failed read is Unreadable and an index
not yet computed is Not recorded with the Worker's reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016Q3DcWsMTSxPxJa7tMeDAs
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Preview: https://studioos-pr-1305.guillaumelauzier.workers.dev (built from 26a7620)

The pull request's SPA build on a Worker with no bindings: pages and deep links work, /api/* is a 404, and nothing here can reach production data. Redeployed on every push; deleted when the PR closes.

@guillaumelauzier
guillaumelauzier marked this pull request as ready for review October 6, 2026 21:58
@guillaumelauzier
guillaumelauzier merged commit 35cbd9d into main Oct 6, 2026
21 checks passed
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