Repository navigation
feat(structure): host the ReactiveScript map as a Map mode - #58
Open
devagrawal09 wants to merge 1 commit into
Open
devagrawal09 wants to merge 1 commit into
devagrawal09 wants to merge 1 commit into
Conversation
When the app sets `globalThis.__RX__` with a `mount(element)` function, as `@reactivescript/map/live` does in development, the Structure view offers a third chip, Map. It mounts the map into the pane once it is on the page and calls the returned dispose when you leave Map, close the dock or the view unmounts. The view reads `__RX__` again each time it opens, and a remembered Map falls back to Owners on a page without a map. The arrow keys step through the chips the view offers, and focus moves to the selected chip of the pane that takes over. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lxsmnsyc
reviewed
Nov 25, 2026
Member
There was a problem hiding this comment.
Thanks for this. It is not ready to approve yet, mainly because I cannot find the integration it hosts anywhere to check it against.
Open question
- No linked issue covers this. The base has no mention of
__RX__or ReactiveScript. The PR adds a public contract (globalThis.__RX__.mount(element)) and a README section for one third-party tool. - Please link the
@reactivescript/map/livesource or release that sets__RX__and calls it with an element. Say who owns the contract and whether it can change. The e2e test uses a stand-in that also setsgraphs: [], which the toolbar'sRxMapHosttype does not declare, so the real shape is not pinned. - I have not decided whether the toolbar should host a named third-party map, or whether this should go through the dev-server data channel. The direction so far is that the Vite plugin carries what the runtime cannot provide.
Should fix
- The changeset and README state things the PR does not verify.
.changeset/structure-rx-map.md:5says@reactivescript/map/livesets__RX__"in development".README.md(new "ReactiveScript map" section) says the map "lights the nodes each update changed". Nothing in the diff or tests shows either. Cut both claims, or link where they are shown. - A map that fails to mount leaves an empty pane.
src/dev-toolbar/structure/rx-map.tsmountRxMaponly callsconsole.warn. The pane (RxMapPane,structure/index.tsx) has no visible error or empty state, so the user sees blank space under the chips. Show a short message in the frame whenmountthrows or returns no dispose function. structure/styles.css,[data-solid-rx-map-frame] > iframesizes only aniframe, but the contract saysmount(el)takes any element and draws into it. A map that appends adivor a canvas gets no sizing. Either document that the map must append an iframe, or size[data-solid-rx-map-frame] > *.__RX__is read when the view opens (createEffectonprops.show), not afterwards. The app can register or replace it while the view stays open, such as on HMR. The Map chip is then missing or stale until the view closes and opens. Say so in the README, or re-read on focus of the dock.
Nits
rx-map.tsdeclaresStructureModeanddev-toolbar/index.tsx:51declares it again. Import one.moveModeinstructure/index.tsxnow looks up the dock body withclosest('[data-solid-dev-toolbar-body]'), which couples the chips to the dock markup. The comment explains why, which helps.
Checked
- Local, in a review worktree:
format:checkpass,testpass.typecheckandbuildfail the same way on the base3c58230, so this PR does not cause them. The errors are TS2883 inHeadersViewer.tsxandnoop.ts, and the unbuilt@solidjs/start-devtoolsmodule.gh pr checksshows thetestjob passing. I did not run e2e or measure bundle size, because the build does not complete in my review worktree. - No new dependencies, no lockfile change.
- UI rules: no left-border selection, no focus chip, Solid version untouched. The
border-bottomon[data-solid-rx-map-nav]is on a square bar, not a rounded component. The Map chip is text like the other two chips. States covered except the mount failure above. - The gating, fallback to Owners, arrow keys and dispose-once look right. Unit tests cover the helpers, and e2e covers mount, dispose on leave and on close, and fallback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Add a Map mode to Structure so ReactiveScript apps can show their live map alongside Owners and Reactivity. Map is offered only when
globalThis.__RX__providesmount(element). The pane disposes the map when you leave it or close the dock; a remembered Map selection falls back to Owners when no map is available. Arrow keys move between the available modes and focus follows the selection.Tests
Added unit and browser coverage for Map mode.
pnpm format:check,pnpm build,pnpm typecheck,pnpm test(347 passed),pnpm check, andpnpm test:e2e(31 passed) all passed.