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
@@ -34,6 +34,8 @@ public enum ContextAction: Sendable, Equatable {
case newFolder(inDirectory: String)
/// Opens a file from the Git view, which closes first.
case openFile(String)
/// Opens a file from the Git view on its Diff, which closes first.
case openDiff(String)
/// Reverts unstaged changes: modified and deleted files come back from the index, new files are removed.
case gitDiscard([String])
/// The Git view's Clean up: every unstaged change reverted to the index, every untracked file and folder removed.
@@ -153,7 +155,11 @@ public enum ContextActions {
let paste: [ContextMenuEntry] = kind == .tail ? [] : [.action(.pasteIntoTerminal(kind), label: "Paste")]
return (hasSelection ? [.action(.copyTerminalSelection(kind), label: "Copy")] : []) + paste + readAloud + waitWhat
case let .gitRow(path, isDeleted):
let open: [ContextMenuEntry] = isDeleted ? [] : [.action(.openFile(path), label: "Open in editor"), .separator]
let open: [ContextMenuEntry] = isDeleted ? [] : [
.action(.openFile(path), label: "Open in editor"),
.action(.openDiff(path), label: "Open diff"),
.separator,
]
return open + [
.action(.passOnReference(path, code: nil), label: "Pass on reference"),
.action(.copyReference(path), label: "Copy reference"),