Skip to content

feat: self-contained HTML page of a space's map views - #36

Merged
mindsocket merged 2 commits into
mainfrom
claude/project-thread-tmn7yk
Nov 13, 2026
Merged

mindsocket merged 2 commits into
mainfrom
claude/project-thread-tmn7yk

Conversation

@mindsocket

@mindsocket mindsocket commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Requested by Rog · project thread

This is slice 2 of the HTML render plugin. It adds a single HTML file that shows a space's map views in the shared Viewer and opens offline. The sctx-map-views plugin package will be a thin wrapper over it.

Changes

  • Page host (src/page/main.tsx). Reads the snapshots from an inline <script type="application/json" id="sctx-snapshots"> element and renders them in Viewer. If there are none, it shows a message.
  • scripts/build-page.ts. Bundles the page host and React with Bun.build, then inlines the bundle and the CSS into the template dist/page.html. bun run build now writes that file.
  • fillPage(template, snapshots, title) (src/node/page.ts). Writes the title, HTML-escaped, and the snapshots into the template. The snapshot JSON has < escaped, so no string in the data can end the script element. It throws if either slot isn't present exactly once.
  • Module boundaries. A test now checks that no module imports either host. docs/architecture.md and AGENTS.md are updated to match.

There is no change to the public exports. The plugin package will bundle these modules from the workspace at build time.

Verification

  • bun test, bun run typecheck and bun run lint pass. New tests cover the escaping and the check that each slot appears once.
  • The template is 419 KB. I rendered the launch-playbook sample into it (457 KB) and loaded the file in Playwright with the network offline. It made no network requests, drew 48 cards and 44 edges, opened the side panel on click, and logged no console errors. The sample has no map view definitions of its own, so this check used the bundled strategy-tree.

The branch also carries a merge of the previous slice's branch head. Its tree is identical to main; I merged it to avoid a force push.

🤖 Generated with Claude Code

https://claude.ai/code/session_019XphpeFwEYm8K11SoT9ewz

Comment thread docs/architecture.md Resolved
Comment thread packages/map-views/src/node/snapshot.ts Resolved
Comment thread packages/map-views/src/page/main.tsx Resolved
Comment thread packages/map-views/tests/page.test.ts Resolved
A page host (src/page) shows the snapshots carried inline in its page in
the shared Viewer. scripts/build-page.ts bundles it with React and
inlines it, with the CSS, into the template dist/page.html, so a page
opens offline. fillPage writes a title and snapshots into the template,
escaping `<` so data can't end the script element. snapshotOf snapshots
a space from a context and an already assembled (e.g. filtered) graph;
exportSnapshot now uses it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019XphpeFwEYm8K11SoT9ewz
…architecture notes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019XphpeFwEYm8K11SoT9ewz
@mindsocket
mindsocket force-pushed the claude/project-thread-tmn7yk branch from 81e65ab to 567e16d Compare November 13, 2026 03:07
@mindsocket
mindsocket merged commit 94e708f into main Nov 13, 2026
1 check passed
@mindsocket
mindsocket deleted the claude/project-thread-tmn7yk branch November 13, 2026 03:36
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