fix: allow switching views with “s” key when viewing notifications#754
Merged
dlvhdr merged 2 commits intodlvhdr:mainfrom Feb 6, 2026
Merged
Conversation
When viewing a PR or Issue notification in the Notifications dashboard, pressing 's' to switch views wasn't working. The issue was that the PR/Issue notification handlers in the switch statement would run first, and Go's switch doesn't fall through by default, so the fallback 's' handler was never reached. Added explicit 's' key handlers in both the PR and Issue notification cases to properly switch views. Also added ClearSubject() to clear cached notification data when leaving the Notifications view. Fixes dlvhdr#753
dlvhdr
reviewed
Jan 28, 2026
All 6 call sites of switchSelectedView duplicated the same ~10 lines of section-fetching and state-syncing logic. Move that into the function itself so each call site is a single line. This also fixes a latent bug where the branch view call site was missing the tabs.SetAllLoading() call that all other 5 sites had.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
skey not working to switch views when viewing a PR or Issue notification in the Notifications dashboardProblem
When viewing a notification's details (PR or Issue) in the Notifications dashboard, pressing
sto switch to the PRs or Issues view didn't work. The view would stay on Notifications.Cause
The PR and Issue notification handlers in the switch statement would run first when viewing a notification, and since Go's switch doesn't fall through by default, the fallback
skey handler was never reached.Solution
Added explicit
skey handlers in both the PR and Issue notification cases, to properly switch views. Also addedClearSubject(), to clear cached notification data when leaving the Notifications view.Fixes #753