Skip to content

feat(ui): highlight active panes - #993

Open
benvinegar wants to merge 1 commit into
mainfrom
feat/active-pane-dividers
Open

feat(ui): highlight active panes#993
benvinegar wants to merge 1 commit into
mainfrom
feat/active-pane-dividers

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Problem

Hunk does not identify which docked pane currently owns the user's attention. This is especially unclear for interactive bottom panes such as OpenCode, where focusing the prompt leaves the host divider visually identical to an inactive pane.

Approach

  • Track the active workspace surface in the terminal shell from primary clicks, divider resizes, and focused pane descendants.
  • Paint an active pane's host-owned separator with theme.accent and heavy / glyphs; inactive panes retain theme.border and thin / glyphs.
  • Give fixed-size panes host-owned separators without resize hit targets, so bundled and extension panes follow the same treatment.
  • Fall back to the review when an active pane closes, becomes unavailable, or leaves responsive layout.
  • Keep background activity separate: opening a pane or doing work does not steal activation.

The built-in delegated review-info pane now relies on the host separator instead of drawing its own line. No public extension API changes are required.

Visual

Inactive pane:

────────────────────────────────────────────────────────
  OpenCode

Active after focusing its prompt:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ▸ OpenCode

Verified in a 120x28 Linux PTY using the GitHub dark theme and the real hunk-opencode extension.

Validation

  • bun run format:check
  • bun run lint
  • bun run typecheck
  • bun run deps:check
  • bun run test (2118 passed, 2 skipped)
  • bun run test:integration (143 passed, 1 skipped)
  • bun run test:tty-smoke (9 passed)
  • Source-built Hunk smoke with Ctrl+O against hunk-opencode

Platform tested: Linux. macOS and Windows were not tested manually; PTY suites remain Unix-only.

@vercel

vercel Bot commented Sep 5, 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 Sep 5, 2026 10:17pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds logical workspace-surface activation and uses it to emphasize the separator belonging to the active built-in or extension pane.

  • Tracks activation from primary clicks, successful divider resizes, and focused descendants.
  • Gives fixed and resizable panes host-owned separators while limiting resize hit targets to resizable panes.
  • Moves the delegated review-info pane's separator into the host without changing its total layout footprint.
  • Adds unit, host-level, and PTY coverage for activation, rendering, layout, and input routing.

Confidence Score: 4/5

The implementation appears safe to merge after the non-blocking architecture documentation mismatch is corrected.

Activation, layout, input routing, fixed-pane separators, and delegated metadata geometry are consistently implemented and tested; the only accepted concern is stale documentation describing the previous separator ownership model.

Files Needing Attention: src/extensions/default/ui/reviewInfo/index.tsx and docs/extension-architecture.md

Important Files Changed

Filename Overview
src/ui/hooks/useActivePaneController.ts Introduces centralized pane/review activation state, focused-renderable ancestry resolution, and fallback when an active pane leaves the visible layout.
src/ui/App.tsx Connects workspace surface refs and activation events to pane hosts, review content, and host-owned separators.
src/ui/lib/extensionPanes.ts Allocates a separator for every planned pane and records resize eligibility separately from separator existence.
src/ui/components/panes/PaneDivider.tsx Renders accent-colored heavy glyphs for active panes while retaining resize interaction only for resizable panes.
src/extensions/default/ui/reviewInfo/index.tsx Removes the pane-owned border and reduces content height to two rows, but the corresponding architecture documentation remains stale.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    Click[Primary surface click] --> Controller[Active pane controller]
    Focus[Focused descendant changes] --> Resolve[Resolve owning surface]
    Resolve --> Controller
    Resize[Successful divider resize] --> Controller
    Layout[Visible pane layout] --> Controller
    Controller -->|Pane key| Active[Active pane]
    Controller -->|Review or unavailable pane| Review[Review active]
    Active --> Divider[Accent heavy host separator]
    Review --> Inactive[Thin inactive pane separators]
Loading
Prompt To Fix All With AI
### Issue 1
src/extensions/default/ui/reviewInfo/index.tsx:47
**Architecture documentation is stale**

The bundled review-info pane now has two content rows, with its separator drawn by the host. However, `docs/extension-architecture.md` still describes a fixed three-row pane that draws its own border. This mismatch could lead extension authors to rely on the obsolete ownership and geometry model.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "feat(ui): highlight active panes" | Re-trigger Greptile

title: "Review info",
placement: "top",
height: { preferred: 3, min: 3, max: 3 },
height: { preferred: 2, min: 2, max: 2 },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Architecture documentation is stale

The bundled review-info pane now has two content rows, with its separator drawn by the host. However, docs/extension-architecture.md still describes a fixed three-row pane that draws its own border. This mismatch could lead extension authors to rely on the obsolete ownership and geometry model.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/extensions/default/ui/reviewInfo/index.tsx
Line: 47

Comment:
**Architecture documentation is stale**

The bundled review-info pane now has two content rows, with its separator drawn by the host. However, `docs/extension-architecture.md` still describes a fixed three-row pane that draws its own border. This mismatch could lead extension authors to rely on the obsolete ownership and geometry model.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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