Skip to content

fix(app): stop auto-opening files panel - #613

Merged
Astro-Han merged 3 commits into
devfrom
codex/fix-files-panel-auto-open
May 14, 2026
Merged

fix(app): stop auto-opening files panel#613
Astro-Han merged 3 commits into
devfrom
codex/fix-files-panel-auto-open

Conversation

@Astro-Han

@Astro-Han Astro-Han commented May 14, 2026

Copy link
Copy Markdown
Owner

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 / filesAutoOpenDismissed keys may remain in old local storage blobs but are no longer read.

How To Verify

Diff check: git diff --check passed
Typecheck: bun --cwd packages/app typecheck passed
Full app unit CI parity: bun --cwd packages/app test:ci passed
Focused unit tests: 9 passed across use-session-review-panel, use-session-review-state, files-tab-state
Layout unit tests: 40 passed across layout, shell-tabs, close-session-tab
Focused E2E: bun --cwd packages/app test:e2e e2e/session/session-artifacts.spec.ts passed, confirming file output reaches idle plus added-file diff before the right panel is asserted closed and Files is opened manually
Electron smoke: bun run dev:desktop started the desktop shell; verified the home screen loads and the right utility panel is closed by default

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

  • Human review status is stated above as pending, approved, or not required
  • I linked the related issue, or stated why there is no issue
  • This PR has type, primary area, and priority labels, or I requested maintainer labeling
  • I described the review focus and any meaningful risks
  • I listed the relevant verification steps and the key result for each
  • I did not introduce unrelated refactors, dependencies, generated files, or file changes beyond the stated scope
  • I manually checked visible UI or copy changes when needed, with screenshots or recordings
  • I considered macOS and Windows impact for platform, packaging, updater, signing, paths, shell, or permissions changes
  • I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant
  • I reviewed the final diff for unrelated changes and suspicious dependency changes
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English

Summary by CodeRabbit

  • New Features

    • Users must now explicitly open the Files tab to view newly added artifacts; the panel no longer auto-opens.
  • Tests

    • Updated end-to-end and unit tests to verify Files tab behavior requires explicit user interaction.

Review Change Stack

@Astro-Han Astro-Han added bug Something isn't working P2 Medium priority app Application behavior and product flows ui Design system and user interface labels May 14, 2026
@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This 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.

Changes

Remove Files Tab Auto-Open Behavior

Layer / File(s) Summary
Remove Files tab auto-open state model
packages/app/src/pages/session/files-tab-state.ts, packages/app/src/pages/session/files-tab-state.test.ts
FilesPanelAutoOpenState type and nextFilesPanelAutoOpen helper function are removed; test coverage for auto-open behavior is deleted, leaving only deriveArtifactFiles mapping tests.
Remove Files panel auto-open effect from review panel
packages/app/src/pages/session/use-session-review-panel.tsx
The createEffect that auto-opened the Files tab is removed; timelineDiffs and turnDiffs input parameters are removed from the function signature.
Shift diff sourcing to review state
packages/app/src/pages/session/use-session-review-state.ts
createSessionReviewState accepts optional artifactDiffs input and prefers it over turnDiffs in artifactFiles computation and artifact-history refetch effect.
Wire artifactDiffs through session creation
packages/app/src/pages/session.tsx
Session component configures createSessionReviewState with artifactDiffs provider (timelineDiffs or turnDiffs fallback); removes timelineDiffs and turnDiffs from createSessionReviewPanel props.
Remove auto-open tracking from layout context
packages/app/src/context/layout.tsx
SessionView state removes filesAutoOpenSeen and filesAutoOpenDismissed fields; closeTab no longer updates files-specific auto-open state; layout view API removes auto-open memos and setAutoOpenState setter.
Add and update test coverage for quiet Files behavior
packages/app/src/pages/session/use-session-review-panel.test.tsx, packages/app/e2e/session/session-artifacts.spec.ts
New unit test verifies createSessionReviewPanel does not open Files tab when turns add files; e2e test explicitly opens Files tab and asserts artifact visibility only after manual tab selection.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Astro-Han/pawwork#318: Introduces the openRightPanel helper imported in the updated e2e test for explicit Files tab control.
  • Astro-Han/pawwork#367: Modifies deriveReviewArtifactFiles and how turnDiffs is consumed in review state, aligning with this PR's shift of diff sourcing responsibility.
  • Astro-Han/pawwork#436: Also updates createSessionReviewState and diff handling in the review flow, related to this PR's artifact/files-tab review changes.

🐰 Files no longer leap out to greet you—
They wait quietly, polite and neat.
Open the tab when you're ready to meet!
A gentler flow, less pushy, more sweet. 🎯

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly summarizes the main change: stopping automatic panel expansion when files are written.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed PR description fully complies with the template, covering all required sections including summary, motivation, issue linking, review focus, risk assessment, verification steps, and completed checklist items.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-files-panel-auto-open

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5f2056e and b88d775.

📒 Files selected for processing (8)
  • packages/app/e2e/session/session-artifacts.spec.ts
  • 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
💤 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

Comment thread packages/app/src/pages/session/use-session-review-panel.test.tsx Outdated
@github-actions

github-actions Bot commented May 14, 2026

Copy link
Copy Markdown

Perf delta summary

Comparator: pass

Profile / Scenario interaction median interaction worst long task max tbt frame gap p95 frame gap max jank count cls status
default / homepage-cold 32 -> 24 (-8) 32 -> 56 (+24) 96 -> 68 (-28) 46 -> 18 (-28) 16.8 -> 16.8 (0) 166.7 -> 166.6 (-0.1) 4 -> 3 (-1) 0 -> 0 (0) pass
default / session-streaming-long 40 -> 40 (0) 48 -> 48 (0) 117 -> 0 (-117) 67 -> 0 (-67) 16.7 -> 16.8 (+0.1) 116.6 -> 33.3 (-83.3) 1 -> 0 (-1) 0 -> 0 (0) pass
default / tool-call-expand 16 -> 24 (+8) 24 -> 40 (+16) 0 -> 0 (0) 0 -> 0 (0) 16.7 -> 16.7 (0) 16.7 -> 16.7 (0) 0 -> 0 (0) 0 -> 0 (0) pass
default / terminal-side-panel-open 40 -> 48 (+8) 40 -> 56 (+16) 0 -> 0 (0) 0 -> 0 (0) 16.8 -> 16.8 (0) 16.8 -> 16.8 (0) 0 -> 0 (0) 0 -> 0 (0) pass
default / session-scroll-reading 16 -> 24 (+8) 32 -> 32 (0) 0 -> 0 (0) 0 -> 0 (0) 16.8 -> 16.7 (-0.1) 16.8 -> 16.7 (-0.1) 0 -> 0 (0) 0.505 -> 0.505 (0) warn: cls
low-end / session-timeline-recompute 112 -> 120 (+8) 128 -> 128 (0) 100 -> 111 (+11) 150 -> 153 (+3) 83.3 -> 83.3 (0) 166.6 -> 166.7 (+0.1) 3 -> 3 (0) 0.194 -> 0.194 (0) pass

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Astro-Han
Astro-Han merged commit 06a595f into dev May 14, 2026
26 checks passed
@Astro-Han
Astro-Han deleted the codex/fix-files-panel-auto-open branch May 14, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Application behavior and product flows bug Something isn't working P2 Medium priority ui Design system and user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant