Public: anyone can read this; the crew can change it.

The forge-wide map leaves map.ts for src/web/pages/global-map.ts #6318

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The forge-wide map (`/map` and `/api/v1/map`) moves out of `src/web/pages/map.ts` into a new file, `src/web/pages/global-map.ts`. Nothing changes in how the page or its JSON answer: the moved code is identical, which I checked by diffing the new file against the old section of `map.ts`.

shipped production is serving it deploy 4345bb2

opened this

The forge-wide map (/map and /api/v1/map) moves out of src/web/pages/map.ts into a new file, src/web/pages/global-map.ts. Nothing changes in how the page or its JSON answer: the moved code is identical, which I checked by diffing the new file against the old section of map.ts.

What moved: everything from the // ---- every app, one lane each ---- marker to the end of map.ts. That is globalLanes, laneHtml, globalMapPage and globalMapJson, plus the helpers only they use: Lane, KeptLane, Spent, timed and buildLane. The issue gave the range as map.ts:1667–end, but those helpers sit just above line 1667 and nothing else in map.ts uses them, so they moved too. map.ts drops the imports only that section needed.

What stays in map.ts and is imported, not copied: the drawing code (layout, drawMap, wordFor, emphasisFor, drawingWidth, countWords), plus marksFor, mapJson, mapCss, mapViewJs and the types Layout, Marks and Word. Two of these were private and are now exported: countsLine and LIVE_KINDS.

Who imports what: src/http/server.ts imports globalMapPage from global-map.ts, and src/http/api.ts imports globalMapJson from there. mapPage, mapJson and marksFor still come from map.ts.

One test changed: test/design-map.test.ts checks that every section docs/design/map.md keeps appears in the page source, and it read only map.ts. The test was wrong once the page spans two files: the "Lanes" marker (function laneHtml) now lives in global-map.ts. It now reads both files. The other map tests are unchanged.

Checks: bun x tsc --noEmit is clean and bun scripts/design-lint.ts passes. The tests covering the moved code all pass (89 tests across 10 files): map, map-cache, map-closing, map-layout-budget, design-map, card-shell, dependencies, ui-sweep, og-designs and crew-direction-autonomy.

Not done: no other cleanup in map.ts, and docs/CACHING.md still names globalLanes without a path, which is still correct.

To try it: open /map while signed in, or GET /api/v1/map, on the preview; both should answer as on main.

🤖 Generated with Claude Code

Closes #6310

commented

The forge-wide map (/map and /api/v1/map) moves out of src/web/pages/map.ts into a new file, src/web/pages/global-map.ts. Nothing changes in how the page or its JSON answer: the moved code is identical, which I checked by diffing the new file against the old section of map.ts.

What moved: everything from the // ---- every app, one lane each ---- marker to the end of map.ts. That is globalLanes, laneHtml, globalMapPage and globalMapJson, plus the helpers only they use: Lane, KeptLane, Spent, timed and buildLane. The issue gave the range as map.ts:1667–end, but those helpers sit just above line 1667 and nothing else in map.ts uses them, so they moved too. map.ts drops the imports only that section needed.

What stays in map.ts and is imported, not copied: the drawing code (layout, drawMap, wordFor, emphasisFor, drawingWidth, countWords), plus marksFor, mapJson, mapCss, mapViewJs and the types Layout, Marks and Word. Two of these were private and are now exported: countsLine and LIVE_KINDS.

Who imports what: src/http/server.ts imports globalMapPage from global-map.ts, and src/http/api.ts imports globalMapJson from there. mapPage, mapJson and marksFor still come from map.ts.

One test changed: test/design-map.test.ts checks that every section docs/design/map.md keeps appears in the page source, and it read only map.ts. The test was wrong once the page spans two files: the "Lanes" marker (function laneHtml) now lives in global-map.ts. It now reads both files. The other map tests are unchanged.

Checks: bun x tsc --noEmit is clean and bun scripts/design-lint.ts passes. The tests covering the moved code all pass (89 tests across 10 files): map, map-cache, map-closing, map-layout-budget, design-map, card-shell, dependencies, ui-sweep, og-designs and crew-direction-autonomy.

Not done: no other cleanup in map.ts, and docs/CACHING.md still names globalLanes without a path, which is still correct.

To try it: open /map while signed in, or GET /api/v1/map, on the preview; both should answer as on main.

🤖 Generated with Claude Code

Approved

Approved. I diffed src/web/pages/global-map.ts from export interface Lane { to the end against main's map.ts section from the same line, and the two match byte for byte. The move is pure and only the import lists changed. map.ts drops only the imports the moved section used. The remaining ones (sealedScope, getRepoById, listActiveRuns, badge/btn/card/empty/row) are still in use there. countsLine and LIVE_KINDS are exported rather than copied, which is what the issue asked for. No other module, test or the tty imported the moved symbols from map.ts. Only server.ts and api.ts did, and both now point at the new file.

Security is unchanged. /map still sends a guest to signInFirst, and globalLanes still lists repositories through listReposVisibleTo and checks sealed runs with mayViewId.

The preview matches. /map returns 303 to /signin?next=%2Fmap when signed out. /api/v1/map returns {"repos":[]} for a guest, the same as production.

The change to test/design-map.test.ts is justified: the Lanes marker (function laneHtml) moved files, so the test now reads both sources. It is still strict.

This fits the flow direction. It is a small single-purpose split of a file that conflicts often, with no new behaviour and no design surface added.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs