Skip to content

feat(ui): add responsive pane sizing - #924

Merged
benvinegar merged 1 commit into
mainfrom
feat/responsive-sidebar-width
Aug 30, 2026
Merged

benvinegar merged 1 commit into
mainfrom
feat/responsive-sidebar-width

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Summary

Make the bundled file sidebar grow with the terminal while preserving host-planned pane geometry and manual resizing. The same bounded fractional sizing is available to bundled and user extension panes through extension API v12.

Automatic layout now treats sidebar visibility and diff layout as independent transitions:

Terminal width Automatic review layout File sidebar
>= 220 split visible; expanded hierarchy when its content reaches 32 columns
160–219 split visible; compact grouped projection when constrained
120–159 split hidden, with the reclaimed width used by the diff
< 120 stack hidden

Explicit split/stack modes remain authoritative, and users can still force the sidebar open below its automatic cutoff.

Approach

  • Add optional ExtensionPaneSize.fraction and validate finite values in (0, 1].
  • Resolve fractional targets from the full body axis, then apply rounding, pane bounds, remaining capacity, and review minimums in the existing host planner.
  • Preserve sizing precedence: manual session override, responsive fractional target, then fixed preferred sizing.
  • Keep manual overrides across temporary terminal clamps without reinterpreting width overrides as height overrides after placement changes.
  • Register the bundled sidebar with a 16% target bounded to 22–56 columns.
  • Preserve deterministic registration-order allocation for competing panes and fixed sizing for existing panes without fraction.
  • Update extension documentation, package checks, skill guidance, and the Changeset.

Verification

  • git ls-files -z | xargs -0 bunx oxfmt --check
  • bun run lint
  • bun run typecheck
  • bun run deps:check
  • bun run test — 2059 passed, 10 skipped
  • bun run test:integration — 137 passed, 1 platform skip
  • bun run test:tty-smoke — 9 passed
  • bun run check:docs
  • bun run website:check
  • bun run build:npm
  • bun run check:pack

Real-PTY coverage exercises live resizing through expanded, compact, sidebar-free split, and stack states, plus forced visibility and divider dragging. Tested on Linux. Independent review found no blockers.

Follow-up

Resetting a manually resized pane back to automatic sizing via double-click or a menu action remains out of scope.

This PR description was generated by Pi using gpt-5.6-sol

@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
hunk-web Ready Ready Preview Aug 30, 2026 7:38pm

Request Review

@greptile-apps

greptile-apps Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds bounded fractional sizing for extension panes and makes the bundled file sidebar grow responsively while preserving manual overrides.

  • Adds extension API v12 pane fractions with runtime validation and package-contract coverage.
  • Updates pane planning and controller state to combine fractional targets, bounds, review capacity, and axis-aware manual overrides.
  • Separates automatic split-layout and sidebar-visibility thresholds.
  • Adds unit, interaction, and PTY coverage for responsive transitions and resizing.

Confidence Score: 5/5

The PR appears safe to merge with responsive pane allocation, manual resizing, extension validation, and layout transitions covered coherently.

Fractional and manual targets are bounded by pane constraints and available review capacity, axis changes cannot reuse incompatible overrides, and the public API, bundled sidebar, documentation, and tests remain aligned.

Important Files Changed

Filename Overview
src/ui/lib/extensionPanes.ts Resolves fractional targets from the full body axis and safely clamps pane allocation against bounds and remaining review capacity.
src/ui/hooks/useExtensionPaneController.ts Preserves manual pane sizes as axis-tagged overrides so reload placement changes cannot reinterpret columns as rows.
src/ui/lib/responsive.ts Separates the automatic split threshold from sidebar visibility while preserving explicit layout modes.
src/extensions/runExtension.ts Validates fractional pane sizes as finite numeric values in the public contract’s supported range.
src/extension-api/types.ts Publishes the optional pane fraction field and advances the extension API generation to version 12.
src/extensions/default/ui/sidebar/index.tsx Configures the bundled files pane with a 16% responsive target bounded between 22 and 56 columns.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Terminal body axis] --> B{Manual override?}
  B -->|Yes| C[Use axis-matched cell override]
  B -->|No| D{Fraction configured?}
  D -->|Yes| E[Round body axis × fraction]
  D -->|No| F[Use preferred cells]
  C --> G[Apply min and max bounds]
  E --> G
  F --> G
  G --> H[Clamp to remaining review capacity]
  H --> I{Minimum still satisfied?}
  I -->|Yes| J[Allocate pane and divider]
  I -->|No| K[Omit pane]
Loading

Reviews (1): Last reviewed commit: "feat(ui): add responsive pane sizing" | Re-trigger Greptile

@benvinegar
benvinegar merged commit 15cdd7c into main Aug 30, 2026
13 checks passed

This branch was successfully deployed

1 active deployment
Preview — 27bfb84e Deployed Aug 30, 2026 by vercel[bot]
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