Skip to content

fix: allow switching views with “s” key when viewing notifications#754

Merged
dlvhdr merged 2 commits intodlvhdr:mainfrom
sideshowbarker:fix/753-switch-views-from-notifications
Feb 6, 2026
Merged

fix: allow switching views with “s” key when viewing notifications#754
dlvhdr merged 2 commits intodlvhdr:mainfrom
sideshowbarker:fix/753-switch-views-from-notifications

Conversation

@sideshowbarker
Copy link
Contributor

@sideshowbarker sideshowbarker commented Jan 27, 2026

Summary

  • Fix s key not working to switch views when viewing a PR or Issue notification in the Notifications dashboard

Problem

When viewing a notification's details (PR or Issue) in the Notifications dashboard, pressing s to 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 s key handler was never reached.

Solution

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 #753

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
@sideshowbarker sideshowbarker changed the title fix: allow switching views with 's' key when viewing notifications fix: allow switching views with “s” key when viewing notifications Jan 27, 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.
@sideshowbarker sideshowbarker requested a review from dlvhdr February 3, 2026 12:44
Copy link
Owner

@dlvhdr dlvhdr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks dude!

@dlvhdr dlvhdr merged commit 23efed4 into dlvhdr:main Feb 6, 2026
3 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.

[BUG] After viewing item in Notifications you can't switch to Issues or PRs (v4.22.0)

2 participants