From 2887965a9e4db2f6ae6cd6a85019b8dc59f36f26 Mon Sep 17 00:00:00 2001 From: Jonathan van Rij Date: Mon, 9 Nov 2026 14:01:49 +0100 Subject: [PATCH] toggling between views made possible --- Sources/HelderCore/Files/ContextActions.swift | 8 ++- .../Overlays/ContextMenuOverlay.swift | 4 +- Sources/HelderUI/Shell/KeyRouter.swift | 13 ++++ .../State/WorkspaceModel+Commands.swift | 12 ++++ .../State/WorkspaceModel+ContextActions.swift | 3 + Sources/HelderUI/State/WorkspaceModel.swift | 4 +- .../Files/ContextActionsTests.swift | 3 + .../HelderUITests/Shell/KeyRouterTests.swift | 15 +++++ .../State/WorkspaceModelTests.swift | 65 +++++++++++++++++++ docs/architecture.md | 4 +- docs/behaviour.md | 9 +-- docs/guide/file-view-diff.md | 5 +- docs/guide/file-view.md | 2 +- docs/guide/git.md | 7 +- docs/guide/keyboard-shortcuts.md | 4 ++ docs/guide/right-click-menu.md | 2 + docs/guide/schema.md | 3 +- docs/guide/search.md | 3 + 18 files changed, 149 insertions(+), 17 deletions(-) diff --git a/Sources/HelderCore/Files/ContextActions.swift b/Sources/HelderCore/Files/ContextActions.swift index afedd79..692abdc 100644 --- a/Sources/HelderCore/Files/ContextActions.swift +++ b/Sources/HelderCore/Files/ContextActions.swift @@ -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"), diff --git a/Sources/HelderUI/Overlays/ContextMenuOverlay.swift b/Sources/HelderUI/Overlays/ContextMenuOverlay.swift index 51d6264..a32d0de 100644 --- a/Sources/HelderUI/Overlays/ContextMenuOverlay.swift +++ b/Sources/HelderUI/Overlays/ContextMenuOverlay.swift @@ -118,7 +118,7 @@ struct ContextMenuOverlay: View { .plak, .plakTerminalSelection, .openFile, .mergeBranch, .tailLog: .plain case .newFile, .newFolder: .add case .copyFileName, .revealInFinder: .modify - case .passOnReference, .passOnFileName, .bouwen, .waitWhat, .showDiff, .rename: .rename + case .passOnReference, .passOnFileName, .bouwen, .waitWhat, .showDiff, .openDiff, .rename: .rename case .gitDiscard, .gitCleanUp, .delete: .danger } } @@ -135,7 +135,7 @@ struct ContextMenuOverlay: View { case .pasteIntoTerminal: "doc.on.clipboard" case .newFile: "doc.badge.plus" case .newFolder: "folder.badge.plus" - case .showDiff: "arrow.left.arrow.right" + case .showDiff, .openDiff: "arrow.left.arrow.right" case .gitDiscard: "arrow.uturn.backward" case .gitCleanUp: "eraser" case .rename: "pencil" diff --git a/Sources/HelderUI/Shell/KeyRouter.swift b/Sources/HelderUI/Shell/KeyRouter.swift index 641084d..87ab42c 100644 --- a/Sources/HelderUI/Shell/KeyRouter.swift +++ b/Sources/HelderUI/Shell/KeyRouter.swift @@ -99,6 +99,8 @@ public enum OverlayKind: Equatable, Sendable { /// The full-screen Diff: the workspace shortcuts keep working over it. `busy` while its own /// menu or pass-on prompt is open; those then own every key. case diff(busy: Bool) + /// The search: it owns every key but Esc, ⌘G and ⌘D, so it can switch to the Git or Schema view. + case search /// Any other overlay: it owns every key but Esc. case other @@ -106,6 +108,7 @@ public enum OverlayKind: Equatable, Sendable { switch overlay { case .none: self = .none case .diff: self = .diff(busy: diffBusy) + case .search: self = .search default: self = .other } } @@ -141,6 +144,7 @@ public enum KeyRouter { case .none: break case .diff: if press == .cmd(.character("a")) { return .pass } + case .search: return searchKey(press, context) case .other: return .pass } @@ -163,6 +167,15 @@ public enum KeyRouter { } } + private static func searchKey(_ press: KeyPress, _ context: KeyContext) -> KeyRoute { + guard press.command, !press.shift else { return .pass } + switch press.key { + case .character("g"): return .perform(.toggleGit) + case .character("d"): return context.schemaAvailable ? .perform(.toggleSchemaView) : .pass + default: return .pass + } + } + private static func schemaEscape(_ context: KeyContext) -> KeyRoute { if context.schemaHasSelection { return .perform(.clearSchemaSelection) } if context.schemaSearchHasText { return .perform(.clearSchemaSearch) } diff --git a/Sources/HelderUI/State/WorkspaceModel+Commands.swift b/Sources/HelderUI/State/WorkspaceModel+Commands.swift index 8ae83f2..92c80cc 100644 --- a/Sources/HelderUI/State/WorkspaceModel+Commands.swift +++ b/Sources/HelderUI/State/WorkspaceModel+Commands.swift @@ -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 { diff --git a/Sources/HelderUI/State/WorkspaceModel+ContextActions.swift b/Sources/HelderUI/State/WorkspaceModel+ContextActions.swift index 0adaa09..b9b3710 100644 --- a/Sources/HelderUI/State/WorkspaceModel+ContextActions.swift +++ b/Sources/HelderUI/State/WorkspaceModel+ContextActions.swift @@ -81,6 +81,9 @@ extension WorkspaceModel { case let .openFile(path): closeGitView() open(path) + case let .openDiff(path): + closeGitView() + open(path, OpenOptions(showDiff: true)) case let .mergeBranch(name): guard let sourceControl else { return } track { diff --git a/Sources/HelderUI/State/WorkspaceModel.swift b/Sources/HelderUI/State/WorkspaceModel.swift index 9fc1e4b..f0596fe 100644 --- a/Sources/HelderUI/State/WorkspaceModel.swift +++ b/Sources/HelderUI/State/WorkspaceModel.swift @@ -149,9 +149,9 @@ public final class WorkspaceModel { case let .launcherSelect(index): launcher.select(index) case .launcherActivate: activateLauncher() - case .toggleGit: layout.isGitViewOpen ? closeGitView() : openGitView() + case .toggleGit: toggleView(isOpen: layout.isGitViewOpen, open: openGitView, close: closeGitView) case .closeGitView: closeGitView() - case .toggleSchemaView: layout.isSchemaViewOpen ? closeSchemaView() : openSchemaView() + case .toggleSchemaView: toggleView(isOpen: layout.isSchemaViewOpen, open: openSchemaView, close: closeSchemaView) case .closeSchemaView: closeSchemaView() case let .togglePane(panel): layout.togglePane(panel) case .toggleAutoFit: layout.toggleFluid() diff --git a/Tests/HelderCoreTests/Files/ContextActionsTests.swift b/Tests/HelderCoreTests/Files/ContextActionsTests.swift index 1a6a26f..53804af 100644 --- a/Tests/HelderCoreTests/Files/ContextActionsTests.swift +++ b/Tests/HelderCoreTests/Files/ContextActionsTests.swift @@ -137,6 +137,7 @@ import Testing @Test func aGitRowOpensInTheEditorThenPassesOnItsPath() { #expect(ContextActions.entries(for: .gitRow(path: "src/a.php", isDeleted: false)) == [ .action(.openFile("src/a.php"), label: "Open in editor"), + .action(.openDiff("src/a.php"), label: "Open diff"), .separator, .action(.passOnReference("src/a.php", code: nil), label: "Pass on reference"), .action(.copyReference("src/a.php"), label: "Copy reference"), @@ -146,6 +147,8 @@ import Testing .action(.copyReference("gone.php"), label: "Copy reference"), ]) #expect(ContextAction.openFile("src/a.php").isEmphasized) + #expect(!ContextAction.openDiff("src/a.php").isEmphasized) + #expect(!ContextAction.openDiff("src/a.php").isDestructive) } @Test func aSelectionCanBeReadAloudAfterCopyReference() { diff --git a/Tests/HelderUITests/Shell/KeyRouterTests.swift b/Tests/HelderUITests/Shell/KeyRouterTests.swift index 2252ce4..0e40eb0 100644 --- a/Tests/HelderUITests/Shell/KeyRouterTests.swift +++ b/Tests/HelderUITests/Shell/KeyRouterTests.swift @@ -166,6 +166,21 @@ import Testing #expect(route(KeyPress(.escape), context) == .perform(.dismissOverlay)) } + @Test func theSearchSwitchesToTheGitAndSchemaViewsAndOwnsEveryOtherKey() { + let search = KeyContext(overlay: .search, owner: .text(in: nil), schemaAvailable: true) + #expect(OverlayKind(.search(seed: "x")) == .search) + #expect(route(cmd("g"), search) == .perform(.toggleGit)) + #expect(route(cmd("d"), search) == .perform(.toggleSchemaView)) + #expect(route(cmd("d"), KeyContext(overlay: .search, owner: .text(in: nil))) == .pass) + #expect(route(cmd("f"), search) == .pass) + #expect(route(cmd("s"), search) == .pass) + #expect(route(cmd("g", shift: true), search) == .pass) + #expect(route(KeyPress(.character("g")), search) == .pass) + #expect(route(KeyPress(.down), search) == .pass) + #expect(route(KeyPress(.enter), search) == .pass) + #expect(route(KeyPress(.escape), search) == .perform(.dismissOverlay)) + } + @Test func theWorkspaceShortcutsKeepWorkingOverTheDiff() { let diff = KeyContext(overlay: .diff(busy: false), activePanel: .editor) #expect(route(cmd("m"), diff) == .perform(.cycleMode)) diff --git a/Tests/HelderUITests/State/WorkspaceModelTests.swift b/Tests/HelderUITests/State/WorkspaceModelTests.swift index 0c71d0b..bf72bc4 100644 --- a/Tests/HelderUITests/State/WorkspaceModelTests.swift +++ b/Tests/HelderUITests/State/WorkspaceModelTests.swift @@ -448,6 +448,18 @@ import Testing #expect(harness.model.editor?.activePath == "a.php") } + @Test func openDiffFromTheRowMenuClosesTheGitViewOnTheDiff() async { + let harness = WorkspaceHarness(git: snapshot([("a.php", .modified, false)]), contents: ["a.php": "`, no shell): `startTail` ends the old one and bumps `tailGeneration`, which the block uses as its pane's `.id`, so each file gets a fresh view and process; `closeTail` and `terminateAll` end it, and `tailedPath` is never persisted. -- **Git view.** ⌘G toggles `LayoutStore.isGitViewOpen` (never persisted, reset on a project switch). `WorkspaceView` draws `GitView` as an overlay over title bar, columns and status bar, under `OverlayHost`, so every overlay and toast sits above it; the columns stay mounted. `KeyContext.gitViewOpen` sends keys to `KeyRouter.gitViewKey` (column keys rest, ⌘↵ commits) and makes a bare Esc `.closeGitView` once no overlay is open; `inGitConsole` (first responder is a `GitConsoleFieldEditor`) keeps ⌘↵ from committing out of the console. `openGitView()` / `closeGitView()` in `+Commands` move the focus request (commit message in, previous `activePanel` out). Design source: `design/README.md`. +- **Git view.** ⌘G toggles `LayoutStore.isGitViewOpen` (never persisted, reset on a project switch). With a search or Diff overlay up, `.toggleGit`/`.toggleSchemaView` (keys and View menu) dismiss it first and then open the view, never closing a view already open under the search. `WorkspaceView` draws `GitView` as an overlay over title bar, columns and status bar, under `OverlayHost`, so every overlay and toast sits above it; the columns stay mounted. `KeyContext.gitViewOpen` sends keys to `KeyRouter.gitViewKey` (column keys rest, ⌘↵ commits) and makes a bare Esc `.closeGitView` once no overlay is open; `inGitConsole` (first responder is a `GitConsoleFieldEditor`) keeps ⌘↵ from committing out of the console. `openGitView()` / `closeGitView()` in `+Commands` move the focus request (commit message in, previous `activePanel` out). Design source: `design/README.md`. - **Schema view.** ⌘D toggles `LayoutStore.isSchemaViewOpen` (never persisted, reset on a project switch); `openGitView`/`openSchemaView` close each other. It exists only when `SchemaStore.isLaravelApp` (an `artisan` file): the title-bar toggle, `KeyContext.schemaAvailable` for ⌘D and the View menu item follow it. `WorkspaceView` draws `SchemaView` like `GitView`. `SchemaStore.body` picks the command-missing prompt, the no-dump state or the diagram. The watcher's `.project` events and ⌘R carry `RefreshScope.schema`: `refresh(readingDump:)` re-checks the command and re-reads the dump only when its modification date moved, keeping viewport and positions (`SchemaLayout.positions(_:saved:)`). Card positions go to `AppServices.schemaLayouts` when a drag ends; the first dump in a store fits once the canvas has a size. `run()` streams `SchemaServicing.runDump` like the Git console and toasts through `notify`. Esc over the view: selection (`.clearSchemaSelection`), then the search text while `SchemaSearchFieldEditor` has the keyboard (`.clearSchemaSearch`), then `.closeSchemaView`. The canvas lays each card out at 100% and scales it into its on-screen frame, so the click and `.pointerHand()` area stay unscaled; scroll and pinch arrive through a local event monitor (`SchemaScrollCatcher`), since the cards would take them otherwise. Contract: [schema.md](schema.md). - **Git commands.** Every git write and every typed console command goes through `SourceControlStore.run`, which chains onto `commandTail` so two commands never race for `.git/index.lock`, logs `$ git …` and streams lines via `GitServicing.execute` → `ProcessRunning.stream` into the console (`GitOutputClassifier`, one per run). `execute` never throws and switches off prompts, editors and pagers (`GIT_TERMINAL_PROMPT=0`, `GIT_EDITOR=true`, `GIT_PAGER=cat`), so a run can never wait on input. Typed commands run without literal pathspecs (globs work); buttons always pass explicit paths, never `add -A`. Push/pull/fetch and typed commands get `remoteTimeout` (120 s). Commit always runs git, even when `canCommitNow` is false, so git's refusal is the error the user sees. Branch switching and merging are refused in the store while `isDirty`, without asking git. The status read (`load`) stays on `ProcessRunning.run`. - **Commit message generation.** `.generateCommitMessage` → `SourceControlStore.generateCommitMessage()`: `GitServicing.stagedDiff()` (stat + patch, outside `commandTail` and the console), `CommitMessagePrompt.make` (patch cut at 60 000 characters), then `WorkspaceServices.commitMessages` (`ClaudeCommitMessageService`: the binary from `ExecutableLocator.agent`, its folder first on PATH, the prompt via `ProcessRunning.run(input:)`, cleaned with `CommitMessagePrompt.clean`). Success goes through `setCommitMessage` (so it is lowercased) and `focusMessage`; a `CommitMessageError` toasts through `notify`. `isGeneratingMessage` drives the label and ignores a second click. A window close cancels the run with the rest of `work`, which kills the child. diff --git a/docs/behaviour.md b/docs/behaviour.md index b1b15e1..dc17329 100644 --- a/docs/behaviour.md +++ b/docs/behaviour.md @@ -42,7 +42,7 @@ The top bar contains, left to right: ## 3. Git view -A full-screen view over the whole window (top bar, columns and status bar) for staging, committing, pulling, pushing and switching branches. `Cmd+G`, the `Git N` toggle and View › Show Git open it. `Cmd+G`, `Esc` and its **Close** button close it. Dialogs, context menus, search, the Diff and toasts sit above it. The columns stay mounted under it, so terminals keep running and the editor keeps its state. Opening it puts the keyboard in the commit message; closing it hands the keyboard back to the column that had it. It is not persisted: a project always opens with it closed. +A full-screen view over the whole window (top bar, columns and status bar) for staging, committing, pulling, pushing and switching branches. `Cmd+G`, the `Git N` toggle and View › Show Git open it. `Cmd+G`, `Esc` and its **Close** button close it. Dialogs, context menus, search, the Diff and toasts sit above it. From the search or the Diff, `Cmd+G` (and View › Show Git) closes that overlay and opens the view; when the view is already open under the search it only closes the search, it never closes the view. `Cmd+F` from the view opens the search above it. The columns stay mounted under it, so terminals keep running and the editor keeps its state. Opening it puts the keyboard in the commit message; closing it hands the keyboard back to the column that had it. It is not persisted: a project always opens with it closed. While it is open, the columns' row, focus and editor keys rest. `Cmd+Return` commits, except from the console input. The other `Cmd` shortcuts keep working. `Cmd+C` with no selection, outside a terminal, opens the view on the commit message. `Esc` closes the topmost layer: an overlay (context menu, dialog, search, Diff) first, then the Git view; with neither open it reaches the terminal. @@ -88,7 +88,7 @@ Four colour-coded sections, each only when it has rows, in this order: - A merge conflict (`UU`, `AA`, `DD`, or any `U`) is one unstaged `U` row in **changed**, never a staged row, and does not count toward `Commit N files`. Its badge is red, a red flag after the path has the tooltip `Merge conflict — resolve, then Stage`, and the row has a red left bar and a faint red fill. Its inline diff is the last commit against the file on disk, conflict markers included. - A conflicted row offers only **Stage**: staging marks the resolution. - **Discard** reverts unstaged changes (modified and deleted files from the index, new files removed). **Discard** and **Delete** ask first (`git.confirmDiscard`, default on); **Restore** never asks. Stage and unstage never ask. -- **Right-click** a row: **Open in editor** (left out for a deleted file), **Pass on reference**, **Copy reference**. Open in editor and Pass on reference close the view first. +- **Right-click** a row: **Open in editor** and **Open diff** (both left out for a deleted file), **Pass on reference**, **Copy reference**. Open diff opens the file and shows its full-screen Diff. Open in editor, Open diff and Pass on reference close the view first. ### Bottom strip @@ -119,7 +119,7 @@ The list is read when the view opens and after every command, with the branches. ## 4. Schema view -A full-screen view, drawn like the Git view, that shows the database of a Laravel app as a diagram of tables and foreign-key lines. It exists only in a Laravel app: a project with an `artisan` file in its root. Elsewhere there is no **Schema** button, `Cmd+D` does nothing and View › Show Schema is disabled. `Cmd+D`, the **Schema** toggle and View › Show Schema open it; `Cmd+D`, `Esc` and its **Close** button close it. Opening it closes the Git view, and opening the Git view closes it. Dialogs, menus, search and toasts sit above it, and the columns stay mounted under it. It is not persisted: a project always opens with it closed. +A full-screen view, drawn like the Git view, that shows the database of a Laravel app as a diagram of tables and foreign-key lines. It exists only in a Laravel app: a project with an `artisan` file in its root. Elsewhere there is no **Schema** button, `Cmd+D` does nothing and View › Show Schema is disabled. `Cmd+D`, the **Schema** toggle and View › Show Schema open it; `Cmd+D`, `Esc` and its **Close** button close it. Opening it closes the Git view, and opening the Git view closes it. `Cmd+D` and View › Show Schema switch from the search and the Diff exactly as `Cmd+G` does for the Git view (section 3). Dialogs, menus, search and toasts sit above it, and the columns stay mounted under it. It is not persisted: a project always opens with it closed. Helder reads the diagram from `database/helder/schema.json`, which the app's own Artisan command `app/Console/Commands/HelderSchemaCommand.php` (`php artisan helder:schema`) writes. The file's contract is in [schema.md](schema.md). @@ -197,7 +197,7 @@ All are presentations of the same file: 1. **The live file**: the current, editable version. On a changed file it marks the changed lines in place, with a teal tint, a 2px teal left rule, and a teal line number. There is no sign column, no `+` or `-` pair, and no removed line inline. A pure deletion has no current line to mark, so the neighbouring current line carries a 2px amber-deep rule on its top edge, or on its bottom edge at the end of the file. An unchanged file shows plain code. 2. **Preview**: Markdown files only. It shows the rendered document instead of the source. `Cmd+M` switches a Markdown file between code and the rendered preview. -3. **Diff**: changed files only. The editor expands to full screen, covering the other columns. The original file is on the left and the updated file is on the right, lines aligned. `Esc`, or a collapse control in the corner, returns to the live file. +3. **Diff**: changed files only. The editor expands to full screen, covering the other columns. The original file is on the left and the updated file is on the right, lines aligned. `Esc`, or a collapse control in the corner, returns to the live file. `Cmd+G` / `Cmd+D` close the Diff (back to the live file) and open the Git / Schema view; `Cmd+F` replaces the Diff with the search. A changed file opens on the live file, or on the Diff when `git.defaultDiffMode` is `diff`. @@ -304,6 +304,7 @@ Inside the overlay: - The focused column shows its focus only by its amber title and count. - Selecting a content result opens the file and jumps to that line. Selecting a file-name result opens that file. - When nothing matches, each column shows a brief no-results message. +- Every key belongs to the search except `Cmd+G` and `Cmd+D` (Laravel app only): they close the search and open the Git / Schema view, or leave that view open when it is already under the search. View › Show Git / Show Schema do the same. - `Esc` closes the overlay; there is no area to click to close it. The respected excludes are the same as the Explorer (`files.exclude` and, when on, gitignore). ### Mouse pointer diff --git a/docs/guide/file-view-diff.md b/docs/guide/file-view-diff.md index fb6e7d8..e5158ce 100644 --- a/docs/guide/file-view-diff.md +++ b/docs/guide/file-view-diff.md @@ -35,7 +35,7 @@ The Diff is a full-screen, side-by-side comparison of a changed file. It covers - Click **Diff** in the [file view](file-view.md) bar. The button shows only on a file with git changes. - Right-click a marked (teal) line in the file view and choose **Show diff**. The Diff opens centred on that line. - Show diff on a marked line always compares the last commit with the file on disk. -- The [Git](git.md) view has its own inline diff per file row. **Open in editor** on a row opens the file; click **Diff** there for the full-screen view. +- In the [Git](git.md) view, right-click a file row and choose **Open diff**. The view closes and the file opens in the Diff. ### Layout - The Diff covers all columns. The window's shortcuts still work over it. @@ -74,6 +74,7 @@ The Diff is a full-screen, side-by-side comparison of a changed file. It covers ### Close the Diff - Press `Esc` or click **Collapse**. - `Esc` closes the innermost layer first: the menu, then the prompt, then the Diff. +- `Cmd+G` or `Cmd+D` closes the Diff and opens the [Git](git.md) or [Schema](schema.md) view. `Cmd+F` replaces the Diff with [Search](search.md). - You return to the view you came from, with the keyboard back in the code. ## Keyboard @@ -81,6 +82,8 @@ The Diff is a full-screen, side-by-side comparison of a changed file. It covers | Keys | Action | |---|---| | `Esc` | Close the menu, the prompt, or the Diff | +| `Cmd+G` / `Cmd+D` | Close the Diff and open the Git / Schema view | +| `Cmd+F` | Close the Diff and open Search | | `Cmd+C` | Copy the selected lines | | `Cmd+A` | Select all lines of one side | | `Up` / `Down` / `Enter` | Move through and choose in the right-click menu | diff --git a/docs/guide/file-view.md b/docs/guide/file-view.md index 688e7e0..5fcb97f 100644 --- a/docs/guide/file-view.md +++ b/docs/guide/file-view.md @@ -33,7 +33,7 @@ The file view is the third column (Col C), between the [Explorer](explorer.md) a ## Features ### Open a file -- Click a file in the [Explorer](explorer.md), choose **Open in editor** on a row in the [Git](git.md) view, pick a result in [Search](search.md), or use [Go to file](go-to-file.md). +- Click a file in the [Explorer](explorer.md), choose **Open in editor** (or **Open diff**) on a row in the [Git](git.md) view, pick a result in [Search](search.md), or use [Go to file](go-to-file.md). - The new file replaces the one that was open. Helder shows one file at a time. - A file always opens fresh from disk. - When you open a file at a line (from Search or the [symbol popup](code-symbols.md)), that line moves to the middle of the pane and flashes amber for about a second. diff --git a/docs/guide/git.md b/docs/guide/git.md index 145bce7..2782f3f 100644 --- a/docs/guide/git.md +++ b/docs/guide/git.md @@ -46,6 +46,7 @@ The Git view is a full-screen page for everything git: it lists every changed fi ### Open and close the view - `Cmd+G`, the **Git** toggle in the [Title bar](title-bar.md), or View > Show Git opens it. The toggle reads `Git N`, where N counts the changed files. +- From [Search](search.md) or the [Diff](file-view-diff.md), `Cmd+G` closes it and opens the view. If the view is already open under Search, `Cmd+G` only closes Search. - The view covers the whole window: title bar, columns and status bar. The columns stay as they were under it. Terminals keep running. - When it opens, the keyboard goes to the commit message. - `Cmd+C` with no text selected, outside a terminal, also opens the view on the commit message. @@ -98,10 +99,10 @@ Staged rows carry an amber bar on their left edge. A conflicted row carries a re - Removed lines have an amber tint, added lines a teal tint. In a changed line pair, the part that differs is highlighted. - Each change keeps 3 unchanged lines around it. Longer unchanged runs fold into `⋯ N unchanged lines`. - A file over 1 MB shows `Too big.`. A file with no text changes shows `— No line changes.`. -- For the full-screen comparison, open the file and use the [Diff](file-view-diff.md). +- For the full-screen comparison, right-click the row and choose **Open diff**, or open the file and use the [Diff](file-view-diff.md). ### Right-click a row -Right-click a file row for **Open in editor**, **Pass on reference** and **Copy reference**. See the [right-click menu](right-click-menu.md#git-rows). Open in editor and Pass on reference close the view first. +Right-click a file row for **Open in editor**, **Open diff**, **Pass on reference** and **Copy reference**. See the [right-click menu](right-click-menu.md#git-rows). Open in editor, Open diff and Pass on reference close the view first. ### Pull and push - **Pull** runs `git pull --no-rebase`. When your branch and origin both have new commits, git merges them. @@ -150,7 +151,7 @@ You do not need to refresh by hand. The list updates by itself: | Keys | Action | |---|---| -| `Cmd+G` | Open or close the Git view | +| `Cmd+G` | Open or close the Git view; from Search or the Diff, close it and open the view | | `Esc` | Close the Git view (after any dialog, menu, search or Diff on top of it) | | `Cmd+C` | Open the view on the commit message (no text selected, not in a terminal) | | `Cmd+Enter` | Commit, while the view is open (not from the console input) | diff --git a/docs/guide/keyboard-shortcuts.md b/docs/guide/keyboard-shortcuts.md index ad4104d..8b17d1d 100644 --- a/docs/guide/keyboard-shortcuts.md +++ b/docs/guide/keyboard-shortcuts.md @@ -51,6 +51,7 @@ Helder is built to run from the keyboard. Press `?` to see a short list of the m - A text field, the code, or a terminal keeps the keys it needs. Arrows, `Return`, `?`, `Cmd+A` and `Cmd+C` with a selection go to the field, not to Helder. - Keys with `Ctrl` or `Opt` always go to the field or terminal, except the menu shortcuts that use them. - While an overlay is open, it owns the keys. `Esc` closes it. The Diff is the exception: the workspace shortcuts keep working over it. +- Search, the Git view, the Schema view and the Diff switch to each other: `Cmd+G` / `Cmd+D` from Search or the Diff close it and open the view (Search only closes when the view is already under it). `Cmd+F` opens Search above the Git or Schema view, and in place of the Diff. - `Esc` closes the topmost layer: a right-click menu, a dialog, search or the Diff first, then the [Schema](schema.md) view's selection, its search text and the view itself, or the [Git](git.md) view. With none of those open, `Esc` goes to the terminal. - While the Git or Schema view is open, the column keys rest: arrows, `Return` and `Cmd+Left` / `Cmd+Right` do nothing in the columns under it. @@ -156,6 +157,8 @@ See [Diff view](file-view-diff.md). | Keys | Action | |---|---| | `Esc` | Close the menu, then the pass-on prompt, then the Diff itself | +| `Cmd+G` / `Cmd+D` | Close the Diff and open the Git / Schema view | +| `Cmd+F` | Close the Diff and open search | | `Cmd+A` | Select all lines on one side | | `Cmd+C` | Copy the selected lines | | `Up` / `Down`, `Return` | Move through and choose in the Diff's right-click menu | @@ -178,6 +181,7 @@ See [Search](search.md). | `Cmd+Left` / `Cmd+Right` | Move to the column on the left or right | | `Up` / `Down`, `Cmd+Up` / `Cmd+Down` | Move through the results in a column | | `Return` | Open the selected result | +| `Cmd+G` / `Cmd+D` | Close search and open the Git / Schema view | | `Esc` | Close search | ### Clean copy diff --git a/docs/guide/right-click-menu.md b/docs/guide/right-click-menu.md index 962d204..df28c71 100644 --- a/docs/guide/right-click-menu.md +++ b/docs/guide/right-click-menu.md @@ -67,6 +67,7 @@ Right-click a file row in the [Git](git.md) view. The header is the file's path. | app/Http/UserController.php | |----------------------------------------| | [] Open in editor | +| <> Open diff | |----------------------------------------| | * Pass on reference | | # Copy reference | @@ -74,6 +75,7 @@ Right-click a file row in the [Git](git.md) view. The header is the file's path. ``` - **Open in editor** (bold): closes the Git view and opens the file in the [File view](file-view.md). A deleted file has nothing to open, so its menu holds only the two reference items. +- **Open diff**: closes the Git view, opens the file and shows its full-screen [Diff](file-view-diff.md). Not on a deleted file. - **Pass on reference**: closes the Git view, then opens the [Pass on](pass-on-to-agent.md) prompt with the file's path. - **Copy reference**: copies the file's path. diff --git a/docs/guide/schema.md b/docs/guide/schema.md index 7c29cde..f45bed5 100644 --- a/docs/guide/schema.md +++ b/docs/guide/schema.md @@ -41,6 +41,7 @@ The Schema view is a full-screen diagram of a Laravel app's database: every tabl ### Open and close the view - `Cmd+D`, the **Schema** toggle in the [Title bar](title-bar.md), or View > Show Schema opens it. The toggle's dot is amber while the view is open. - The view covers the whole window. The columns stay as they were under it, and terminals keep running. +- From [Search](search.md) or the [Diff](file-view-diff.md), `Cmd+D` closes it and opens the view. If the view is already open under Search, `Cmd+D` only closes Search. - Close it with `Cmd+D`, `Esc`, or the **Close** button. The keyboard goes back to the column that had it. - The Git view and the Schema view never show together: opening one closes the other. - The view is not remembered: a project always opens with it closed. @@ -117,7 +118,7 @@ You do not need to refresh by hand. Helder watches the project folder: when the | Keys | Action | |---|---| -| `Cmd+D` | Open or close the Schema view (Laravel apps) | +| `Cmd+D` | Open or close the Schema view (Laravel apps); from Search or the Diff, close it and open the view | | `Return` | In the table search: select and centre the first match | | `Esc` | Deselect the table, then clear the search (while it has the keyboard), then close the view | | `Cmd+G` | Switch to the Git view | diff --git a/docs/guide/search.md b/docs/guide/search.md index da050b7..40d0f07 100644 --- a/docs/guide/search.md +++ b/docs/guide/search.md @@ -35,6 +35,8 @@ Search covers the whole window, edge to edge, like the [Git view](git.md). One q - Press `Cmd+F`, or click **Search** in the [title bar](title-bar.md). - With text selected in the file view, the query starts with the first line of that selection. - Search covers the whole window, title bar and status bar included, with no margin. Press `Esc` to close it. +- Over the [Git](git.md) or [Schema](schema.md) view, Search opens on top of it. From the [Diff](file-view-diff.md), Search takes its place. +- `Cmd+G` and `Cmd+D` close Search and open the Git or Schema view (or leave it open, if it was under Search). Every other key stays with Search. ### Typing - Results update as you type. @@ -97,6 +99,7 @@ Each column says why it is empty: | `Up` / `Down` | Previous / next row in the column | | `Cmd+Up` / `Cmd+Down` | Previous / next row in the column | | `Enter` | Open the selected result | +| `Cmd+G` / `Cmd+D` | Close Search and open the Git / Schema view | | `Esc` | Close Search | ## Settings