Skip to content

feat: file interior in reading order + code holograms - #10

Draft
bryan-uipath wants to merge 2 commits into
feat/scale-true-drillfrom
feat/file-spine
Draft

bryan-uipath wants to merge 2 commits into
feat/scale-true-drillfrom
feat/file-spine

Conversation

@bryan-uipath

Copy link
Copy Markdown
Owner

Stacked on #9 (which is stacked on #8).

The old file isolate was a treemap of module boxes: two big components swallowed the plate, the rest were nubs, and the default Recent overlay painted all of it one green. This PR redesigns the interior.

  • Reading order fills the footprint. A file isolate keeps the file's own plate (scale-true, floored to max(60, √modules·11)) and lays its modules out like text on a page: rows left → right, top → bottom in source order (flowLayout), each module as wide as its line count, rows justified to the plate and as deep as their share, so area stays ∝ lines. Shares are floored at a quarter of the average so a one-line const still gets a hoverable plot; a light trailing row folds into the previous one.
  • Heights are linear in lines (lineUnit: the longest module ≈ 0.4 of the plate's side, capped at 60), read off the file's scope layout so an isolated module keeps its height.
  • Classes / interfaces / enums are stacks of member slabs in source order on a pedestal plate (Plot.y0/Plot.height; members get no plate of their own).
  • Kind is the paint inside a file in every mode — every module shares the file's churn/recency, so the overlays have nothing per-building to say. Legend: kind swatches + area · height = lines · reading order = source order.
  • Code holograms (hologram.ts): hovering a module stands its source up beside it as a screen-aligned card — kind name + line span header, first 14 lines with gutter, comments dimmed, scanlines, cyan frame, drawn over the city and scaled with distance. Selecting pins it; hover borrows the slot. Source via CityHost.getSource (cached per span); header-only without a host (static export). Replaces the name pill for modules inside a file.
  • Framing inside a file adds the tallest building to the extent and looks down more steeply (min pitch 0.7) so the front row does not hide the rest.

The mini-treemap for a real file's plots at folder scope (v1 data) is unchanged; only synthetic scopes get the new layout.

Verification: npm run typecheck; drilled into viewer/src/city.ts (52/52 modules placed) and viewer/src/labels.ts (member stacks), hover + select show and pin the card, no console errors.

🤖 Generated with Claude Code

bryan-uipath and others added 2 commits September 7, 2026 13:10
Inside a file the modules fill the file's own footprint in source order
(rows left→right, top→bottom, area ∝ lines, heights linear in lines);
classes/interfaces/enums are stacks of member slabs. Kind is the paint in
here regardless of mode. Hovering a module stands its source up beside it
as a screen-aligned hologram card; selecting pins it. Source via
CityHost.getSource, header-only without a host.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…s files

lineUnit normalised over file.modules, which is empty for a file whose one
module fileScope stubs in — a 400-line note became a 240-unit needle; it now
seeds on the file's own loc. tallest() still measured buildings with
buildingHeight, so camera clearance and hover boxes were short inside a file:
folded into city.ts's tallestBuilding, which already had the formula. The
hologram anchor was baked before startTransition set stageHome, leaving the card
displaced after a rebuild — it is re-derived each frame — and moduleRecOf now
only accepts a record from the current city. Plus a constant-folded gutter, two
un-exported helpers, DoubleSide and a duplicate dispose dropped, and the card
fetches only the lines it shows.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant