# Helder Functional Design This document describes how Helder behaves: every panel, interaction, and state, at the functional and UX level. It does not cover technical architecture. It is written to match the agreed user interface exactly. Helder is a dark, AI-first macOS code editor for reviewing and navigating code written by an AI agent. It opens one project per window and has no light mode and no theme toggle. --- ## 1. Window layout The window has three horizontal regions stacked top to bottom: 1. A top bar. 2. The main body, split into four resizable columns. 3. A bottom status bar. The four 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. 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. The interface is dark only. Code is always syntax highlighted, in every panel and every view. --- ## 2. Top bar 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`) and **Note** (`Cmd+N`) are actions; **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. --- ## 3. Source Control panel The leftmost column. It shows the working state of the project's git repository and is where staging and committing happen. ### Header A `SOURCE CONTROL` header with a count badge showing the total number of changed files (staged plus unstaged). ### Commit area Directly under the header: - 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. ### Sections Two stacked sections, each with its own header and count: 1. **STAGED CHANGES (n)** on top, listing files that are staged. 2. **CHANGES (n)** below, listing unstaged working-tree changes (added, modified, deleted). ### Row anatomy Each row, identical in both sections: - 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. ### Interactions - **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. ### 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. --- ## 4. Explorer panel 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. - **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"). --- ## 5. Editor The third and widest column. It shows exactly one file: a bar on top and the code below. Opening another file replaces it. Opening a file always reads it fresh from disk. Edits are written only with `Cmd+S` (or by `editor.autoSave`). Opening a file, the same one included, while the open file has unsaved edits asks **Save**, **Don't Save** or **Cancel**: Save writes and then opens, Don't Save drops the edits and opens, Cancel keeps the current file, its edits and the Explorer selection. A failed save keeps the file open. With `editor.autoSave` on, the file saves silently instead of asking. ### Editor bar A row above the code, holding for the open file, left to right: - A type badge and the project-relative path. - An unsaved indicator (a dot) when the file has unsaved edits. This matters because auto-save is off by default (`editor.autoSave`). - For a file with changes relative to its committed state, the change counts: additions in teal (`+N`) and deletions in amber-deep (`−N`). - On the right, a **Preview** button on Markdown files and a **Diff** button on changed files. The button of the active view is highlighted. With no file open, the bar stays empty. ### Views 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. A changed file opens on the live file, or on the Diff when `git.defaultDiffMode` is `diff`. **On the live file, Show diff in the right-click menu of a marked line opens the Diff.** A left click on a marked line places the caret like on any line. The full-screen side-by-side view comes up on the pair of the whole file, HEAD against disk, and both panes scroll so that the right-clicked line sits in the middle of the window. A line near the start or the end of the file goes as near to the middle as the file permits. `Esc` returns to the live file. Hover does nothing, and there is no animation. A new file, where every line is marked, offers no Show diff. Shared rules: teal is what the file holds now, amber-deep is what it held before. There is no green and no red anywhere. Syntax highlighting stays on in all modes. Line numbers follow `editor.lineNumbers` (default absolute). ### Editing behavior - A file with no changes opens directly in a normal editable view with no Diff button, since there is nothing to diff. - Editing follows the editor settings: indentation, indent width, trim trailing whitespace, insert final newline, word wrap, indent guides, whitespace rendering, and active-line highlight, all read from configuration (section 10). - **Word wrap** follows `editor.wordWrap`: `markdown` (default), `on`, or `off`. When it is on, a line too wide for the pane folds onto the next row instead of scrolling sideways. Only the first row of a folded line carries a line number; the rows below it stay blank. Diff never wraps, because its two panes align row by row. ### Right-click in code Right-clicking inside the code area, with or without a selection, shows a context menu without a header line, with two items: 1. **Copy reference**: copies a reference to the clicked location to the clipboard. With no selection it is path plus single line, for example `src/Http/Controller/UserController.php:42`. With a selection it is path plus start and end line, for example `src/Http/Controller/UserController.php:42-58`. The path is project-relative. 2. **Pass on to Agent**: opens a small inline input popup anchored near the click or selection, with a single optional text field. On confirm (`Enter`), it composes one line, the typed text followed by the same reference, and inserts it into the agent pane's input. The insert does **not** submit. It lands as a new, unsubmitted line and the cursor sits on a fresh line, so the action can be repeated to stack several references before the user sends. `Esc` cancels with no insert. An empty field passes the bare reference. With a selection, a separator and **Read aloud selection** follow Copy reference. It reads the selected text with the system voice; in a Markdown file the selection is read as prose, the markup left out. The rendered Markdown preview has no Read aloud selection; its selection is not Helder's (use Read aloud on the file). With a selection, a separator and **Plak** follow Read aloud selection. It sends the selected text to Plak, the user's scratchpad app; see [Plak](#plak). The preview has no Plak. On a marked line of the live file (any marked line, blank lines and the space after the text included), a separator and a last item follow: **Show diff**, which opens the Diff centred on that line. A new file, Preview and the Diff's own menu have no Show diff. ### File-state behavior in the views - **Added file**: only the current content exists. The live file marks every line as added, and Diff shows an empty left pane with the file on the right. - **Deleted file**: only the committed content exists. The editor shows a short placeholder saying there is no updated version, and Diff shows the file on the left with an empty right pane. - **Binary or unsupported file**: cannot be shown as editable text. The editor shows a short placeholder stating the file cannot be displayed, and the Preview and Diff buttons are not shown. --- ## 6. Agent pane The top pane of the fourth column. - A `claude` header with an `agent session` label. - It is a single terminal running the configured agent command. On launch it auto-runs that command when `ai.autoLaunch` is on (default), using `ai.command` (default `claude`). - The pane shows the live agent session and has an input line at the bottom. - It receives the **Pass on to Agent** inserts from the editor: text arrives in the input as content, never as a submitted command, so the user can stack several and send when ready. - It is one terminal only. There are no additional agent sessions in this version. - Both terminals run with `TERM_PROGRAM=Helder` in their environment, so the agent can tell it runs inside Helder. ### Clean copy The agent hands the user text to copy through one file, `.clean-copy` in the project root. The agent overwrites the file each time; Helder only reads it and never clears or deletes it. - When the file's contents change while the project is open, Helder reads it after a short pause (writes are not atomic) and opens the **From Claude** popup, a card like the note. The contents found when the project opens are the baseline and never open the popup. An empty or blank file, or the same text as last seen, opens nothing. - The popup holds an editable text area. **Copy** (or `Cmd+Enter`) copies the text, with the user's edits, to the clipboard as plain text, closes the popup and shows the "Copied" toast. `Esc` or a click outside closes it without copying. - With another overlay open, the newest text waits and opens once that overlay closes. New text while the popup is open replaces its text only when the user has not edited it. - The popup opens in the project's own window even when that window is in the background; Helder does not take focus. --- ## 7. Terminal pane The bottom pane of the fourth column. - A header showing the shell and working directory, for example `zsh` and the project path. - It is a single shell terminal. It uses the operating system default shell, or the override in `terminal.shell` when set. - It behaves as a normal terminal for that shell. - It is one terminal only. There are no additional terminals in this version. ### Right-click in a terminal Right-clicking in the agent pane or the terminal pane shows a menu without a header line. With a selection it holds **Copy**, **Paste**, a separator, **Read aloud selection**, a separator and **Plak**; the agent pane adds a separator and **Wait what?**. Without a selection it holds only **Paste**. **Read aloud selection** reads the selected text with the system voice, as prose with the Markdown markup left out. A selection with no prose left, such as one code block, is read as it is. Blank text reads nothing and shows the toast "Nothing to read". ### Plak **Plak** (code and terminal menus, only with a selection) sends the selected text, trimmed, to Plak, the user's macOS scratchpad app. The text lands at the end of the Plak page as a new block; Plak opens (it starts if needed), scrolls to the block and takes the focus. Blank text sends nothing and shows the toast "Nothing to send". Text up to about 100 KB goes in the URL; longer text goes through the clipboard, and Helder restores the user's clipboard one second later. The URL contract is in [plak.md](plak.md). --- ## 8. Status bar A bar across the bottom of the window. All items are **display only** for now; none are clickable. - On the left: the current branch and the working-tree line totals, for example `feat/payments-balance +50 -38`. - On the right: cursor position (`Ln, Col`), indentation (`Spaces: 4`), encoding (`UTF-8`), language (`PHP`), and the active view. --- ## 9. Global interactions ### Go to File (`Cmd+P`) Opens a fuzzy file-open overlay. The user types part of a file name or path, the list narrows as they type, and selecting a result opens that file in the editor. `Esc` closes the overlay. ### 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. 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. - 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). ### 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. - **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. - 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 Dragging any splitter resizes the adjacent panes. Positions persist across launches. ### 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. ### Session restore When `session.restoreOnLaunch` is on (default), reopening a project restores the previously open file, its view, and the pane and splitter layout. --- ## 10. Configuration Settings are project-scoped and live in a `.helder` folder in the project root. - **`.helder/config.json`**: the user's settings. It is sparse and holds only the values the user has overridden. - **`.helder/config.default.json`**: the full set of defaults, with a default for every value. Helder regenerates this file on launch from its built-in defaults, so it always matches the installed version and serves as live documentation of every available setting. The app never reads user edits from this file. - **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. --- ## 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. - **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. - **Search with no matches**: per-column no-results messages. - **Agent command not available**: the agent pane is a terminal, so a missing or failing command surfaces as ordinary terminal output in that pane. --- ## Open assumptions to confirm - In the Search overlay, content matches are on the left (70 percent) and file-name matches on the right (30 percent). Confirm this assignment, or swap the two sides. - The editor bar shows an unsaved indicator because auto-save defaults to off. Confirm that behavior is wanted. - The Explorer right-click offers a file-level Copy reference (path only), consistent with the editor's Copy reference. Confirm this is in scope.