Skip to content

test(web): cover the right panel toggle opening and closing the panel - #10642

Open
andreivcodes wants to merge 1 commit into
pingdotgg:mainfrom
andreivcodes:test/right-panel-toggle-opens-panel
Open

test(web): cover the right panel toggle opening and closing the panel#10642
andreivcodes wants to merge 1 commit into
pingdotgg:mainfrom
andreivcodes:test/right-panel-toggle-opens-panel

Conversation

@andreivcodes

@andreivcodes andreivcodes commented Sep 8, 2026

Copy link
Copy Markdown

The right panel toggle in the chat header has regressed several times (#8016, #9517, #9591) and nothing in the suite exercises it. Every one of those was a click that never reached the button, so the store never changed.

This adds a test that mounts the real PanelLayoutControls (real base-ui button) against the real right-panel store and presses the button the way ChatView and the pull-requests route wire it. It checks that one press opens the panel for the thread, the next press closes it, an open surface survives a close and comes back on reopen, the toggle only touches its own thread, and an unavailable toggle stays disabled. Verified the test fails when the handler double-fires.

The three past breakages were Electron drag-region hit-testing, which only a real browser can reproduce; this covers everything below that layer.

Work done by Claude Fable 5.1 in Claude Code.

🤖 Generated with Claude Code

Note

Add test coverage for right panel toggle in PanelLayoutControls

Adds a test module in PanelLayoutControls.test.tsx that mounts PanelLayoutControls via a probe component and exercises the right-panel toggle button. Tests cover opening and closing the panel, preserving the active diff surface across close/reopen, state isolation between threads, and disabled behavior when the panel is unavailable. Each test resets the right-panel store and cleans up the renderer.

Macroscope summarized a80da74.

Summary by CodeRabbit

  • Tests
    • Added coverage for opening and closing the right-side panel.
    • Verified that the selected panel surface is preserved when reopening.
    • Confirmed panel state remains independent across threads.
    • Verified the toggle is disabled when the right panel is unavailable.

The header toggle for the right panel has regressed several times (pingdotgg#8016,
pingdotgg#9517, pingdotgg#9591) with nothing guarding it. This mounts the real control against
the real right-panel store and checks that one press opens the panel, the next
closes it, surfaces survive a close, the toggle only touches its own thread,
and an unavailable toggle stays disabled.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 8, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at a80da74

Macroscope's review found this PR approvable — This PR adds focused unit coverage for the existing right-panel toggle and does not modify production code, product defaults, or static-analysis configuration. Its effects are confined to the web test harness.

Notes:

  • No code objects were reviewed. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: c89c0bce-0b89-4a25-bc4b-0c69d5a4d823

📥 Commits

Reviewing files that changed from the base of the PR and between 8588d7f and a80da74.

📒 Files selected for processing (1)
  • apps/web/src/components/chat/PanelLayoutControls.test.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The PR adds tests for PanelLayoutControls. The tests verify right-panel toggling, surface preservation, thread isolation, and disabled behavior when the panel is unavailable.

Changes

Right panel toggle validation

Layer / File(s) Summary
Right panel toggle behavior
apps/web/src/components/chat/PanelLayoutControls.test.tsx
Mocks tooltip rendering, connects PanelLayoutControls to the right-panel store, adds test helpers, and verifies toggle state, active-surface preservation, thread isolation, and unavailable-panel behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to a80da

This change adds regression coverage for right-panel toggle behavior without altering production behavior. No current merge-readiness risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding web test coverage for the right panel toggle opening and closing behavior.
Description check ✅ Passed The description explains what changed, why the test is needed, the covered behaviors, and the scope. It omits the template checklist and UI Changes section, but these omissions are non-critical becaus…
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants