fix(app): align session composer with timeline width#456
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR fixes a layout width mismatch between the session timeline and composer columns by adding test infrastructure (selectors and data-component attributes), adjusting composer padding for proper alignment across viewport sizes, and introducing a comprehensive E2E test to assert width and positioning relationships. ChangesSession Layout Width Alignment
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request enhances the session layout by adjusting padding in the composer region and introducing new data-component attributes to facilitate more robust testing. It replaces a specific 2xl viewport test with a comprehensive end-to-end test that ensures the session timeline and composer shell maintain correct alignment and width relationships across various screen sizes. I have no feedback to provide as there were no review comments.
Root cause: - #456 was present in the published release assets, but the earlier fix only covered the narrow viewport and 2xl viewport paths. - The md desktop band still used `md:max-w-200` for the session timeline. In PawWork, `--spacing: 0.25rem` resolves against a 13px root font size, so `max-w-200` became 650px instead of the intended 800px. - The composer used fixed pixel caps (`md:max-w-[720px]`, `2xl:max-w-[920px]`), so at around a 893px CSS viewport the visible composer shell became wider than the conversation flow. Fix: - Replace the session timeline and message item md cap with explicit `md:max-w-[800px]`. - Keep the existing `2xl:max-w-[1000px]` timeline cap unchanged. - Add an E2E regression case at 893x776 to cover the missed md viewport band. Review notes: - Gemini suggested moving the 1000px cap to `xl` and adding a 1280px test, but that was not applied because the composer does not become 920px at `xl`; it remains 720px until `2xl`. - Existing 893px coverage verifies the md relationship, and the existing 1600px assertion verifies the 2xl relationship. Verification: - `bun --cwd packages/app test:e2e e2e/app/session.spec.ts` passed locally. - `bun --cwd packages/app typecheck` passed locally. - `git diff --check` passed locally. - Electron dev visual check confirmed the composer no longer appears wider than the conversation flow. - GitHub checks for PR #464 passed before merge. Closes #456.
Root cause: - PR #464 fixed the original composer/timeline mismatch by replacing the session timeline medium-width cap with explicit `md:max-w-[800px]`. - The #440 UI slice merge chain later regressed that fix. PR #461 first changed both timeline caps back to `md:max-w-200`, which resolves to about 650px with PawWork's 13px root font. - PR #460 then kept that same `message-timeline.tsx` state while removing dead delete-session code, so #479 surfaced as the composer still appearing wider than the reading column at right-panel-hidden desktop widths. Fix: - Restore both session timeline medium-width caps to `md:max-w-[800px]`. - Keep the existing 2xl timeline cap and composer caps unchanged, preserving the prior #217/#456 intent that composer remains inset at very wide desktop sizes. - Add a focused E2E checkpoint for #479: viewport 1280x900 with `#right-panel[aria-hidden="true"]`, then reuse the existing timeline/composer bounding-box contract. Verification: - Red check: temporarily restored the old `md:max-w-200` cap and confirmed the focused E2E failed at the new 1280px/right-panel-hidden checkpoint with timeline 651px vs composer 720px. - Focused E2E passed: `bun --cwd packages/app test:e2e e2e/app/session.spec.ts -g "session timeline visible content is not narrower than composer shell"`. - Typecheck passed: `bun --cwd packages/app typecheck`. - Diff check passed: `git diff --check`. - PR CI passed, including typecheck, unit-app, unit-opencode, unit-desktop, e2e-artifacts, smoke-macos-arm64, CodeQL, dependency review, commit lint, and PR title lint. Follow-up: - No immediate product follow-up is required for #479. - A separate architecture issue may still be worth opening later for the broader session width contract, because timeline, message item, and composer width values are still split across files and have accumulated breakpoint-specific tests. Closes #479.
Summary
md.Why
Closes #455.
After
v2026.5.5, the visible session flow could appear narrower than the bottom composer/input bar. The root boundary issue was that the old E2E selector targeted[data-component="session-prompt-dock"], which is intentionally full width, instead of the visible composer column/shell.The red test reproduced the user-facing mismatch at a 744px viewport: assistant content width + 1 was
717, while the visible composer shell was722.5.Related Issue
Closes #455
Human Review Status
Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.
Review Focus
Risk Notes
Low. This changes only the session composer wrapper inset below
mdand adds non-visual selectors. No data, API, persistence, desktop IPC, or token changes.How To Verify
Screenshots or Recordings
Not attached. The visible layout change is covered by the bounding-box E2E at 744px and 1600px viewports, including the visible composer shell and assistant content width relationship.
Checklist
dev, and my PR title and commit messages use Conventional Commits in EnglishSummary by CodeRabbit
Tests
Refactor