Skip to content

fix(app): keep v2 review pane mounted across session tab switches#35074

Merged
Hona merged 1 commit into
anomalyco:devfrom
Hona:fix/v2-review-pane-remount
Jul 3, 2026
Merged

fix(app): keep v2 review pane mounted across session tab switches#35074
Hona merged 1 commit into
anomalyco:devfrom
Hona:fix/v2-review-pane-remount

Conversation

@Hona

@Hona Hona commented Jul 3, 2026

Copy link
Copy Markdown
Member

Problem

In the desktop app with the new layout (v2), switching between session tabs in the same workspace fully remounts the v2 review pane, causing a visible flicker.

Since the session-tab-remount work, Page stays mounted across same-workspace tab switches and only params.id changes. But the v2 review panel was still gated on <Show when={!store.deferRender}>, and deferRender flips true/false on every sessionKey change - so each tab switch disposed and recreated the entire ReviewPanelV2 one frame later. The comment on that gate ("The route remounts per session") was stale.

The pane's inputs are already tab-switch stable: the vcs diff query is keyed per workspace directory, panel state is a global persist, and all props are lazy getters - so once the gate is fixed, tab switches are purely reactive parameter updates.

Fix

Replace the per-session gate with a mount-once latch:

const reviewPanelV2Rendered = createMemo<boolean>((prev) => prev || !store.deferRender, false)
  • The initial diff render still stays off the mount critical path (deferRender starts true, clears after the first frame).
  • Once rendered, the latch short-circuits and never tears the panel down again for the lifetime of the Page (which is keyed per workspace, so cross-workspace switches still remount as before).
  • Scoped to the v2 review pane only: the composer ready gate and the legacy review tab keep their existing per-session defer behavior.

Test

TDD: added e2e/regression/review-tab-switch.spec.ts (modeled on terminal-tab-switch.spec.ts) which marks the mounted review pane DOM node with a probe, switches tabs both ways, and asserts the node survives. Verified failing before the fix and passing after, with no test changes.

Verification

From packages/app:

  • bun run test:e2e e2e/regression/review-tab-switch.spec.ts - fails on dev, passes with fix
  • bun run test:e2e for review-image-flash, review-line-comment, terminal-tab-switch, tab-navigate-mousedown, cross-server-tab-close, remote-tab-busy - all pass
  • bun typecheck and bun run typecheck:e2e - clean

@Hona Hona requested a review from Brendonovich as a code owner July 3, 2026 04:01
Copilot AI review requested due to automatic review settings July 3, 2026 04:01

Copilot AI 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.

Pull request overview

Fixes a v2 desktop layout flicker where switching between session tabs in the same workspace caused the v2 review pane to fully remount (due to deferRender toggling per session change), by ensuring the pane only defers its initial render and then stays mounted for the lifetime of the workspace-scoped Page.

Changes:

  • Replace the per-session <Show when={!store.deferRender}> gate for ReviewPanelV2 with a mount-once latch memo that stays true after the first render.
  • Add an E2E regression test that probes the v2 review pane DOM node identity across same-workspace session tab switches to detect remounts.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/app/src/pages/session.tsx Introduces a “render once” latch (reviewPanelV2Rendered) so v2 review pane isn’t torn down/recreated on same-workspace session tab switches.
packages/app/e2e/regression/review-tab-switch.spec.ts Adds a regression test asserting the v2 review pane DOM node persists across session tab switches within the same workspace.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Hona Hona merged commit 04d236c into anomalyco:dev Jul 3, 2026
9 of 11 checks passed
github-actions Bot added a commit to wallentx/opencode-termux that referenced this pull request Jul 6, 2026
* ci: Add Android build and publish workflow with APK artifact upload

Signed-off-by: wallentx <william.allentx@gmail.com>

* ci: Allow publish workflow to run with android_only input

Signed-off-by: wallentx <william.allentx@gmail.com>

* ci: Use github.token instead of committer output in publish workflow

Signed-off-by: wallentx <william.allentx@gmail.com>

* feat: Add aarch64-linux-android target to sidecar binaries

Signed-off-by: wallentx <william.allentx@gmail.com>

* ci: Simplify publish workflow and fix Android build conditions

Signed-off-by: wallentx <william.allentx@gmail.com>

* feat: Refactor app initialization and add WSL path conversion

Signed-off-by: wallentx <william.allentx@gmail.com>

* ci: Fix Android-only workflow condition and update dependencies

Signed-off-by: wallentx <william.allentx@gmail.com>

* sync release versions for v1.17.13

* chore: bump gitlab-ai-provider to 6.10.0 (anomalyco#34756)

* chore: update nix node_modules hashes

* feat(stats): redesign lab hero

* feat(stats): add lab overview

* feat(stats): redesign lab usage

* feat(data): another redesigned lab section

* feat(stats): use catalog descriptions

* chore: generate

* fix(stats): refine lab page tooltips

* fix(stats): include locale header in vary (anomalyco#34789)

* zen: new inference

* fix(desktop): keep window tabs across app close (anomalyco#34807)

* fix(app): stabilize session timeline layout continuity (anomalyco#34533)

* feat(desktop): refine session tab preview popover (anomalyco#34792)

* fix(ui): raise v2 tooltip layer (anomalyco#34455)

Co-authored-by: Jay <53023+jayair@users.noreply.github.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>

* chore: update nix node_modules hashes

* fix(opencode): update Cerebras SDK reasoning replay (anomalyco#34826)

Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>

* chore: update nix node_modules hashes

* fix(app): resolve target session lineage outside router transition (anomalyco#34838)

* chore: generate

* fix(opencode): filter session list by resolved instance directory (anomalyco#34842)

* fix(app): only allow \(...\) syntax for inline latex (anomalyco#34850)

* test(opencode): cover Windows session list directory spellings (anomalyco#34857)

* fix(app): scope session tab indicators to the tab's server (anomalyco#34861)

* chore: generate

* fix(app): clear original prompt after retarget (anomalyco#34863)

* fix(app): seed session status before warming session info (anomalyco#34864)

* feat(app): v2 review panel overhaul (anomalyco#31882)

Co-authored-by: LukeParkerDev <10430890+Hona@users.noreply.github.com>

* fix(app): keep terminal mounted when switching session tabs in a workspace (anomalyco#34852)

Co-authored-by: Brendan Allan <git@brendonovich.dev>

* fix(ui): resolve toast icon inside the toast component (anomalyco#34874)

* fix(copilot): honor advertised model endpoints (anomalyco#34958)

* fix(stats): polish lab pages

* feat(stats): redesign model hero

* chore: generate

* feat(tui): add debug info dialog with copy to clipboard (anomalyco#35004)

* zen: new inference

* zen: new inference

* feat(app): navigate tabs on mousedown in new layout (anomalyco#35042)

* zen: new inference

* zen: new inference

* fix(app): keep v2 review pane mounted across session tab switches (anomalyco#35074)

* feat: experimental codemode (anomalyco#34677)

* chore: generate

* fix(ci): setup Node 24 before bun install for node-gyp (anomalyco#35076)

* revert: back out experimental codemode (anomalyco#35077)

* feat(codemode): add confined execution package (anomalyco#35079)

* chore: generate

* chore: update nix node_modules hashes

* chore: remove root node-gyp pin after Node 24 setup (anomalyco#35092)

* feat(desktop): add recently closed projects to home (anomalyco#34926)

* feat(app): align subagent UI with v2 (anomalyco#34931)

Co-authored-by: Luke Parker <10430890+Hona@users.noreply.github.com>

* chore: generate

* feat(desktop): papercut fixes (anomalyco#34939)

* refactor(opencode): expose MCP tools in native shape from the service (anomalyco#35103)

* feat(app): improvements to model search (anomalyco#34954)

* chore: generate

* feat(opencode): add code-mode MCP adapter (anomalyco#35085)

* chore: generate

* chore: update nix node_modules hashes

* feat(app): dropdown search fix (anomalyco#34961)

Co-authored-by: Brendan Allan <git@brendonovich.dev>

* fix(opencode): provide Observability beneath all route service graphs (anomalyco#35171)

* chore: upgrade turbo (anomalyco#35173)

* feat(stats): add model momentum section

* chore: generate

* fix(core): rewrite replacements while hoisting layers (anomalyco#35175)

* fix(stats): link market share labs

* chore: artifacts

* chore: generate

* feat(tui): render code-mode execute tool with child calls (anomalyco#35113)

* refactor(opencode): fail the execute tool on program failure (anomalyco#35180)

* fix(tui): align execute child calls with task indentation (anomalyco#35190)

* refactor(core): move path resolve into fs service (anomalyco#35202)

* feat(opencode): gate execute tool behind code mode flag (anomalyco#35185)

* chore: generate

* cleanup: tweak compaction prompt (anomalyco#35220)

Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>

* fix(app): restore unfocused composer typing (anomalyco#35249)

* fix(app): delay initial tab preview (anomalyco#35266)

Co-authored-by: Jay <53023+jayair@users.noreply.github.com>

* fix(desktop): stabilize esm shim injection (anomalyco#35270)

* fix(app): match new session panel corners (anomalyco#35257)

* tui: preserve spinner registration (anomalyco#35292)

* feat: Add aarch64-linux-android target to sidecar binaries

Signed-off-by: wallentx <william.allentx@gmail.com>

* chore(ci): Improve workflow portability and add Android build support

Signed-off-by: wallentx <william.allentx@gmail.com>

* feat(ci): Add Android artifact build workflow and guidance

Signed-off-by: wallentx <william.allentx@gmail.com>

* fix(opencode): use NDK sysroot for Android artifact build

* fix(opencode): pass Android NDK libc paths to Zig

* fix(opencode): patch OpenTUI Android system libs

* fix(opencode): rely on NDK libc config for Android

* fix(opencode): resolve Android OpenTUI loader relatively

* chore(ci): add Android Bun compile smoke target

* fix(opencode): relocate Android Bun payload pointer

* chore(ci): build Android Bun runtime from source

* fix(ci): install LLVM for Android Bun source build

* fix(ci): bootstrap LLVM 21 for Android Bun build

* fix(ci): keep Bun Android build inside source tree

* fix(ci): link Android NDK runtimes for Bun build

* fix(ci): use Android strip for Bun runtime build

* chore(termux): add release mirror workflows

* chore(termux): align app token variables

* chore(termux): use app client id input

* chore(termux): fall back to github token

* chore(termux): prepare v1.17.13

---------

Signed-off-by: wallentx <william.allentx@gmail.com>
Co-authored-by: wallentx <william.allentx@gmail.com>
Co-authored-by: opencode <opencode@sst.dev>
Co-authored-by: Vladimir Glafirov <vglafirov@gitlab.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: Adam <2363879+adamdotdevin@users.noreply.github.com>
Co-authored-by: Frank <frank@anoma.ly>
Co-authored-by: Luke Parker <10430890+Hona@users.noreply.github.com>
Co-authored-by: usrnk1 <7547651+usrnk1@users.noreply.github.com>
Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: Jay <53023+jayair@users.noreply.github.com>
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Co-authored-by: Brendan Allan <14191578+Brendonovich@users.noreply.github.com>
Co-authored-by: Aarav Sareen <96787824+arvsrn@users.noreply.github.com>
Co-authored-by: Brendan Allan <git@brendonovich.dev>
Co-authored-by: Dustin Deus <deusdustin@gmail.com>
Co-authored-by: Kit Langton <kit.langton@gmail.com>
Co-authored-by: James Long <longster@gmail.com>
Co-authored-by: Simon Klee <hello@simonklee.dk>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants