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
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 main2026-10-05 05:38:03 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
[hidden]on.mainso expanding the preview actually removes the conversation column from the row.margin-inline: autoonly 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).mainisdisplay: none, preview slot 1184px, page center delta 0Why: .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>