Skip to content

fix(notifications): add esc key to return to notification prompt#779

Merged
dlvhdr merged 3 commits intodlvhdr:mainfrom
joelazar:main
Feb 21, 2026
Merged

fix(notifications): add esc key to return to notification prompt#779
dlvhdr merged 3 commits intodlvhdr:mainfrom
joelazar:main

Conversation

@joelazar
Copy link
Contributor

Hi @dlvhdr,

First of all, thanks for adding the notifications feature to the project. Super nice addition 🙌 I was working on it as well on my fork for a bit, but I never got it in a "nice" state enough for firing off for a pull request.

When I tried it out today, I got into a bit of a confusing state though, when I "viewed" one of the notifications and later moved on to another one, I wasn't able to interact with them anymore, because the keybindings were messed up after that subview.

I added another keybinding for being able to move back to the none view mode now and added the following changes:

  • Lets users exit PR/Issue notification detail mode and return to the default notification prompt
  • Resets notification subject/help state when leaving detail mode (and when subject is cleared during sync)

Let me know what you think.

Copilot AI review requested due to automatic review settings February 16, 2026 15:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an escape key binding to allow users to exit from PR/Issue detail view within notifications and return to the notification prompt. This fixes a UX issue where users were stuck in detail mode after viewing a notification, with keybindings continuing to apply to the detailed PR/Issue view rather than the notification list.

Changes:

  • Added BackToNotification keybinding (esc key) to return from PR/Issue detail view to notification prompt
  • Implemented state cleanup when exiting detail mode, resetting both subject data and help keybindings
  • Added comprehensive test coverage for the new functionality

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
internal/tui/keys/notificationKeys.go Added BackToNotification keybinding definition and help text
internal/tui/ui.go Implemented backToNotification() function and integrated keybinding handler; added state resets in syncSidebar() and onViewedRowChanged()
internal/tui/ui_test.go Added two comprehensive tests validating escape key behavior for both PR and Issue notification subjects

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sideshowbarker
Copy link
Contributor

sideshowbarker commented Feb 17, 2026

When I tried it out today, I got into a bit of a confusing state though, when I "viewed" one of the notifications and later moved on to another one, I wasn't able to interact with them anymore, because the keybindings were messed up after that subview.

Yeah that was my bug, but I believe we subsequently fixed that in 6f20475, right?

Lets users exit PR/Issue notification detail mode and return to the default notification prompt

Big +1 — that’s a great refinement. Seems kind of essential, actually. It rightly should have been part of the initial implementation.

Resets notification subject/help state when leaving detail mode (and when subject is cleared during sync)

That’s a nice improvement too.

As a user of the Notifications dashboard, those are both changes I’d like to have.

@joelazar
Copy link
Contributor Author

When I tried it out today, I got into a bit of a confusing state though, when I "viewed" one of the notifications and later moved on to another one, I wasn't able to interact with them anymore, because the keybindings were messed up after that subview.

Yeah that was my bug, but I believe we subsequently fixed that in 6f20475, right?

Lets users exit PR/Issue notification detail mode and return to the default notification prompt

Big +1 — that’s a great refinement. Seems kind of essential, actually. It rightly should have been part of the initial implementation.

Resets notification subject/help state when leaving detail mode (and when subject is cleared during sync)

That’s a nice improvement too.

As a user of the Notifications dashboard, those are both changes I’d like to have.

Yes, sorry, I can confirm that commit was actually fixing that issue which I mentioned there, I was originally testing on the released version.

Thank you for the feedback (and for the feature 😉)

@dlvhdr
Copy link
Owner

dlvhdr commented Feb 18, 2026

o]]hkjkjjk f;

@dlvhdr
Copy link
Owner

dlvhdr commented Feb 18, 2026

this is great! can we also add that key under https://github.com/dlvhdr/gh-dash/blob/main/internal/tui/ui.go?plain=1#L1174, saying something like Enter (and esc to go back)

@joelazar
Copy link
Contributor Author

joelazar commented Feb 20, 2026

Done ✅ Added an Esc go back entry right below the Enter key in the help section now

@dlvhdr
Copy link
Owner

dlvhdr commented Feb 21, 2026

Thank you!

@dlvhdr dlvhdr merged commit 8a0c0db into dlvhdr:main Feb 21, 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.

4 participants