Skip to content

fix(ui): compact menu labels before review titles - #1094

Open
benvinegar wants to merge 1 commit into
mainfrom
fix/responsive-menu-bar
Open

fix(ui): compact menu labels before review titles#1094
benvinegar wants to merge 1 commit into
mainfrom
fix/responsive-menu-bar

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Problem

The top menu keeps every label at full width until menus no longer fit. As menus such as Extensions are added, they consume space from the current review or history title, hiding useful revision and diff-stat context on narrower terminals.

Approach

  • switch Navigate, Extensions, and Help to Nav, Ext, and ? when full labels would truncate the title
  • retain the existing overflow menu as the fallback when compact labels still do not fit
  • derive dropdown placement from the same responsive geometry so mouse and keyboard behavior stay aligned
  • apply the shared behavior to both review and history surfaces

This stays in the shared terminal chrome rather than introducing surface-specific breakpoints. It does not add special semantic truncation for long SHAs; titles still use the existing text fitting after menu compaction.

Visual Evidence

70-column review, GitHub Dark Default, Linux/OpenTUI PTY:

Before:

 File  View  Navigate  Agent  Help   repo working tree  2 files  .

After:

 File  View  Nav  Agent  ?     repo working tree  2 files  +3  -2

At wider widths, the full labels remain unchanged. Sessions with extension commands also compact Extensions to Ext only when the title needs the space.

Verification

  • bun run typecheck
  • bun run lint
  • bun run format:check
  • bun run deps:check
  • bun run test
  • bun test packages/hunk/src/ui/lib/ui-lib.test.ts packages/hunk/src/ui/AppHost.responsive.test.tsx packages/hunk/src/ui/components/ui-components.test.tsx packages/hunk/src/ui/log test/session/broker-e2e.test.ts
  • bun test test/pty/layout.test.ts --test-name-pattern "narrow terminals preserve stats"
  • bun run test:tty-smoke
  • real-PTY source launch against the repository working-tree diff

Tested on Linux. macOS and Windows were not tested locally.

@vercel

vercel Bot commented Sep 11, 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 11, 2026 2:45am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates the shared terminal menu bar to compact selected labels before truncating review or history titles.

  • Adds compact labels for Navigate, Extensions, and Help.
  • Preserves the overflow menu when compact labels still cannot fit.
  • Aligns active dropdown placement with responsive menu geometry.
  • Adds unit, responsive-rendering, PTY, and broker regression coverage.

Confidence Score: 5/5

The PR appears safe to merge; responsive menu rendering and dropdown placement remain internally consistent and are covered by focused regression tests.

No actionable failures remain: menu and title widths use consistent geometry, compact and overflow states preserve menu identity, and dropdowns derive their anchors from the same responsive layout rendered by the menu bar.

Important Files Changed

Filename Overview
packages/hunk/src/ui/components/chrome/menu.ts Adds compact menu reflow, responsive layout typing, overflow handling, and responsive active-menu anchoring.
packages/hunk/src/ui/components/chrome/MenuBar.tsx Includes the current title when selecting full, compact, or overflow menu geometry.
packages/hunk/src/ui/App.tsx Uses responsive menu geometry to place review-surface dropdowns.
packages/hunk/src/ui/log/LogApp.tsx Applies the same responsive title and dropdown behavior to the history surface.
packages/hunk/src/ui/lib/ui-lib.test.ts Covers full and compact labels plus dropdown anchoring for visible and hidden menus.
packages/hunk/src/ui/AppHost.responsive.test.tsx Adds a regression test proving narrow review layouts preserve the complete title and diff statistics.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Build full menu specifications] --> B{Full menus and title fit?}
  B -->|Yes| C[Render full labels]
  B -->|No| D[Reflow with compact labels]
  D --> E{All compact menus fit?}
  E -->|Yes| F[Render compact labels]
  E -->|No| G[Render fitting labels plus overflow control]
  C --> H[Fit title into remaining width]
  F --> H
  G --> H
  H --> I[Anchor active dropdown to visible label or overflow control]
Loading

Reviews (1): Last reviewed commit: "fix(ui): compact menu labels before revi..." | Re-trigger Greptile

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