Skip to content

Fix the worktree ref browse submenu closing on ancestor re-renders - #770

Open
QiushiZhao wants to merge 2 commits into
supabitapp:mainfrom
QiushiZhao:fix/preserve-open-browse-submenu
Open

Fix the worktree ref browse submenu closing on ancestor re-renders#770
QiushiZhao wants to merge 2 commits into
supabitapp:mainfrom
QiushiZhao:fix/preserve-open-browse-submenu

Conversation

@QiushiZhao

@QiushiZhao QiushiZhao commented Aug 5, 2026

Copy link
Copy Markdown

Closes #771

Summary

The base-ref/upstream browse Menu in the worktree creation prompt was rebuilt every time the sheet's ancestors re-evaluated (e.g. agent-presence updates), closing an open submenu mid-drill. This wraps the native Menu in an Equatable value boundary (WorktreeRefBrowseMenu) so SwiftUI skips its body while the menu inputs stay equal, preserving the open submenu. The new WorktreeRefMenuToken captures the store-derived values that change the menu's content, keeping the equatable comparison complete.

Type of change

  • Bug fix
  • Feature
  • Documentation
  • Other

How was this tested?

  • make check passes (format + lint)
  • make test passes
  • I built and ran the app to confirm the change works

Full build could not run on this machine: make doctor fails preflight because the local Xcode ships the macOS 26.4+ SDK, which the pinned Zig cannot link against (fix: install Xcode 26.3). This is an environment toolchain issue unrelated to the change. make check (format + lint) passes.

AI tool disclosure

  • Model(s): Claude Sonnet 4.6
  • Harness / tools: Claude Code (review + PR mechanics; the code change itself is the author's own work)

Checklist

  • This pull request is linked to an issue with Closes # above.
  • For a feature, the linked issue is labeled ready.
  • I am the author of this work and accountable for it; no commit is authored or co-authored by an AI agent.
  • I have read the Contributing guide and the Code of Conduct.

@github-actions github-actions Bot added the invalid Does not meet the contribution policy; closed automatically after a few days if left inactive. label Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Thanks, this now meets the contribution policy. I've cleared the invalid label.

Wrap the native browse Menu in an Equatable value boundary so SwiftUI
skips its body while the menu inputs stay equal, preserving an open
submenu when agent-presence updates re-evaluate the sheet.
@QiushiZhao
QiushiZhao force-pushed the fix/preserve-open-browse-submenu branch from 3983234 to 9b6ca14 Compare August 5, 2026 11:46
@sbertix

sbertix commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

I think it's not the equality, though 🤔
This doesn't fix the bug, no? It still closes it.

@github-actions github-actions Bot removed the invalid Does not meet the contribution policy; closed automatically after a few days if left inactive. label Aug 6, 2026
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.

Worktree creation browse submenu closes when the prompt re-renders

2 participants