Skip to content

Split the Lens room's 2x2 from its local fit - #72

Merged
a9lim merged 5 commits into
mainfrom
webui/lens-quad
Nov 2, 2026
Merged

a9lim merged 5 commits into
mainfrom
webui/lens-quad

Conversation

@a9lim

@a9lim a9lim commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

The Lens room's 2x2 is now one component both runtimes' source sections can render, and the local fit lives in its own column component that only drowse's native section supplies.

  • panels/rooms/lens/LensQuad.svelte: the grid (row labels, the S and R columns, the sources error line) and the mount-time source refresh and fetch check. Its column prop picks the column component, LensFamily by default.
  • panels/rooms/lens/LensFit.svelte: a family column with the local fit. It renders LensFamily with fitRunning and a fit snippet whose three parts (status, error, form) LensFamily places where the fit's markup used to be. The fit's state, progress, Replace and form moved here with their scoped styles.
  • LensFamily.svelte takes fitRunning (disables source switching while a fit runs) and the optional fit snippet instead of importing lensFit. lensFetch stays in the stores barrel.
  • panels/JLensSourceSection.svelte renders <LensQuad column={LensFit} /> and checks the fit job on mount.

drowse.ai's hosted section can then render LensQuad with no props. Its build-isolation check refuses the fit's words ("Lens fit progress", "Generation pauses while documents are fitted"), which now appear only in LensFit.svelte.

The native room's DOM is unchanged. I compared server renders of the old and new native sections across 12 states (fit idle, running for R or S, cancelling, failed, each with fetch idle, running and failed): with scope classes and hydration comments removed, the output is byte-identical.

Tests (scripts/lens-room.test.mjs): a walk of LensQuad's SSR import graph reaches LensFamily but neither instrumentAuthoring nor LensFit, and no source it reaches carries the fit's markers; LensQuad renders both columns without the fit; the native section shows the fit form per family, the running fit's status (after S's form, with a non-active source disabled), and a failed fit's error. npm run check and npm run build pass; dist rebuilt.

a9lim added 2 commits November 2, 2026 07:38
…, LensFit the fit, LensFamily takes the fit's running flag and parts
Comment thread webui/scripts/lens-room.test.mjs Fixed
@a9lim
a9lim merged commit 5c86520 into main Nov 2, 2026
12 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