fix(app): stop auto-opening files panel - #613
Conversation
📝 WalkthroughWalkthroughThis PR removes the auto-open mechanism for the Files tab in the session review panel. Files added during a turn no longer automatically open the Files panel; users must explicitly open the tab. The change removes auto-open state tracking from layout context, shifts diff sourcing responsibility to the review state layer, and updates tests to verify the quiet-by-default behavior. ChangesRemove Files Tab Auto-Open Behavior
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 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.
Suggested priority: P2 (includes user-path files (packages/app/src/context/layout.tsx, packages/app/src/pages/session.tsx, packages/app/src/pages/session/files-tab-state.test.ts, packages/app/src/pages/session/files-tab-state.ts, packages/app/src/pages/session/use-session-review-panel.test.tsx, packages/app/src/pages/session/use-session-review-panel.tsx, packages/app/src/pages/session/use-session-review-state.ts)).
P1/P0 are reserved for maintainer confirmation. Please relabel manually if this is a release blocker, security issue, data-loss risk, or updater/runtime failure.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/app/src/pages/session/use-session-review-panel.test.tsx`:
- Line 14: The test is driving timelineDiffs/turnDiffs via an ad-hoc as any
object which diverges from the real panel contract; update the test to supply
diffs through the same reviewState shape the panel consumes (use the reviewState
object to source timelineDiffs/turnDiffs) and replace the loose any typing with
a precise type alias using Parameters<typeof createSessionReviewPanel>[0] so the
test will break at compile time if the panel input contract changes; apply this
change to the occurrences that currently set turnDiffs/timelineDiffs (e.g., the
createSignal usages and the other similar blocks in the file) and ensure you
reference createSessionReviewPanel, reviewState, timelineDiffs and turnDiffs
when wiring the test input.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c0b80758-68e9-4c93-a289-31c0b0fbc020
📒 Files selected for processing (8)
packages/app/e2e/session/session-artifacts.spec.tspackages/app/src/context/layout.tsxpackages/app/src/pages/session.tsxpackages/app/src/pages/session/files-tab-state.test.tspackages/app/src/pages/session/files-tab-state.tspackages/app/src/pages/session/use-session-review-panel.test.tsxpackages/app/src/pages/session/use-session-review-panel.tsxpackages/app/src/pages/session/use-session-review-state.ts
💤 Files with no reviewable changes (2)
- packages/app/src/pages/session/use-session-review-panel.tsx
- packages/app/src/pages/session/files-tab-state.ts
Perf delta summaryComparator: pass
|
There was a problem hiding this comment.
Code Review
This pull request removes the functionality that automatically opens the Files tab when a new file is added to a session. The changes include removing the auto-open state from the layout context, deleting the logic responsible for triggering the panel opening in the review panel hook, and cleaning up associated types and tests. Additionally, the E2E tests have been updated to verify that the panel remains closed until manually opened by the user, and a new unit test confirms the removal of the auto-open behavior. I have no feedback to provide as there were no review comments.
Summary
Stop opening the right utility panel automatically when a session writes a file. Users can still open the Files tab manually and see generated/modified files there.
Why
The previous behavior was disruptive: the UI changed layout on first file output without a user action. The original behavior came from commit
03a09e83b5(feat: redesign right panel with Files + Changes tabs), which explicitly added auto-expansion on first file output.Related Issue
No linked issue. Requested directly by maintainer in local workflow.
Human Review Status
Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.
Review Focus
Please focus on whether the Files tab remains discoverable and still shows artifact files when opened manually, without reintroducing any automatic right-panel open path.
Risk Notes
Low product risk. This removes a user-visible automatic layout change and stale per-session auto-open state. Existing persisted
filesAutoOpenSeen/filesAutoOpenDismissedkeys may remain in old local storage blobs but are no longer read.How To Verify
Screenshots or Recordings
Not attached. This is a behavior change with no visual styling change; the visible workflow is covered by the focused Playwright E2E and Electron smoke check above.
Checklist
dev, and my PR title and commit messages use Conventional Commits in EnglishSummary by CodeRabbit
New Features
Tests