adds nice git interface

This commit is contained in:
2026-10-30 13:21:45 +01:00
parent b9c03a7637
commit caec81e762
107 changed files with 6466 additions and 3992 deletions
+63 -62
View File
@@ -11,17 +11,18 @@ Helder is a dark, AI-first macOS code editor for reviewing and navigating code w
The window has three horizontal regions stacked top to bottom:
1. A top bar.
2. The main body, split into four resizable columns.
2. The main body, split into three resizable columns.
3. A bottom status bar.
The four columns of the body, left to right, are:
The three columns of the body, left to right, are:
1. **Source Control**
2. **Explorer** (file tree)
3. **Editor** (one file and its code)
4. **Agent and Terminal**, a single column split into two stacked panes: the Claude agent pane on top and a shell terminal below it.
1. **Explorer** (file tree)
2. **Editor** (one file and its code)
3. **Agent and Terminal**, a single column split into two stacked panes: the Claude agent pane on top and a shell terminal below it.
Every boundary between panes is a draggable splitter. The vertical splitters between the four columns adjust their widths. The horizontal splitter between the agent pane and the terminal pane adjusts their heights. Splitter positions persist across launches. Panes have sensible minimum widths and heights so they cannot be collapsed to nothing by dragging.
Git is not a column: the full-screen **Git view** (section 3) covers all three regions while it is open.
Every boundary between panes is a draggable splitter. The vertical splitters between the three columns adjust their widths. The horizontal splitter between the agent pane and the terminal pane adjusts their heights. Splitter positions persist across launches. Panes have sensible minimum widths and heights so they cannot be collapsed to nothing by dragging.
The interface is dark only. Code is always syntax highlighted, in every panel and every view.
@@ -33,68 +34,66 @@ The top bar contains, left to right:
- The Helder wordmark.
- A breadcrumb showing the path to the active file, for example `console / src / Http / Controller / UserController.php`. The breadcrumb is **display only** for now. It is not clickable and does not navigate.
- Centred on the window, the **pane toggles**: Git · Explorer · File · Claude, one per column, all on by default (see Pane toggles in section 9). The breadcrumb truncates before it reaches them.
- On the right, the toolbar: **Search** (`Cmd+F`) is an action; **Fluid** (`Cmd+L`) and **Hidden** (`Cmd+.`) are toggles. Then `?` for the keyboard shortcuts.
- While Helder reads aloud, a **Stop** toggle appears left of **Search**, in the same style and switched on. A click switches it off and stops the reading; the button then goes away. It also goes away when the reading reaches the end, and a project switch or window close stops the reading.
- Centred on the window, the **pane toggles**: Explorer · File · Claude. Each shows or hides one column, all on by default (see Pane toggles in section 9). The breadcrumb truncates before it reaches them.
- On the right, the toolbar: **`Git N`** (`Cmd+G`) toggles the Git view (section 3); N counts the changed files, a file both staged and unstaged once, and the count is left out when there are none. **Search** (`Cmd+F`) is an action; **Fluid** (`Cmd+L`) and **Hidden** (`Cmd+.`) are toggles. Then `?` for the keyboard shortcuts.
- While Helder reads aloud, a **Stop** toggle appears left of **Git**, in the same style and switched on. A click switches it off and stops the reading; the button then goes away. It also goes away when the reading reaches the end, and a project switch or window close stops the reading.
---
## 3. Source Control panel
## 3. Git view
The leftmost column. It shows the working state of the project's git repository and is where staging and committing happen.
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.
### Header
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.
A `SOURCE CONTROL` header with a count badge showing the total number of changed files (staged plus unstaged).
From top to bottom:
### Commit area
### Top bar
Directly under the header:
`[ git ]`, the current branch in amber, and its place against the upstream: `in sync with origin`, `N ahead of origin`, `N behind origin`, `N ahead · M behind origin`, or `no upstream`. Ahead and behind come from the status header. On the right: **Pull** (with `↓N` when behind), **Push** (with `↑N` when ahead) and **Close** (`⌘G`).
- A single-line **commit message** input.
- A **Commit** button whose label includes the staged count, for example `Commit 2`.
- The Commit button is enabled only when there is at least one staged change and the message field is not empty. Clicking it commits the staged changes with the typed message, clears the message field, and moves the committed files out of the staged section. The working tree updates accordingly.
Opening the view reads the author and the branches, re-reads git and runs `git fetch origin`, but only when an origin exists, so ahead/behind are current.
- **Pull** runs `git pull --no-rebase`: diverged branches merge instead of failing on an unset `pull.rebase`.
- **Push** runs `git push`; when git reports there is no upstream, it retries with `git push -u origin <branch>`. `Cmd+P` pushes from anywhere.
- Both time out after 120 seconds. While one runs its button reads `Pulling…` / `Pushing…`, the console header says so, and a second pull or push is ignored. Git never prompts: no terminal prompt, no editor, no pager.
- The result is a toast: `Pushed N commits to origin/<branch>`, `Pulled N commits from origin/<branch>`, or `Push failed` / `Pull failed` with git's first error line.
### Commit block
- The **commit message**: always one lowercase line. Capitals become lowercase and line breaks become spaces as the user types or pastes, so `Enter` never starts a second line. The field grows with wrapped text from 56 to 180 points. An amber underline shows focus.
- The **author**, `user.name <user.email>` from git config.
- A `⌘↵ commits` hint.
- A **Commit** split button: `Commit N files`, or `Nothing staged`. It is amber when something is staged and the message is not empty, grey otherwise. The caret opens **Commit** and **Commit and push**.
- A commit always runs `git commit -m`, also from the grey button, so git's own refusal shows in the console. On success the message clears and a toast says `Committed N files` with the subject; on failure the message stays, a toast says `Commit failed`, and an empty message takes the focus back. **Commit and push** pushes only after a successful commit.
### Sections
Two stacked sections, each with its own header and count:
Four colour-coded sections, each only when it has rows, in this order:
1. **STAGED CHANGES (n)** on top, listing files that are staged.
2. **CHANGES (n)** below, listing unstaged working-tree changes (added, modified, deleted).
1. **staged**: every staged row, whatever its status. Row and bulk action: **Unstage** / **Unstage all**.
2. **changed**: unstaged edits to tracked files, including renames and conflicts. **Discard** and **Stage**.
3. **new · untracked**: **Delete** and **Stage**.
4. **deleted**: **Restore** and **Stage**.
### Row anatomy
- A header shows the name, a count badge and the bulk actions; a click folds the section.
- A row shows a chevron, a status badge (`A`, `M`, `D`, `R`, `U`), the path (folder dim, name bright, struck through when deleted), `+N` / `−N`, and its actions. A click expands an inline side-by-side diff of that row's half, last commit (or index) left and working tree right, with 3 lines of context around each change and longer unchanged runs folded into `⋯ N unchanged lines`. A file over the diff cap shows `Too big.`.
- 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.
Each row, identical in both sections:
### Console
- A status letter on the far left: `A` added, `M` modified, `D` deleted, each in its own color (added teal, modified amber, deleted amber-deep).
- A file-type icon, then the file name.
- The dimmed relative path, aligned to the right of the name.
- Change counts at the far right: additions in teal (`+N`) and deletions in amber-deep (`-N`).
- Deleted files are shown with the file name struck through and dimmed.
- Rows have default, hover, and selected states. The selected row is the file currently open in the editor.
The bottom-left panel. Every action logs the exact git command (`$ git add -- path`) and streams its output line by line, coloured by kind: errors, hints, staged and unstaged lines of `status`, and the ref update of a push. Below the log, a `$ git` input runs typed commands, with or without a leading `git`. `clear` empties the log, a bare `log` runs `log --oneline --decorate -n 30`, and `Up` recalls earlier input. Commands, typed or from buttons, run one at a time. The log keeps the last 400 lines.
### Interactions
### Branches
- **Left-click** a row opens that file in the editor, on the live file. It does not open the full-screen Diff.
- **Right-click** a row opens a context menu, designed to grow over time:
- In CHANGES (unstaged): **Open diff**, **Stage file**, and **Discard changes**.
- In STAGED: **Open diff**, and **Unstage file**.
- **Open diff** is the explicit way into the full-screen Diff (section 5).
- **Hover quick action**: on hover, an unstaged row shows a `+` to stage it in one click, and a staged row shows a `-` to unstage it.
- Optional section actions: **Stage all** on the CHANGES header and **Unstage all** on the STAGED header.
- **Discard** is a destructive action. It asks for confirmation first (controlled by `git.confirmDiscard`, default on). Discarding reverts a modified file to its committed state and restores a deleted file.
- Staging and unstaging do not ask for confirmation by default (`git.confirmStage` and `git.confirmUnstage`, default off).
### Branch summary bar
At the very bottom of this column, a bar shows the current branch name and the total line changes across the working tree, for example `feat/payments-balance +50 -38`. This bar is **display only**. It does not switch branches.
The bottom-right panel: **local** branches, then **remote · origin**. The current branch is marked; a remote branch with a local counterpart reads `tracked`. A click switches (`switch →`); a remote branch without a local one is checked out as a new tracking branch (`checkout →`). While there are uncommitted changes, switching is locked: the header says so, the other branches dim, and a click shows a toast instead of running git.
### Empty states
- When nothing is staged, the STAGED section shows a dimmed line: `No staged changes`.
- When the working tree is clean, the CHANGES section shows a dimmed line: `Working tree clean`.
Scope note: git in this version covers staging, unstaging, committing, and discarding. Push, pull, fetch, and branch switching are not part of this version.
- Not a repository: `— Not a git repository.`
- Clean working tree: `— No changes. The working tree is clean.`
---
@@ -104,11 +103,11 @@ The second column. A standard project file tree.
- An `EXPLORER` header.
- Folders expand and collapse. Files and folders use type icons.
- Files that have changes show the same status letter as the Source Control panel (`A`, `M`, `D`) on the right of their row.
- Files that have changes show their status letter (`A`, `M`, `D`) on the right of their row.
- **Left-click** a file opens it in the editor. The selected file is highlighted.
- The tree hides paths matched by `files.exclude` and, when `files.followGitignore` is on, paths ignored by git.
- **Right-click** a file offers **Copy reference**, which copies the file's project-relative path to the clipboard (the file-level form of the editor's Copy reference).
- A Markdown file (`.md`) also offers **Read aloud**, in its own group after the pass-on and copy items, in the Explorer and on its git rows. Helder reads the text with the system voice: headings, paragraphs, list items, quotes and table cells, with the markup and link URLs left out and code blocks skipped. The open file is read as it stands in the editor, unsaved edits included. A file with nothing to read shows `Nothing to read`. A new Read aloud replaces the one that is playing. A `$` is read as "dollar", except before a digit (`$5` stays "five dollars").
- A Markdown file (`.md`) also offers **Read aloud**, in its own group after the pass-on and copy items, in the Explorer. Helder reads the text with the system voice: headings, paragraphs, list items, quotes and table cells, with the markup and link URLs left out and code blocks skipped. The open file is read as it stands in the editor, unsaved edits included. A file with nothing to read shows `Nothing to read`. A new Read aloud replaces the one that is playing. A `$` is read as "dollar", except before a digit (`$5` stays "five dollars").
---
@@ -228,26 +227,28 @@ Opens a fuzzy file-open overlay. The user types part of a file name or path, the
### Search (`Cmd+F`)
Opens a modal search overlay that searches **both** file contents and file names at once. The overlay covers 90 percent of the application width and is centered over a dimmed background.
Opens a modal search overlay that searches the open file, file contents and file names at once. Like the Git view, it covers the whole window edge to edge, title bar and status bar included: no margin, no dimmed background, no card. It sits above the Git view when opened from there; toasts sit above it.
Inside the overlay:
- A query field at the top.
- Two result columns below:
- **Left column, 70 percent width**: matches found inside files (content search), grouped by file, each match shown as the matching line with the query highlighted in context.
- **Right column, 30 percent width**: files whose name or path matches the query.
- A query field at the top, with the type chips and a summary.
- Result columns below, each with a fixed share of the width that never changes when the focus moves:
- **This file** (30 percent, only when a file is open): matches in the open file.
- **Project** (45 percent, 65 percent without This file): matches found inside files, grouped by file, each match shown as the matching line with the query highlighted in context.
- **Files** (25 percent, 35 percent without This file): files whose name or path matches the query.
- 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.
- `Esc` closes the overlay. The respected excludes are the same as the Explorer (`files.exclude` and, when on, gitignore).
- `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
The pointer shows what a left click does at that spot. It depends only on what lies under the mouse.
- **Pointing hand** only where a left click runs an action: buttons (title-bar toggles and tools, `?`, Preview, Diff, Commit, Push, stage `+` / unstage `−`, Stage all / Unstage all, dialog buttons, Collapse, search chips), clickable rows (Git file rows, Explorer rows, search results, recent files and projects, launcher rows, symbol popup rows, context-menu items) and the project name in the title bar. Never on a view that only reacts to a right-click, a tooltip or hover.
- **I-beam** where a click places a caret or starts a selection: the code (also below the last line), the Markdown preview, both terminals, the commit message and every overlay input.
- **Pointing hand** only where a left click runs an action: buttons (title-bar toggles and tools, `?`, Preview, Diff, the Git view's buttons and section headers, dialog buttons, Collapse, search chips), clickable rows (Git view file rows and switchable branches, Explorer rows, search results, recent files and projects, launcher rows, symbol popup rows, context-menu items) and the project name in the title bar. Never on a view that only reacts to a right-click, a tooltip or hover.
- **I-beam** where a click places a caret or starts a selection: the code (also below the last line), the Markdown preview, both terminals, the commit message, the Git console and every overlay input.
- **Arrow** everywhere else: labels, headers, folder labels, the gutter, the status bar, scrims, toasts, empty states, and a disabled button such as Commit with nothing staged.
- With an overlay open, every column behind it shows the arrow; the overlay's own buttons, rows and inputs keep theirs.
- With an overlay open, every column behind it, and the Git view, shows the arrow; the overlay's own buttons, rows and inputs keep theirs.
- A splitter shows a resize arrow; `Cmd` over a known PHP class name in the code shows the hand. No other pointers are used.
### Pane resizing
@@ -256,7 +257,7 @@ Dragging any splitter resizes the adjacent panes. Positions persist across launc
### Pane toggles
Each title-bar toggle shows or hides its column; `Cmd+G` is the same as the Git toggle. Hiding only hides: the terminals and their processes, the editor buffer and scroll, and the Explorer's expanded folders survive any number of hide/show cycles. The editor absorbs the freed width; with the editor hidden the Agent and Terminal column fills the rest. With every column off the body shows the editor background. A hidden column cannot take focus, and hiding the focused column hands the keyboard back to the window. `Cmd+C` to the commit box shows a hidden Source Control column. The four flags are saved per project.
Each column toggle in the title bar shows or hides its column; `Cmd+1`, `Cmd+2` and `Cmd+3` do the same for Explorer, File and Claude. Hiding only hides: the terminals and their processes, the editor buffer and scroll, and the Explorer's expanded folders survive any number of hide/show cycles. The editor absorbs the freed width; with the editor hidden the Agent and Terminal column fills the rest. With every column off the body shows the editor background. A hidden column cannot take focus, and hiding the focused column hands the keyboard back to the window. The three flags are saved per project. A saved layout from before the Git view still loads; its Git width and flag are ignored.
### Session restore
@@ -273,14 +274,14 @@ Settings are project-scoped and live in a `.helder` folder in the project root.
- **Effective value** of any setting: the value from `config.json` if present, otherwise the value from `config.default.json`, merged key by key.
- There is no theme file. The code font and size are built in; `Cmd+0`, `Cmd++` and `Cmd+−` zoom the editor, Diff and terminal text.
Settings that affect behavior described above include indentation and editor display, file and search excludes, the default diff mode (`updated` or `diff`), git confirmation prompts, the terminal shell override, the agent auto-launch and command, and session restore.
Settings that affect behavior described above include indentation and editor display, file and search excludes, the default diff mode (`updated` or `diff`), the git discard confirmation, the terminal shell override, the agent auto-launch and command, and session restore.
---
## 11. States and edge cases summary
- **No project open**: the window shows an empty state inviting the user to open a project folder.
- **Clean working tree**: Source Control shows its empty-section messages; the Explorer still shows the full tree.
- **Clean working tree**: the Git view shows its clean message; the Explorer still shows the full tree.
- **Unchanged file open**: normal editable view, no Diff button.
- **Added or deleted file**: views behave as described in section 5.
- **Binary or unsupported file**: placeholder, no Preview or Diff button.