Skip to content

feat(ui): make history automatically responsive - #987

Merged
benvinegar merged 4 commits into
feat/hunk-log-chromefrom
feat/hunk-log-responsive
Sep 6, 2026
Merged

feat(ui): make history automatically responsive#987
benvinegar merged 4 commits into
feat/hunk-log-chromefrom
feat/hunk-log-responsive

Conversation

@benvinegar

@benvinegar benvinegar commented Sep 5, 2026

Copy link
Copy Markdown
Member

Stack

Problem

The history stack still exposed static and interactive modes as separate user experiences, and its interactive rows used a conventional left-to-right terminal-log layout. Users should be able to type hunk log once and get the right experience for their environment, with information density that responds automatically to available space.

Approach

  • make plain hunk log open the interactive desktop history browser when stdin and stdout are terminals
  • preserve automatic complete static output for pipes and redirection
  • add --static to force static output on a terminal, paging only when needed
  • retain hidden --interactive parsing as a compatibility alias without documenting a second workflow
  • replace interactive medium/compact controls with one width-driven responsive projection
  • use a GitHub-inspired hierarchy: title, description, author/date/decorations on the left; commit ID and secondary merge state aligned right
  • progressively remove description, date, and secondary state as width contracts
  • reserve the right-side ID and a minimum title budget even for adversarial multi-lane graphs
  • preserve display-cell-correct clickable IDs, themes, Git/Jujutsu providers, bounded loading, menus, and review-return state

Static --oneline and --format remain available because they control shell output rather than creating competing interactive applications.

Validation

  • full test suite: 2,186 passed, 9 skipped
  • log PTY integration: 6 passed
  • bun run typecheck
  • bun run lint
  • bun run check:docs
  • bun run deps:check
  • changed-file formatting and git diff --check
  • independent review of the implementation and follow-up fixes
  • manual tmux validation at 100×24 and 45×18
  • manually verified automatic TTY launch, responsive resize, and forced static output

Tested on Linux with Git, tmux, and a real TTY. Windows was not tested directly.

Visual evidence

The approved responsive design is available at https://sideshow.sh/p/eAsZCIw7mf4. Real-terminal media can be added while this PR remains draft.

Non-goals

  • no repository mutation actions
  • no alternate interactive density modes
  • no changes to provider-owned history or review semantics
  • no removal of static formatting controls used by pipes and scripts

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

@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 Preview Sep 6, 2026 1:00am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR makes hunk log automatically choose an interactive responsive history browser when both standard streams are terminals, while retaining complete static output for pipes, redirection, and --static.

  • Adds width-driven wide, medium, and narrow history-row projections.
  • Right-aligns commit identifiers and provides separate mouse actions for opening and copying.
  • Removes interactive density controls while preserving graph and metadata visibility controls.
  • Updates CLI parsing, startup selection, documentation, and unit/PTY coverage for the new behavior.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness, security, or repository-rule violations identified.

The CLI-selection contract, responsive projection, navigation semantics, and mouse interactions are internally consistent and covered by focused unit and PTY integration tests.

Important Files Changed

Filename Overview
src/app/cli.ts Adds --static, retains hidden parsing compatibility for --interactive, and updates history command help.
src/app/startup.ts Selects interactive history only when static output is not forced and both standard streams are terminals.
src/ui/log/responsiveLayout.ts Introduces display-cell-aware responsive density and row projection logic.
src/ui/log/LogApp.tsx Renders responsive multi-line rows with right-aligned open and copy actions.
test/pty/log-integration.test.ts Covers automatic TTY launch, responsive resizing, clickable IDs, copy actions, and forced static output.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[hunk log invocation] --> B{--static?}
  B -->|Yes| E[Static history output]
  B -->|No| C{stdin and stdout are TTYs?}
  C -->|No| E
  C -->|Yes| D[Interactive history browser]
  D --> F{Terminal width}
  F -->|96+ columns| G[Wide rows]
  F -->|60–95 columns| H[Medium rows]
  F -->|Below 60 columns| I[Narrow rows]
  D --> J[Open selected commit]
  J --> K[Hunk review]
  K --> D
Loading

Reviews (1): Last reviewed commit: "style(ui): space history entries" | Re-trigger Greptile

@benvinegar
benvinegar force-pushed the feat/hunk-log-responsive branch 2 times, most recently from 4ba8d39 to 616912e Compare September 5, 2026 23:07
@benvinegar
benvinegar force-pushed the feat/hunk-log-responsive branch from 616912e to a4fc330 Compare September 6, 2026 01:00
@benvinegar
benvinegar merged commit 1598b0d into main Sep 6, 2026
17 of 18 checks passed
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