Skip to content

fix(ui): let edge jumps supersede pending reveals - #928

Merged
benvinegar merged 2 commits into
mainfrom
fix/edge-jumps-supersede-reveals
Aug 30, 2026
Merged

fix(ui): let edge jumps supersede pending reveals#928
benvinegar merged 2 commits into
mainfrom
fix/edge-jumps-supersede-reveals

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Problem

A G or gg command issued during selected-hunk settling could briefly reach the requested edge and then be overridden by the pending reveal retry. Greptile identified this race while reviewing the 0.20.x backport in #926 after #922 had already merged.

Fix

  • cancel pending selected-hunk reveal timers and resettling before an edge jump
  • cancel pending file-top alignment at the same authority boundary
  • add an interaction regression that reproduces ] followed immediately by G

The matching 0.20.x fix is included in #926.

Verification

  • bun test src/ui/AppHost.interactions.test.tsx: 76 passed
  • bun run typecheck
  • bun run lint
  • bun run format:check
  • bun run deps:check

@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hunk-web Ignored Ignored Aug 30, 2026 9:34pm

Request Review

@greptile-apps

greptile-apps Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR prevents pending selected-hunk reveal and file-top alignment work from overriding explicit top or bottom jumps.

  • Moves reveal-cancellation helpers before the edge-scroll layout effect so that effect can invoke them.
  • Cancels pending reveal retries, resettling, and file-top alignment before applying an edge jump.
  • Adds an interaction regression for a hunk navigation immediately followed by G.
  • Adds a patch changeset for hunkdiff.

Confidence Score: 5/5

The PR appears safe to merge, with explicit edge jumps consistently taking authority over pending viewport-alignment work.

The cancellation occurs before the edge scroll, clears both scheduled reveal retries and resettling state, and the viewport-follow selection path does not issue a reveal token that could restore the superseded scroll.

Important Files Changed

Filename Overview
src/ui/components/panes/DiffPane.tsx Makes explicit edge-scroll requests supersede pending selection-reveal and file-top alignment work; no actionable defect was identified.
src/ui/AppHost.interactions.test.tsx Adds interaction coverage for an immediate bottom-edge jump while selected-hunk reveal work is pending.
.changeset/fix-edge-jump-reveal-race.md Records the user-visible viewport race fix as a patch release.

Sequence Diagram

sequenceDiagram
  participant User
  participant Commands
  participant DiffPane
  participant PendingReveal
  User->>Commands: Press G or gg
  Commands->>DiffPane: Request edge scroll
  DiffPane->>PendingReveal: Cancel reveal timers and resettling
  DiffPane->>DiffPane: Clear pending file-top alignment
  DiffPane->>DiffPane: Scroll to requested edge
Loading

Reviews (1): Last reviewed commit: "chore: add edge jump fix changeset" | Re-trigger Greptile

@benvinegar
benvinegar merged commit a7c8508 into main Aug 30, 2026
13 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