Skip to content

Fix Run Script toolbar dropdown caching scripts from first-opened repo#283

Merged
sbertix merged 1 commit intomainfrom
sbertix/stale-scripts
Apr 28, 2026
Merged

Fix Run Script toolbar dropdown caching scripts from first-opened repo#283
sbertix merged 1 commit intomainfrom
sbertix/stale-scripts

Conversation

@sbertix
Copy link
Copy Markdown
Collaborator

@sbertix sbertix commented Apr 28, 2026

Closes #280.

Summary

  • The Run Script Menu inside ToolbarItem was reusing the NSMenu items captured the first time it was opened, so every repo afterward kept showing the original repo's scripts.
  • Keyed ScriptMenu by rootURL so SwiftUI rebuilds it per repo, and added a nil-animation transaction to suppress the insert/remove transition the id swap would otherwise trigger.

Test plan

  • Open repo A, open the Run Script dropdown, confirm A's scripts render.
  • Switch to repo B, open the dropdown, confirm B's scripts render (not A's).
  • Switch back to A, confirm no visible flash/animation on the toolbar item.

#280)

The Menu inside ToolbarItem reused the NSMenu items captured the first
time it was opened, so switching repositories kept showing the original
repo's scripts. Keying the ScriptMenu by rootURL forces a fresh menu per
repo; a nil transaction suppresses the insert/remove animation that the
id swap would otherwise trigger.
@sbertix sbertix enabled auto-merge (squash) April 28, 2026 15:00
@sbertix sbertix merged commit 514c3ce into main Apr 28, 2026
2 checks passed
@sbertix sbertix deleted the sbertix/stale-scripts branch April 28, 2026 15:06
@tuist
Copy link
Copy Markdown

tuist Bot commented Apr 29, 2026

🛠️ Tuist Run Report 🛠️

Builds 🔨

Scheme Status Duration Commit
supacode 1m 24s 248090a06

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.

Run script dropdown caches first-pressed repo's scripts for entire session

1 participant