Files
helder/docs/design_handoff_helder_app_v2/README.md
T
2026-10-30 13:21:45 +01:00

320 lines
22 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Handoff: Helder App v2 — full-screen Git view
## Overview
Helder is a desktop IDE shell for one developer working with Claude Code. It has a title bar, an Explorer (file tree), a File editor, a Claude transcript with prompt and terminal, a status bar, plus overlays for search and file diff.
**v2 replaces the old 264px Git sidebar with a full-screen Git view.** Press **⌘G** to toggle it. The view covers the whole window, the same way the file diff overlay does. In it the user can:
- see staged, changed, new (untracked) and deleted files, each in its own colour-coded section, with **Staged always on top**
- expand any file to see an inline side-by-side diff with collapsed context
- stage, unstage, discard, delete or restore files one at a time or in bulk
- write a commit message and commit, or commit and push
- pull and push, with ahead/behind counts
- read the real git commands and their output in a **console**, and type git commands there
- see local and remote **branches** and switch between them, but only when the working tree is clean
Everything outside the Git view works as it did in v1 (Explorer, File, Claude, terminal, search, diff, menus, modals). The only exceptions are the changed shortcuts listed below.
## About the design files
The files in this bundle are **design references created in HTML**. They are prototypes that show the intended look and behaviour; they are not production code to copy. The task is to **recreate this design in Helder's real codebase**, using its existing framework, state management and git layer. If no environment exists yet, pick the best fit; for a desktop IDE shell that is likely Electron or Tauri, with React and a real git backend such as `simple-git`, `isomorphic-git` or shelling out to `git`.
The prototype fakes git: file contents live in memory, and console output is simulated. The real build must run real git commands and stream their real stdout and stderr into the console.
## Fidelity
**High-fidelity.** Colours, type, spacing, states and copy are final. Recreate them pixel-precisely with the codebase's own components. The visual language is the Blijnder **Kade** design system in its dark (slate) application: IBM Plex Mono and IBM Plex Sans, flat fields, 2px radii, amber as the only accent, no shadows except on menus and modals.
---
## Keyboard shortcuts (v2)
| Key | Action |
|---|---|
| ⌘G / Ctrl+G | Open or close the Git view |
| ⌘1 / ⌘2 / ⌘3 | Toggle Explorer / File / Claude (in v1 this was ⌘1–4, with Git on ⌘1) |
| ⌘F | Search the project |
| ⌘L | Fluid (soft wrap) |
| ⌘. | Show hidden files |
| ⌘N | Scratch note |
| ⌘↵ (in the commit message) | Commit |
| ↑ (in the console input) | Recall the last command |
| Esc | Closes the topmost layer, in this order: context menu → modal → search → file diff → Git view → interrupts Claude |
The title-bar panel toggle group now reads `Git N · Explorer · File · Claude`. **N** is the number of changed files, and the Git button's dot is amber while the view is open.
---
## Screen: Git view (full screen)
A `position: fixed; inset: 0` layer, `z-index: 44`, background `#101720`, min-width 900px, laid out as a flex column. It sits above the app shell and below the file diff overlay (45), context menu (60/61), modal (70) and toast (80). This lets the confirm modals and the commit menu appear on top of it.
From top to bottom:
### 1. Top bar — 44px
- Background `#18202B`, bottom border `1px #232C39`, padding `0 14px`, flex row, gap 14px, items centred.
- **`[ GIT ]`**: Plex Mono 700, 11px, letter-spacing .14em, uppercase, `#828D9A`.
- **Branch**: Lucide `git-branch` icon at 13px, then the branch name. Plex Mono 500, 12px, `#E8913A`, truncated with an ellipsis.
- **Sync label**: Plex Mono 400, 12px, `#828D9A`. Text is `2 behind origin`, `1 ahead · 2 behind origin`, or `in sync with origin`.
- A flex spacer, then three buttons, each 28px tall:
- Shared style: padding `0 11px`, border `1px #232C39`, radius 2px, transparent background, Plex Sans 500 12px `#BAC0C0`, icon 14px, gap 7px.
- Hover: text `#F4F5F4`, border `#3A424C`.
- **Pull**: icon `arrow-down-to-line`, label `Pull` (`Pulling…` while busy), then the count `↓2` in Plex Mono 600 11px `#E8913A`. The count is hidden when 0.
- **Push**: icon `arrow-up-from-line`, label `Push` (`Pushing…` while busy), then the count `↑1` in the same amber style.
- **Close**: icon `minimize-2`, label `Close`, then the key hint `⌘G` in amber mono 11px.
### 2. Commit block
- Background `#18202B`, bottom border `1px #232C39`.
- **Message textarea**: full width, auto-grows (`field-sizing: content`) from 56px up to 180px.
- Background `#101720`, no border except a `1px #232C39` bottom border, which turns `#E8913A` on focus.
- Padding `14px 16px`, Plex Mono 400, 14px / 1.6, colour `#F4F5F4`, caret `#E8913A`.
- Placeholder: `Commit message`. The field gets focus when the Git view opens.
- **Footer row**: 52px tall, padding `0 14px 0 16px`, gap 16px.
- Author `Jonathan van Rij <jonathan@blijnder.nl>` in Plex Mono 12px `#828D9A`. In the real build, read this from `git config user.name` and `user.email`.
- Hint `⌘↵ commits` in Plex Mono 12px `#6C7783`.
- A spacer, then a **split button**, radius 2px, 32px tall:
- Main part: min-width 160px, padding `0 18px`, Plex Sans 600 13px.
- Label: `Commit N file(s)`, or `Nothing staged` when nothing is staged.
- Ready state (≥1 staged file **and** a non-empty message): background `#E8913A`, text `#101720`.
- Otherwise: background `#232C39`, text `#828D9A`. It stays clickable, so git's own error appears in the console.
- Caret part: 32×32px, `chevron-down` icon at 14px, separated from the main part by a `1px #101720` left border. It opens a context menu with `Commit` (icon `check`) and **`Commit and push`** (icon `arrow-up-from-line`, bold).
- Hover on either part: `filter: brightness(.92)`. (Real build: use amber-deep `#C4741F` instead, per Kade.)
### 3. File sections (scrolling area, `flex: 1`, padding-bottom 24px)
Sections appear in this fixed order, and only when they contain files:
| Section | Contains | Colour | Tint (header background) | Bulk actions (left column · right column) | Row actions (left · right) |
|---|---|---|---|---|---|
| **STAGED** | every staged path, any status | `#E8913A` | `rgba(232,145,58,.08)` | — · Unstage all | — · Unstage |
| **CHANGED** | unstaged, modified | `#F0B476` | `rgba(240,180,118,.06)` | Discard all · Stage all | Discard · Stage |
| **NEW · UNTRACKED** | unstaged, added | `#8FBFB4` | `rgba(143,191,180,.06)` | Delete all · Stage all | Delete · Stage |
| **DELETED** | unstaged, deleted | `#C3A6CE` | `rgba(195,166,206,.06)` | Restore all · Stage all | Restore · Stage |
The section right after Staged gets `margin-top: 28px` and a `1px #232C39` top border, which visually separates staged from unstaged work.
If there are no changes at all, the area shows only: `— No changes. The working tree is clean.` (Plex Sans 13px / 1.6, `#828D9A`, padding `24px 16px`).
**Section header**: 46px tall, padding `0 14px 0 11px`, a `3px` left border in the section colour, the tint background, and a `1px #232C39` bottom border. Hover background is `#18202B`. Clicking it collapses or expands the section. From left to right:
- Chevron at 14px: `chevron-down` in `#E8913A` when open, `chevron-right` in `#6C7783` when closed.
- Label: Plex Mono 700, 11px, .14em, uppercase, in the section colour.
- Count badge: Plex Mono 600 11px, text `#101720` on the section colour, radius 2px, padding `3px 6px`.
- A spacer, then the **actions table**.
**Actions table** (identical in headers and rows, so the buttons line up as columns): a CSS grid `grid-template-columns: 100px 100px; gap: 6px`. When a section has only one action (Staged), the left cell is an empty spacer, so `Unstage` always sits in the right column.
- **Header buttons**: 100×28px, border `1px #3A424C`, radius 2px, transparent background, Plex Sans 500 12px. Hover: border `#6C7783`, background `#232C39`.
- **Row buttons**: 100×26px, border transparent, background transparent. Hover: border `#3A424C`, background `#232C39`, text `#F4F5F4`.
- **Text colour**: destructive actions (Discard, Delete, and their "all" versions) use `#F0B476`; all others use `#BAC0C0`.
- Buttons stop propagation, so clicking one never expands the row.
**File row**: 36px tall, padding `0 14px 0 11px`, gap 10px, row bottom border `1px #232C39`.
- A 3px left border: `#E8913A` for rows in Staged, transparent elsewhere.
- Background `#18202B` when expanded, transparent otherwise. Hover background is `#1F2834`.
- Click toggles the inline diff; right-click opens the context menu (below).
- From left to right:
1. Chevron at 13px: `chevron-down` in `#E8913A` when expanded, otherwise `chevron-right` in `#6C7783`.
2. **Status badge**: 18×18px, radius 2px, filled with the status colour (M `#F0B476`, A `#8FBFB4`, D `#C3A6CE`), letter in Plex Mono 700 11px `#101720`. Tooltip: Modified / New file / Deleted.
3. **Path**: flex 1, ellipsis, Plex Mono 400 13px. The directory part plus `/` is `#828D9A`; the file name is `#F4F5F4`. Deleted files have a `line-through` and the name in `#828D9A`.
4. **Stats**, placed just left of the actions table:
- `+N` in a 52px right-aligned cell, Plex Mono 500 12px `#8FBFB4`.
- `−N` in a 52px right-aligned cell, Plex Mono 500 12px `#F0B476`, padding-right 8px. Use a real minus sign `−`.
5. The actions table.
**Row context menu**:
- `Open in editor` (bold, icon `file-text`; not shown for deleted files): closes the Git view and opens the file.
- Separator.
- `Pass on reference` (icon `sparkle`): closes the Git view and inserts `@path` into the Claude prompt.
- `Copy reference` (icon `files`).
### 4. Inline diff (inside an expanded row)
- A `1px #232C39` top border, padding `8px 0 12px`, Plex Mono 400 13px / 22px.
- Each line is a two-column grid, `minmax(0,1fr) minmax(0,1fr)`. Left is the last commit, right is the working tree. The left cell has a `1px #232C39` right border.
- **Each cell**:
- Line-number column: 52px wide, right-aligned, padding-right 12px, `user-select: none`.
- Code: `white-space: pre-wrap; word-break: break-word; tab-size: 4`, colour `#E4E7E6`.
- **Line types**:
| Type | Background | Line-number colour |
|---|---|---|
| Unchanged | transparent | `#3A424C` |
| Removed (left) | `rgba(232,145,58,.12)` | `#F0B476` |
| Added (right) | `rgba(143,191,180,.12)` | `#8FBFB4` |
| Empty filler (the side with no line) | `rgba(35,44,57,.35)` | — |
- **Intra-line highlight**: when a removed line is paired with an added line, compute their common prefix and suffix. Highlight the differing middle with a background of `rgba(232,145,58,.38)` on the left and `rgba(143,191,180,.36)` on the right. If they share no prefix or suffix, there is no highlight.
- **Hunking**: keep 3 lines of context around each change. Collapse any other run of unchanged lines into one separator row:
- 28px tall, `margin: 6px 0`, background `#18202B`, padding-left 64px.
- Text: `⋯ N unchanged lines` in Plex Mono 11px `#6C7783`.
- Added files show everything on the right; deleted files show everything on the left.
- The prototype uses an LCS line diff (`diffOps`). In production, use `git diff` hunks (`--unified=3`), or a proper diff library, and pair `-`/`+` runs line by line.
### 5. Bottom strip — 230px, split 50/50
- Background `#18202B`, top border `1px #232C39`.
- `display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr)`. The left half has a `1px #232C39` right border.
**Left — Console**
- **Header**: 32px tall, padding `0 12px 0 16px`.
- `[ CONSOLE ] GIT` in Plex Mono 700 10px, .14em, uppercase, `#6C7783`.
- Busy label: `→ pushing to origin…` or `→ pulling from origin…` in 12px `#E8913A`.
- A spacer, then the clear button (icon `eraser` at 14px, `#828D9A`, hover `#F4F5F4`).
- **Log**: scrolls, auto-scrolls to the bottom on every new line, padding `0 16px 12px`, Plex Mono 12px / 1.6, `pre-wrap`, `tab-size: 4`, max 400 lines kept.
- Command lines: `$ git …` in `#F4F5F4`.
- Normal output: `#BAC0C0`.
- Errors and rejections: `#E8913A`.
- Hints: `#828D9A`.
- Staged paths in `status`: `#8FBFB4`; unstaged and untracked paths: `#F0B476`.
- **Input line**: prompt `$ git` in `#8FBFB4`, then an input with no border, Plex Mono 12px `#F4F5F4`. Placeholder: `status · add -A · commit -m "…" · push · pull · log`. Clicking anywhere in the console focuses it, unless the user is selecting text. Enter runs the command; ↑ recalls the last one; `clear` empties the log. A leading `git ` is optional.
**Every UI action logs the exact git command it ran.** The prototype supports these commands, and the real build should simply run git:
- `status`
- `add <path|.|-A>`
- `restore --staged <path|.>`
- `restore <path>`
- `clean -f <path>`
- `commit -m "…"`
- `push`
- `pull`
- `log`
- `diff [--staged]`
- `branch [-a]`
- `switch <name>` / `checkout <name>`
**Right — Branches**
- **Header**: 32px tall, padding `0 16px`.
- `[ BRANCHES ]` in the same style as the console header.
- Right side, 12px mono: `clean · click to switch` in `#828D9A`, or `— N uncommitted files · switching locked` in `#F0B476`.
- **List**: scrolls, with two groups. Group labels are Plex Mono 700 10px, .14em, uppercase, `#6C7783`, padding `8px 16px 4px`:
- **LOCAL**: local branches.
- **REMOTE · ORIGIN**: `origin/*` branches.
- **Branch row**: 28px tall, padding `0 16px 0 13px`, a 3px left border, gap 10px, hover background `#232C39`. From left to right:
- Icon at 13px: `git-branch` for local branches, `cloud` for remote ones.
- Name: Plex Mono 12px, ellipsis.
- Meta text: 11px `#6C7783`.
- Action text: 11px Plex Mono 600 `#E8913A`.
- **States**:
| State | Left border | Background | Name | Icon | Meta | Action | Cursor / opacity |
|---|---|---|---|---|---|---|---|
| Current | `#E8913A` | `rgba(232,145,58,.08)` | 600, `#F4F5F4` | `#E8913A` | `current` | — | default cursor |
| Other, tree clean | transparent | transparent | 400, `#BAC0C0` | `#6C7783` | `tracked` on remotes that already have a local branch | `switch →`, or `checkout →` for a remote with no local branch | pointer |
| Other, tree dirty | transparent | transparent | 400, `#BAC0C0` | `#6C7783` | — | — | 40% opacity, `not-allowed` cursor |
Tooltip on the dirty state: `Commit or discard your changes first`.
- **Switch rules**:
- "Dirty" means there is at least one changed file, staged or not.
- Clicking a branch while dirty only shows the toast `— Commit or discard N files before you switch.` Typing `git switch` while dirty logs git's real error: `error: Your local changes to N files would be overwritten by checkout.` / `Please commit your changes or stash them before you switch branches.` / `Aborting`.
- When clean, switching to a local branch runs `git switch <name>`.
- Switching to a remote branch with no local branch runs `git switch <name>`, which auto-creates a tracking branch. It logs `branch '<name>' set up to track 'origin/<name>'.` and `Switched to a new branch '<name>'`, then adds the branch to the local list.
- After a switch: the title bar, status bar and Git top bar show the new branch; ahead/behind are recalculated; expanded diffs are cleared; a toast reads `Switched to <name>`.
---
## Interactions & behaviour
**Stage / unstage**
- Stage runs `git add <paths>`; when all unstaged paths are staged at once, it logs `git add -A`.
- Unstage runs `git restore --staged <paths>`, or `.` when everything is unstaged.
- Each file moves between sections immediately.
**Discard / delete / restore**
- Modified files: `git restore <paths>`. New files: `git clean -f <paths>`, which logs `Removing <path>` per file.
- Modified and new files open a confirm modal first:
- Title: `Discard changes to <path|N files>?`, or `Delete <path|N files>?` when every file is new.
- Body: `This reverts to the last commit and cannot be undone.`, or `New files are removed from disk. This cannot be undone.` when the batch includes new files.
- Confirm button: `Discard` or `Delete` (amber). Enter confirms, Esc cancels.
- Restoring deleted files is not destructive, so it runs at once without a modal.
**Commit**
- Validation runs through git and shows in the console:
- Nothing staged: `no changes added to commit (use "git add" and/or "git commit -a")`, or `nothing to commit, working tree clean`.
- Empty message: `Aborting commit due to empty commit message.`, and the message field gets focus.
- On success the console shows:
- `[<branch> <sha>] <first line>`
- ` N files changed, X insertions(+), Y deletions(-)`
- ` create mode 100644 <path>` / ` delete mode 100644 <path>` for added and deleted files
- After a commit: the message clears, the staged section disappears, ahead increases by 1, and the commit is added to `git log`.
- **Commit and push** pushes right after a successful commit.
**Push**
- Ahead 0: `Everything up-to-date`.
- Behind > 0: rejected (all in `#E8913A` except the hints):
- ` ! [rejected] <br> -> <br> (fetch first)`
- `error: failed to push some refs to '…'`
- Two hint lines in `#828D9A`: `hint: Updates were rejected because the remote contains work that you do not` / `hint: have locally. Pull first, then push again.`
- Otherwise the console shows the real progress output (`Enumerating…`, `Writing objects…`, `To …`) and ends with ` <old>..<new> <br> -> <br>` in `#8FBFB4`. Then ahead becomes 0 and a toast confirms.
- While busy the button reads `Pushing…` and further push/pull clicks are ignored.
**Pull**
- Behind 0: `Already up to date.`
- Otherwise: `From …`, then a fast-forward (`Updating a..b`, `Fast-forward`, and a diffstat), or `Merge made by the 'ort' strategy.` when ahead > 0, which creates a merge commit. Then behind becomes 0 and a toast reads `Pulled N commits from origin/<br>`.
- In the real build, refresh the file list after a pull.
**Other details**
- On open, the prototype seeds the console with `git fetch origin` output; this is what makes it show "2 behind". In the real build, run a background fetch when the view opens, or every few minutes, to keep the ahead/behind counts honest.
- Toasts appear at the bottom centre: background `#232C39`, border `1px #3A424C`, radius 2px, Plex Mono 13px, prefix `→ ` in amber, hidden after 2.4s.
- **Motion**: colour transitions only, 120–160ms on `cubic-bezier(0.22,1,0.36,1)`. Nothing slides or scales.
## State (Git view)
```
gitOpen: boolean // ⌘G
gitSec: { [sectionKey]: boolean } // false = collapsed (default: open)
gitOpenFiles: string[] // expanded rows, key = `${section}:${path}`
commitMsg: string
staged: string[] // staged paths (real build: from `git status --porcelain=v2`)
files: { [path]: { orig, content } } // prototype only — replace with git status + git diff
BR: string // current branch
branches: string[]; remotes: string[] // `git branch`, `git branch -r`
ahead: number; behind: number // `git rev-list --left-right --count HEAD...@{u}`
commits: { sha, msg }[]
gBusy: null | 'push' | 'pull'
glog: { t: string, c: color }[] // console lines, cap 400
gInput: string; gHist: string[] // console input + history
```
**Derived values**:
- File status: M if `orig ≠ content`, A if `orig === null`, D if `content === null`.
- `unstaged` = changed minus staged. Sections come from status plus staged membership.
- `dirty` = changed.length > 0; it locks branch switching.
## Design tokens used
- **Slate surfaces**:
- `#101720`: page, editor, diff, message field
- `#18202B`: bars, panels, expanded row, separators
- `#1F2834`: row hover
- `#232C39`: rules, hover fills, disabled button
- `#2B3544`: menu border
- `#3A424C`: strong rule, button border, unchanged line numbers
- **Text**:
- `#F4F5F4`: primary
- `#E4E7E6`: code
- `#BAC0C0`: secondary
- `#828D9A`: muted
- `#6C7783`: faint
- **Accent**: `#E8913A` (amber), `#C4741F` (amber-deep, hover), `#F0B476` (amber-soft).
- **Status**:
- Modified `#F0B476`, New `#8FBFB4` (teal), Deleted `#C3A6CE` (lilac), Staged `#E8913A`.
- Teal and lilac already exist in Helder's v1 vocabulary (diff colours and the php badge). They are app-level additions outside the core Kade palette.
- **Type**:
- IBM Plex Mono (400/500/600/700) and IBM Plex Sans (400/500/600).
- Sizes used: 10, 11, 12, 13, 14px.
- Label style: 700, letter-spacing .14em, uppercase, written lowercase in source and in brackets, e.g. `[ console ] git`.
- **Radius**: 2px for buttons, badges and inputs; 4px for menus; 8px for modals.
- **Shadows**: only for menus `0 4px 16px rgba(16,23,32,.45)` and modals `0 16px 48px rgba(16,23,32,.5)`.
- **Spacing**: 4px steps. Common values are 6, 8, 10, 12, 14 and 16px.
## Assets
- **Icons**: Lucide 0.544.0 at stroke width 1.75, through the Kade `Icon` component. Used here:
- `git-branch`, `cloud`
- `arrow-down-to-line`, `arrow-up-from-line`
- `minimize-2`, `chevron-down`, `chevron-right`
- `eraser`, `check`, `file-text`, `sparkle`, `files`
- **Fonts**: IBM Plex Mono and IBM Plex Sans (Google Fonts, through the Kade `tokens/fonts.css`).
- There are no images.
## Files
- `Helder App v2.dc.html`: the full prototype. Open it in a browser next to `support.js`; it loads the Kade tokens and bundle from `_ds/blijnder-e2fd6583-1c87-4e16-bc91-117f035adbbc/` in the source project.
- **Where to look in the file**:
| What | Where |
|---|---|
| Git view markup | the `<!-- git overlay -->` block |
| Git logic | methods prefixed `g…`: `gStage`, `gUnstage`, `gDiscard`, `gCommit`, `gPush`, `gPull`, `gSwitch`, `gStatus`, `gRun`, `gitRows` |
| Section, row and branch view models | `renderVals()`, from `const GC` to `brGroups` |
- `support.js`: the prototype runtime, needed only to open the HTML. Do not port it.