Hide the conversation column when the preview expands #47

Merged
weichen merged 1 commits from fix/preview-expanded-hidden into main 2026-10-05 05:38:03 +00:00
Owner

Summary

  • Restoring [hidden] on .main so expanding the preview actually removes the conversation column from the row.
  • Centering a docx page with margin-inline: auto only when the column is wider than the page. The wrapper stays full width so narrow-column fit scaling is unchanged.

Test plan

  • npx vitest run test/previewfit.test.ts test/design-guard.test.ts (10 passed)
  • Headless Chromium 1512x900: expanded .main is display: none, preview slot 1184px, page center delta 0
  • At preview widths 420px and 640px the wrapper matches the column and the page stays left-aligned
  • Expand and collapse once in the running app; drag the splitter while collapsed; confirm a narrow docx column still fits
## Summary - Restoring `[hidden]` on `.main` so expanding the preview actually removes the conversation column from the row. - Centering a docx page with `margin-inline: auto` only when the column is wider than the page. The wrapper stays full width so narrow-column fit scaling is unchanged. ## Test plan - [x] `npx vitest run test/previewfit.test.ts test/design-guard.test.ts` (10 passed) - [x] Headless Chromium 1512x900: expanded `.main` is `display: none`, preview slot 1184px, page center delta 0 - [x] At preview widths 420px and 640px the wrapper matches the column and the page stays left-aligned - [ ] Expand and collapse once in the running app; drag the splitter while collapsed; confirm a narrow docx column still fits
weichen added 1 commit 2026-10-05 05:37:49 +00:00
Why: .main { display: flex } overrides the UA [hidden] rule, so previewExpanded left the conversation column in the row and squeezed the preview.
Evidence: vitest test/previewfit.test.ts and test/design-guard.test.ts passed (10 tests). Headless Chromium at 1512x900: expanded .main is display:none and the preview slot is 1184px with the page centered (center delta 0); at 420px and 640px the wrapper stays column-width and the page stays left-aligned.
Impact: expanded preview fills the main row; docx pages center only when the column is wider than the page. Narrow-column fit scaling is unchanged. previewfit still returns 1 when available width is <= 0.
Refs: App.tsx hidden={previewExpanded}; styles.css .main and .docx-wrapper
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen merged commit 50c7244601 into main 2026-10-05 05:38:03 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Frontend#47