native macOS codings agent orchestrator
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #60 from supabitapp/witty-whale

Show open menu extras only when command key is held

authored by

khoi and committed by
GitHub
eb4d7410 ee86785d

+11 -5
+11 -5
supacode/Features/Repositories/Views/WorktreeDetailView.swift
··· 4 4 struct WorktreeDetailView: View { 5 5 @Bindable var store: StoreOf<AppFeature> 6 6 let terminalManager: WorktreeTerminalManager 7 + @Environment(CommandKeyObserver.self) private var commandKeyObserver 7 8 8 9 var body: some View { 9 10 detailBody(state: store.state) ··· 53 54 } 54 55 .navigationTitle(selectedWorktree?.name ?? loadingInfo?.name ?? "Supacode") 55 56 .toolbar { 56 - openToolbar(isOpenDisabled: isOpenDisabled, openActionSelection: openActionSelection) 57 + openToolbar( 58 + isOpenDisabled: isOpenDisabled, 59 + openActionSelection: openActionSelection, 60 + showExtras: commandKeyObserver.isPressed 61 + ) 57 62 } 58 63 .focusedSceneValue(\.newTerminalAction, newTerminalAction) 59 64 .focusedSceneValue(\.closeTabAction, closeTabAction) ··· 87 92 @ToolbarContentBuilder 88 93 private func openToolbar( 89 94 isOpenDisabled: Bool, 90 - openActionSelection: OpenWorktreeAction 95 + openActionSelection: OpenWorktreeAction, 96 + showExtras: Bool 91 97 ) -> some ToolbarContent { 92 98 if !isOpenDisabled { 93 99 ToolbarItemGroup(placement: .primaryAction) { 94 - openMenu(openActionSelection: openActionSelection) 100 + openMenu(openActionSelection: openActionSelection, showExtras: showExtras) 95 101 } 96 102 } 97 103 } 98 104 99 105 @ViewBuilder 100 - private func openMenu(openActionSelection: OpenWorktreeAction) -> some View { 106 + private func openMenu(openActionSelection: OpenWorktreeAction, showExtras: Bool) -> some View { 101 107 HStack(spacing: 0) { 102 108 Button { 103 109 store.send(.openWorktree(openActionSelection)) 104 110 } label: { 105 111 OpenWorktreeActionMenuLabelView( 106 112 action: openActionSelection, 107 - shortcutHint: AppShortcuts.openFinder.display 113 + shortcutHint: showExtras ? AppShortcuts.openFinder.display : nil 108 114 ) 109 115 } 110 116 .buttonStyle(.borderless)