# Helder. Helder is the dark workbench for reviewing the code Claude Code writes: a native macOS app in Swift, SwiftUI and AppKit. See [docs/index.md](docs/index.md) for the architecture, the design tokens and the behaviour spec. ![A PHP file with its changed lines marked, the Explorer on the left and Claude Code on the right](docs/images/php-editor.png) ## Build, test, run ```bash scripts/build.sh # debug build (--release for release) scripts/test.sh # all three test targets; e.g. --filter WorkspaceModel scripts/run.sh [project] # build and run; the optional folder opens in the first window scripts/bundle.sh # "build/Helder.app", ad-hoc signed, with ripgrep inside (--install copies it to ~/Applications) ``` Always use the scripts: they select the toolchain this machine needs. Search uses ripgrep when it can find one (`Contents/Helpers/rg` in the bundle, copied from `vendor/ripgrep/rg`, or `$RG_BINARY`) and a slower Swift walk otherwise. ## What it does One project per window, three columns, and a full-screen Git view over them: - **Git view** (⌘G): staged, changed, new and deleted files with inline diffs; stage, unstage, discard, delete, restore; commit, commit and push, pull; a console with every git command; branch switching. - **Explorer**: the file tree with change letters; new file/folder, rename, delete, Show in Finder, copy or pass on a reference. - **Editor**: one open file under a bar with its path, unsaved dot and change counts; changed lines marked in the live code, Diff opens a full-screen side-by-side view; Preview renders Markdown; ⌘-click on a PHP class shows its definition and uses. - **Agent**: Claude Code over a plain shell. "Pass on" pastes a reference (and the selected code) into the agent's composer without sending it. Plus ⌘F search (this file, the project, file names), recent files and recent projects, and a watcher that keeps git, the tree and open files in step with what the agent writes. ### Git view Staged, changed, new and deleted files, each with an inline side-by-side diff. ![The full-screen Git view with staged, changed and new files and an open diff](docs/images/git-view.png) ### Markdown preview ![A rendered Markdown file with headings, a code block, a table and a list](docs/images/markdown-preview.png) ### Search One query searches the open file, the whole project and the file names. ![Search with hits in the open file, in the project and in the file names](docs/images/search.png) ## Fork it with AI [prompt.md](prompt.md) is a complete rebuild handoff for an AI agent such as Claude Code. Give it that one file, name a target language and UI toolkit, and it can rebuild Helder with the same behaviour, look and feel. The file holds every string, colour, size and key, and it lists every test as a plain-English rule. ## Design [design/](design/) holds the v2 design handoff: [design/README.md](design/README.md) describes the full-screen Git view and the design tokens, and `Helder App v2.dc.html` is the HTML prototype (open it in a browser next to `support.js`). The prototype is a reference, not production code. Where it differs from the app, the code wins. ## Keyboard | Keys | Action | |---|---| | ⌘F | Search this file, the project and file names | | ⌘O | Open a folder | | ⇧⌘O | Open recent project: the list of recent projects | | ⇧⌘N | New window | | ⌘← ⌘→ | Column left or right; in the Explorer ⌘→ opens the row's menu | | ↑ ↓ ↵ | Explorer: move the row cursor, open the row | | ⌘↑ ⌘↓ | Recent files, from the editor | | ⌘→ (selection) | Pass the selection to the agent | | ⌘M | Markdown: code or rendered preview | | ⌘S / ⌘W | Save / close the open file (asks about unsaved edits) | | ⌘C | Open the Git view on the commit message (copies when something is selected) | | ⌘↵ | Commit the staged files, while the Git view is open | | ⌘P | Push | | ⌘R | Re-read git, the tree and the open file from disk | | ⌘G | Open or close the Git view | | ⌘1 / ⌘2 / ⌘3 | Explorer / File / Claude column on or off | | ⌘L / ⌘. | Fluid columns / hidden files | | ⌘A | Select all in the focused pane; in the code pane, the whole file | | ⌘0 / ⌘+ / ⌘− | Zoom: editor, Diff and terminal text | | Esc | Close the overlay, then the Git view | | ? | Keyboard shortcuts | Closing a window, switching project or quitting (⌘Q) first asks about every unsaved file; a cancel keeps everything open. Then the session is written and both terminals end. A terminal whose process exited restarts on the next key press; right-click in a terminal gives Copy (with a selection) and Paste. ## Testing Three test targets mirror the three library targets: `Tests/HelderCoreTests`, `Tests/HelderServicesTests` and `Tests/HelderUITests`. Inside each target, the folders mirror `Sources//` (a test for `Sources/HelderUI/State/EditorStore.swift` sits in `Tests/HelderUITests/State/`). The tests use Swift Testing. For a PHPUnit reader: | PHPUnit | Swift Testing | |---|---| | `class FooTest extends TestCase` | `@Suite struct FooTests` | | `public function test_it_works()` | `@Test func itWorks()` | | `$this->assertSame($a, $b)` | `#expect(a == b)` | | `$this->markTestSkipped` / fail early | `try #require(value)` (stops the test when nil or false) | | `@dataProvider` | `@Test(arguments: [...]) func x(_ value: …)` | | `setUp()` | the suite's `init()`, or a helper that builds the fixture | - **Fakes and harnesses** live in `Tests/HelderUITests/Support/`: one fake per service protocol in `Fakes/` (`FakeGit`, `FakeFiles`, `FakeSystem`, `FakeTerminal`, …), and `WorkspaceHarness`, which wires a whole window to those fakes. UI tests never touch the disk, git, the user's defaults or the log. - **Integration tests** in `HelderServicesTests` run the real `git` and file system. `TempGitRepo` creates a throwaway repository (`commit`, `write`, `run`); `TempDirectory` a throwaway folder. - **Waiting**: `await model.settle()` or `eventually { … }`, never a sleep. ```bash scripts/test.sh # everything scripts/test.sh --filter GitServiceLoadTests # one suite (the @Suite name, not the file name) scripts/test.sh --filter "GitServiceLoadTests/aFileUnderTheSizeCapStillCarriesItsText" # one test ```