Skip to content

fix: restore PR #426 g/G navigation reverted by #419 rebase - #428

Merged
clcollins merged 1 commit into
mainfrom
srepd/restore-426-gg-nav
Aug 11, 2026
Merged

fix: restore PR #426 g/G navigation reverted by #419 rebase#428
clcollins merged 1 commit into
mainfrom
srepd/restore-426-gg-nav

Conversation

@clcollins

Copy link
Copy Markdown
Owner

Problem

PR #426 added g/G (top/bottom) keyboard navigation to the incident viewer and fixed the getlint
Makefile target. It merged successfully, but PR #419's rebase resolved a conflict by keeping only
the #419 side, silently dropping all three #426 changes. CI could not catch the regression because
the feature code AND its test were removed together — a consistent, green tree.

Approach

Surgical restoration of the exact changes from PR #426, verified line-by-line against
gh pr diff 426 --repo clcollins/srepd. No modifications, no adjacent changes.

Changes restored

  1. pkg/tui/msgHandlers.go — two case blocks in switchIncidentFocusMode handling
    defaultKeyMap.Top/Bottom to call GotoTop()/GotoBottom() on the incident viewer viewport.
  2. pkg/tui/model_test.goTestIncidentViewer_TopBottom covering the above navigation.
  3. Makefile — line 71 of the getlint target changed from @which golangci-lint to
    $(BIN_DIR)/golangci-lint, ensuring the project-local binary is used.

Revert checks

Deleted the two case blocks from switchIncidentFocusMode, confirmed
TestIncidentViewer_TopBottom FAILS, restored:

=== RUN   TestIncidentViewer_TopBottom
=== RUN   TestIncidentViewer_TopBottom/g_jumps_to_top
    model_test.go:1315:
            Error Trace:    /workspace/github.com__clcollins__srepd/pkg/tui/model_test.go:1315
            Error:          Not equal:
                            expected: 0
                            actual  : 46
            Test:           TestIncidentViewer_TopBottom/g_jumps_to_top
=== RUN   TestIncidentViewer_TopBottom/G_jumps_to_bottom
--- FAIL: TestIncidentViewer_TopBottom (0.00s)
    --- FAIL: TestIncidentViewer_TopBottom/g_jumps_to_top (0.00s)
    --- PASS: TestIncidentViewer_TopBottom/G_jumps_to_bottom (0.00s)
FAIL
FAIL    github.com/clcollins/srepd/pkg/tui      0.027s
FAIL

After restoring the code:

=== RUN   TestIncidentViewer_TopBottom
=== RUN   TestIncidentViewer_TopBottom/g_jumps_to_top
=== RUN   TestIncidentViewer_TopBottom/G_jumps_to_bottom
--- PASS: TestIncidentViewer_TopBottom (0.00s)
    --- PASS: TestIncidentViewer_TopBottom/g_jumps_to_top (0.00s)
    --- PASS: TestIncidentViewer_TopBottom/G_jumps_to_bottom (0.00s)
PASS
ok      github.com/clcollins/srepd/pkg/tui      0.023s

Test evidence

  • make lint: 0 issues
  • go test ./pkg/tui/... -count=1: PASS
  • make test-race for pkg/tui: PASS (86.7s)
  • Pre-existing cmd test failure on origin/main (unrelated to this PR)

Per-file verification against PR #426

File PR #426 change Status on branch
Makefile @which golangci-lint$(BIN_DIR)/golangci-lint Restored
pkg/tui/model_test.go TestIncidentViewer_TopBottom Restored
pkg/tui/msgHandlers.go Top/Bottom cases in switchIncidentFocusMode Restored

Testing this live

  1. make build
  2. ./dist/srepd_linux_amd64_v1/srepd --dev
  3. Select an incident with Enter to open the incident viewer
  4. Press G — EXPECT: viewport scrolls to bottom
  5. Press g — EXPECT: viewport scrolls to top
  6. Press Esc — returns to incident list

Visual validation

tui-mcp was not available in this environment (headless container). The test
TestIncidentViewer_TopBottom exercises the exact key dispatch and viewport
offset assertions that verify the feature works correctly.

🤖 Generated with Claude Code

PR #426 (g/G navigation in incident viewer) was silently reverted when
PR #419's rebase resolved a conflict by keeping only the #419 side.
CI could not catch it because the feature and its test were removed
together. This restores all three changes verbatim from PR #426.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@clcollins
clcollins merged commit e3ebb4e into main Aug 11, 2026
12 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