Skip to content

fix(gui-app): reduce retained tab-switch work - #1187

Merged
tanveergill merged 6 commits into
mainfrom
traycer/mighty-bear-aa495f0eb818
Aug 15, 2026
Merged

tanveergill merged 6 commits into
mainfrom
traycer/mighty-bear-aa495f0eb818

Conversation

@tanveergill

Copy link
Copy Markdown
Contributor

Summary

  • avoid rerendering retained epic sidebars when only the parent activity surface changes
  • preserve sidebar context and store-driven updates with focused regressions
  • skip action-only worktree and slash-command queries for locked published-chat copies
  • reduce the slow-direction observer-free second-rAF median from 122.5 ms to 100.9 ms while preserving live-chat and viewer behavior

The balanced pixel gate remained effectively unchanged, so this is intentionally scoped as a CPU and render-fan-out improvement rather than a complete fix for the observed pixel flash.

Related issue

No linked issue.

Checklist

  • Pre-commit static checks pass
  • Separate CI test checks pass
  • Tests added/updated where it makes sense
  • Commits are signed off per the DCO

Signed-off-by: Tanveer Gill <tanveer@traycer.ai>
Signed-off-by: Tanveer Gill <tanveer@traycer.ai>
@coderabbitai

coderabbitai Bot commented Aug 15, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d9c190ac-2b95-4ccf-b83d-117d3ad41526

📥 Commits

Reviewing files that changed from the base of the PR and between 22c33a3 and fe0fadb.

📒 Files selected for processing (8)
  • clients/gui-app/src/components/epic-canvas/__tests__/epic-sidebar-column.test.tsx
  • clients/gui-app/src/components/epic-canvas/renderers/__tests__/chat-tile-activation-query-policy.test.ts
  • clients/gui-app/src/components/epic-canvas/renderers/__tests__/workspace-file-tile-read-validity.test.tsx
  • clients/gui-app/src/components/epic-canvas/renderers/chat-tile-activation-query-policy.ts
  • clients/gui-app/src/components/epic-canvas/renderers/chat-tile.tsx
  • clients/gui-app/src/components/epic-canvas/sidebar/epic-sidebar-column.tsx
  • clients/gui-app/src/components/epic-canvas/surface-host/__tests__/stable-tile-surface-host.test.tsx
  • clients/gui-app/src/components/epic-canvas/surface-host/stable-tile-surface-host.tsx

Summary by CodeRabbit

  • Performance

    • Improved sidebar responsiveness by preventing unnecessary rerenders when surrounding content updates without changes.
    • Sidebar updates still respond immediately to width and session changes.
  • Behavior Improvements

    • Chat data refreshes and command discovery now activate only when relevant, such as for visible, focused, or active chats.
    • Read-only published chat copies no longer trigger unnecessary background queries.
    • Hidden canvas tiles remain in place without being visually rendered, preserving layout geometry.

Walkthrough

The PR centralizes chat-tile query activation, memoizes EpicSidebarColumn, expands sidebar render tests, and applies opacity: 0 to hidden tile surface records.

Changes

Chat query activation

Layer / File(s) Summary
Activation policy and chat-tile integration
clients/gui-app/src/components/epic-canvas/renderers/chat-tile-activation-query-policy.ts, clients/gui-app/src/components/epic-canvas/renderers/chat-tile.tsx, clients/gui-app/src/components/epic-canvas/renderers/__tests__/chat-tile-activation-query-policy.test.ts, clients/gui-app/src/components/epic-canvas/renderers/__tests__/workspace-file-tile-read-validity.test.tsx
Chat-tile queries now use shared gates for live state, visibility, focus, activity, read-only state, and worktree binding. Tests cover the policy and editor readiness.

Sidebar rendering

Layer / File(s) Summary
Memoized sidebar rendering and session switching
clients/gui-app/src/components/epic-canvas/sidebar/epic-sidebar-column.tsx, clients/gui-app/src/components/epic-canvas/__tests__/epic-sidebar-column.test.tsx
EpicSidebarColumn is memoized. Tests cover stable parent props, width updates, and switching from loading to live hosts.

Surface presentation

Layer / File(s) Summary
Hidden tile opacity
clients/gui-app/src/components/epic-canvas/surface-host/stable-tile-surface-host.tsx, clients/gui-app/src/components/epic-canvas/surface-host/__tests__/stable-tile-surface-host.test.tsx
Hidden records receive invisible and opacity-0. Visible records remain without opacity-0.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to fe0fa

This localized performance change is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

Possibly related PRs

Suggested reviewers: anur4ag

Poem

A rabbit checks each query gate,
And keeps the sidebar light in state.
Hidden tiles fade from view,
Live chats wake when they should do.
Memoized hops make renders spry. 🐇

🚥 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
Description check ✅ Passed The description directly explains the rerender, query, surface-hiding, performance, and test changes in the pull request.
Title check ✅ Passed The title clearly summarizes the primary change: reducing retained tab-switch work in the GUI app.
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.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch traycer/mighty-bear-aa495f0eb818

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

…a495f0eb818

Signed-off-by: Tanveer Gill <tanveer@traycer.ai>
@tanveergill

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: ed96af6154

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@tanveergill

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@tanveergill

Copy link
Copy Markdown
Contributor Author

@coderabbitai approve

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 15, 2026
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved and changes approved.

@tanveergill
tanveergill merged commit f23ba9a into main Aug 15, 2026
20 checks passed
@tanveergill
tanveergill deleted the traycer/mighty-bear-aa495f0eb818 branch August 15, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant