From 39926191705a117f5d0794983f87c092a43cec56 Mon Sep 17 00:00:00 2001 From: Patrick Evans Date: Mon, 10 Aug 2026 08:46:51 -0500 Subject: [PATCH 1/2] chore: test for golangci-lint the same way its invoked --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 946c9794..5818e39f 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,7 @@ coverage: ## Generate test coverage report .PHONY: getlint getlint: ## Install golangci-lint if not already installed @echo "Checking for golangci-lint..." - @which golangci-lint >/dev/null 2>&1 || (echo "Installing golangci-lint..." && go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)) + $(BIN_DIR)/golangci-lint >/dev/null 2>&1 || (echo "Installing golangci-lint..." && go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)) .PHONY: lint lint: getlint ## Run golangci-lint From ac417a05ef304914a1b719104e6ee32c80b8f829 Mon Sep 17 00:00:00 2001 From: Patrick Evans Date: Mon, 10 Aug 2026 08:48:40 -0500 Subject: [PATCH 2/2] feat: support jumping with g+G in incident views Tests Generated by: Claude Code (opus 4.6) --- pkg/tui/model_test.go | 33 +++++++++++++++++++++++++++++++++ pkg/tui/msgHandlers.go | 8 ++++++++ 2 files changed, 41 insertions(+) diff --git a/pkg/tui/model_test.go b/pkg/tui/model_test.go index 52697a00..2c57c256 100644 --- a/pkg/tui/model_test.go +++ b/pkg/tui/model_test.go @@ -1290,6 +1290,39 @@ func TestTabSwitch_TabKey(t *testing.T) { } } +func TestIncidentViewer_TopBottom(t *testing.T) { + m := createTestModel() + m.viewingIncident = true + m.selectedIncident = &pagerduty.Incident{ + APIObject: pagerduty.APIObject{ID: "Q123"}, + } + m.incidentViewer = newIncidentViewer() + m.incidentViewer.Height = 5 + lines := "" + for i := 0; i < 50; i++ { + lines += "line\n" + } + m.incidentViewer.SetContent(lines) + + // Scroll down first so we're not at the top + m.incidentViewer.GotoBottom() + assert.Greater(t, m.incidentViewer.YOffset, 0) + + t.Run("g jumps to top", func(t *testing.T) { + msg := tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'g'}} + result, _ := m.Update(msg) + updated := result.(model) + assert.Equal(t, 0, updated.incidentViewer.YOffset) + }) + + t.Run("G jumps to bottom", func(t *testing.T) { + msg := tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'G'}} + result, _ := m.Update(msg) + updated := result.(model) + assert.Greater(t, updated.incidentViewer.YOffset, 0) + }) +} + // captureLogOutput runs a function while capturing log output at the given level. // Returns the captured log output as a string. func captureLogOutput(level log.Level, fn func()) string { diff --git a/pkg/tui/msgHandlers.go b/pkg/tui/msgHandlers.go index c164b4c2..6570d204 100644 --- a/pkg/tui/msgHandlers.go +++ b/pkg/tui/msgHandlers.go @@ -917,6 +917,14 @@ func switchIncidentFocusMode(m model, msg tea.Msg) (tea.Model, tea.Cmd) { m.incidentViewer, _ = m.incidentViewer.Update(msg) return m, nil + case key.Matches(msg, defaultKeyMap.Top): + m.incidentViewer.GotoTop() + return m, nil + + case key.Matches(msg, defaultKeyMap.Bottom): + m.incidentViewer.GotoBottom() + return m, nil + // Tab/Shift+Tab: switch between tabs case key.Matches(msg, defaultKeyMap.TabNext): m.activeTab = (m.activeTab + 1) % tabCount