Skip to content

fix(tui): interaction improvements to diff viewer#28851

Merged
jlongster merged 2 commits into
devfrom
jlongster/diff-viewer-interaction-improvements
May 22, 2026
Merged

fix(tui): interaction improvements to diff viewer#28851
jlongster merged 2 commits into
devfrom
jlongster/diff-viewer-interaction-improvements

Conversation

@jlongster
Copy link
Copy Markdown
Contributor

@jlongster jlongster commented May 22, 2026

Issue for this PR

N/A

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This improves interactions in the TUI diff viewer.

The main fix is that next and previous file navigation now uses the ordered patch file list instead of relying on viewport-derived state. This makes navigation more reliable when the file tree is focused, when single-patch mode is enabled, and when switching between single-patch and all-patches views.

It also keeps the selected patch and file tree selection synchronized, scrolls the selected patch after render when needed, and keeps selected files highlighted with the active accent color even when they are marked reviewed.

The file tree navigation logic was moved into testable utilities with coverage for ordering, movement, and selection behavior.

How did you verify your code works?

  • Ran bun typecheck from packages/opencode
  • Push hook ran bun turbo typecheck
  • Manually tested the diff viewer with multiple added and modified files

Screenshots / recordings

Not included.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added contributor needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels May 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • No issue referenced. Please add Closes #<number> linking to the relevant issue.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@jlongster jlongster merged commit 69e4f52 into dev May 22, 2026
10 checks passed
@jlongster jlongster deleted the jlongster/diff-viewer-interaction-improvements branch May 22, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor needs:compliance This means the issue will auto-close after 2 hours. needs:issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant