toggling between views made possible

This commit is contained in:
2026-11-09 14:01:49 +01:00
parent cc6651c08a
commit 2887965a9e
18 changed files with 149 additions and 17 deletions
@@ -71,6 +71,18 @@ extension WorkspaceModel {
// MARK: Git view
/// ⌘G or ⌘D: toggles the view, but over the search or the Diff it switches to it.
/// Both full-screen views sit under `OverlayHost`, so a toggle beneath them would stay hidden.
func toggleView(isOpen: Bool, open: () -> Void, close: () -> Void) {
switch overlay.current {
case .search, .diff:
overlay.dismiss()
open()
default:
isOpen ? close() : open()
}
}
/// Opens the Git view on its message field, re-reads git and fetches origin; an open view only takes the field again.
func openGitView() {
if !layout.isGitViewOpen {