Skip to content

feat(status): add a workspace compass with sibling worktrees - #1067

Draft
benvinegar wants to merge 4 commits into
mainfrom
feat/status-workspace-compass
Draft

feat(status): add a workspace compass with sibling worktrees#1067
benvinegar wants to merge 4 commits into
mainfrom
feat/status-workspace-compass

Conversation

@benvinegar

@benvinegar benvinegar commented Sep 9, 2026

Copy link
Copy Markdown
Member

Summary

Add hunk status: a read-only workspace overview that makes current changes and sibling worktrees understandable without leaving the terminal.

  • Separate, indented Tracked changes and Untracked files, with readable staging labels and shared-theme colors. Mixed staged/unstaged changes retain both facts.
  • Show up to 10 files per group, with independent keyboard/mouse expand and collapse actions. Keep a clear boundary before sibling worktrees.
  • Inspect another worktree in the same status surface, then open the existing Log or full multi-file diff and return to the previous selection.
  • Preserve the session's theme/custom palettes, transparency, review preferences, extension authority, and mounted broker target across these routes.
  • Support live refresh, shell-native static output, and complete versioned JSON output.

This is intentionally a draft for product/UX review. It adds one view—not staging controls, an agent dashboard, another diff renderer, or a repository manager. Log/Quit shortcuts are absent from the main action strip; existing keyboard/menu commands remain.

Architecture

Git implements an optional renderer-free ExtensionVcsAdapter.status capability, with bounded cancellable reads and separate current/sibling refreshes. This belongs alongside the existing provider-owned history capability: extensions supply VCS facts while the host retains terminal routing, trust, themes, and lifecycle ownership. No parallel review semantics or broker protocol.

Rebased onto 3fbb223e; extension API 26 follows main's API 25 asynchronous watch signatures. Includes docs/help and a minor Changeset. CI fixes synchronize the tracked package README and canonicalize worktree filesystem identities, with alias/junction regressions included in Windows coverage.

Visual evidence

Real source TUI captured in a Linux PTY through test/pty/harness.ts and the term-video keyframer/tuistory/ghostty renderer—not a mockup. Synthetic Git fixture: 11 tracked changes, 11 untracked files, and one linked sibling.

  • Command: status --no-extensions --theme nord --color always
  • Status: 100×38, plus 42×40 narrow captures and no-color coverage.
  • Existing diff: 100×32, auto layout, entered from status and returned with Q.
  • PTY tests exercise Enter/Space/mouse expansion, hidden-selection safety, resize, sibling inspection, and Log/diff return paths.

Actual grouped status with per-group expansion and sibling worktrees

Capture and behavior notes

Verification

Latest update: 87d7433a

Rebased onto 3fbb223e. Local validation passes packaging, typecheck/dependencies, 183 PTY tests (1 platform skip), and 11 TTY tests. A clean Git candidate checkout passes the full suite: 4,317 pass / 13 skip / 0 fail. The three cwd-dependent failures in the original JJ-colocated checkout also reproduce against fetched main; its same 62 relevant tests pass from a plain Git checkout. Native Windows results are being verified in the current remote CI run; see the latest rebase comment for details.

Earlier validation before this update

Post-rebase checks used the installed Bun 1.4.2 executable explicitly; both default-suite shard headers confirm that version. Equivalent commands below use $BUN for /home/bentlegen/.local/share/mise/installs/bun/1.4.2/bin/bun and prepend its directory to PATH.

  • $BUN run typecheck — pass.
  • $BUN run deps:check — pass, 486 modules / 1,999 edges.
  • $BUN scripts/generate/generate-docs.ts --check — pass.
  • $BUN scripts/test/run-test-suite.ts --group=integration175 pass / 1 platform skip.
  • HUNK_RUN_TTY_SMOKE=1 $BUN test ./test/smoke11 pass, including a real two-file diff entered via status and terminal restoration.
  • $BUN test ./test/review-conformance118 pass.
  • $BUN scripts/test/test-session-broker-node.ts4 pass.
  • $BUN scripts/test/run-test-suite.ts4,258 pass / 13 skip / 3 failures; not a green full-suite result.
  • Formatting/lint pre-commit hooks and git diff --check — pass.

The three failures expect Git but this colocated checkout detects JJ:

  1. resolveSessionVcsId > falls back to detection and reports an id nothing owns
  2. loadConfiguredSessionBootstrap > shares extension-aware loading and session fields across launch and reload callers
  3. registerVcsAdapter with junk > a detect() that throws does not stop other adapters being consulted

Before rebase, these were reproduced using pristine pre-feature 94b71186 sources from git archive HEAD, with dependencies linked and the original checkout cwd retained:

$BUN test \
  "$BASELINE/packages/hunk/src/extensions/apply.test.ts" \
  "$BASELINE/packages/hunk/src/app/sessionBootstrap.test.ts" \
  "$BASELINE/packages/hunk/src/extensions/publicApiRobustness.test.ts"

Result: 59 pass / the same 3 failures. Running both baseline and working sources from a temporary Git-only cwd produced 62 pass / 0 fail each. The assertions were not weakened; post-rebase failures have the same identities and mismatch.

Independent reviews covered provider correctness, routing/cleanup, shared state, refresh races, and the final grouped UX. Findings were fixed and rechecked; the rebase preserves main's direct-review metadata and reran the gates above.

Limits

  • Git-only initially; native JJ/Sapling detection reports unsupported rather than silently falling back. Use --vcs git explicitly when appropriate.
  • Human fetch age is omitted: local FETCH_HEAD mtime cannot attest when the configured upstream was fetched. JSON retains qualified provenance.
  • Linux PTY/TTY tested; Windows/macOS execution and installed-binary rebuild were not performed. Existing platform/provider/opt-in skips remain.
  • No automatic fetch, staging, commit, agent invocation, or sibling extension trust/discovery.

This PR description was generated by Pi using GPT-6 Astra

@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
hunk-web Ignored Ignored Preview Sep 10, 2026 1:39pm UTC

Request Review

@benvinegar

Copy link
Copy Markdown
Member Author

Rebased onto current main (3fbb223e) and pushed 87d7433a with the CI fixes.

  • Preserved main’s async-watch, overlay, PTY synchronization, and release changes; status now uses extension API 26 after main’s API 25.
  • Synchronized the tracked package README with the canonical root copy, fixing packaging.
  • Reused the canonical filesystem-path helper across status identities and added alias/junction round-trip coverage for the Windows short/long-path failures. Added renderer-free status regressions to the focused Windows suite.

Local verification: clean Git checkout full suite 4,317 pass / 13 skip; PTY 183 pass / 1 skip; TTY 11 pass; packaging, typecheck and dependency checks pass. Native Windows verification is pending the new CI run. The original JJ-colocated checkout’s three cwd-sensitive failures also reproduce on fetched main.

This comment was generated by Pi using GPT-6 Astra

@benvinegar
benvinegar force-pushed the feat/status-workspace-compass branch from 6c2d03a to 87d7433 Compare September 10, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant