Skip to content

[GUI] Reserve the preview column only when there is something in it - #4453

Closed
xvcezrqpbxtpzblrt wants to merge 1 commit into
Niko1221:mainfrom
xvcezrqpbxtpzblrt:gui/preview-pane-027
Closed

xvcezrqpbxtpzblrt wants to merge 1 commit into
Niko1221:mainfrom
xvcezrqpbxtpzblrt:gui/preview-pane-027

Conversation

@xvcezrqpbxtpzblrt

Copy link
Copy Markdown
Contributor

Problem

A preview column could stay reserved with nothing in it. The split's width came from selectedPreview alone, while the panel renders nothing when that id matches no artifact, run or plan (an artifact removed from the session, a plan that was rejected, a Time-skip run whose files are gone). The result: a blank 627px column on the right, and the conversation squeezed into the remaining 545px.

Measured in the installed app (1440x920 window, the chat from the screenshot): .chatsplit had grid-template-columns: minmax(0,1fr) 627px and data-preview="true", elementFromPoint(1100, 400) returned the split itself (nothing painted there), and .chat__inner was 535px wide.

Result

  • The column is reserved only when the panel has something to render: the selected Time-skip run, the plan, or an artifact the chat knows about (from its messages or the open previews).
  • A selection whose artifact, run or plan is gone is cleared once the chat's own artifacts are known, so the toolbar does not point at a tab that is not there.

Validation

  • Same chat, same stored selection, new build, window 2560x1369: data-preview is absent, splitStyle is null, .chat__inner is 920px wide, centered (681px each side), and the assistant paragraph sits at its 56ch measure inside it.
  • npm run typecheck → clean; node --test tests/ui4-fixes.test.mjs tests/card-labels.test.mjs tests/context-ui.test.mjs → 15 pass, 0 fail.
  • Full host suite: 1,292 tests, 1,182 pass, 2 fail (the known Windows symlink EPERM cases), 108 skipped.

Limits

  • A chat whose selection is restored from storage shows the pane only after its messages are known (one render); before this change the empty column appeared at once, so the pane now appears a frame later when it has content.
  • Not tested: a Time-skip run deleted while its panel is open, and the expanded (full-screen) preview state.

@xvcezrqpbxtpzblrt

Copy link
Copy Markdown
Contributor Author

Superseded by #4606, which carries this change with the rest of the 0.2.7 branch. Closing so the review has one place.

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