79 lines
4.8 KiB
Markdown
79 lines
4.8 KiB
Markdown
# 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.
|
|
|
|
## 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, four columns:
|
|
|
|
- **Source Control**: staged and unstaged changes grouped by folder, stage/unstage/discard, the commit box and push at the foot.
|
|
- **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), a per-project note (`.notes.txt`), recent files and recent projects, and a watcher that keeps git, the tree and open files in step with what the agent writes.
|
|
|
|
## 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 Git or Explorer ⌘→ opens the row's menu |
|
|
| ↑ ↓ ↵ | Git or 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 | Focus the commit message (copies when something is selected) |
|
|
| ⌘↵ / ⇧↵ in the message | Commit the staged files |
|
|
| ⌘P | Push; with the note open, pass the whole note to the agent |
|
|
| ⌘N | Project note |
|
|
| ⌘R | Re-read git, the tree and the open file from disk |
|
|
| ⌘G / ⌘L / ⌘. | Source Control column / 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 |
|
|
| ? | Keyboard shortcuts |
|
|
|
|
Closing a window, switching project or quitting (⌘Q) first asks about every unsaved file; a cancel keeps everything open. Then the note and session are 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/<Target>/` (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
|
|
```
|
|
|