Skip to content

fix(tui): Esc dismisses the announcement popup like Enter - #883

Merged
LargeModGames merged 1 commit into
LargeModGames:mainfrom
niukanen1:esc-announcement-prompt-871
Oct 17, 2026
Merged

LargeModGames merged 1 commit into
LargeModGames:mainfrom
niukanen1:esc-announcement-prompt-871

Conversation

@niukanen1

@niukanen1 niukanen1 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #871

The announcement popup said [Press ENTER or ESC to dismiss], but Esc did nothing: handle_app sends Esc to the global handle_escape before the per-screen handlers run, and the ActiveBlock::AnnouncementPrompt arm there was empty. The popup's own handler already treats Esc like Enter, so the arm now delegates to it, the same way the community pin prompt arm does.

esc_dismisses_the_announcement_prompt in the slim build walks two announcements through handle_app(Key::Esc, ...): after the first Esc the second announcement is active and the route is still the prompt, after the second the queue is empty and the route has moved on. The test failed on main with the first announcement still active.

Local verification: cargo test --no-default-features --features telemetry,tui 1695 passed / 0 failed, cargo fmt --all -- --check clean, cargo clippy --no-default-features --features telemetry,tui -- -D warnings clean, tools/check_gates_ratchet.sh origin/main ok

Summary by CodeRabbit

  • Bug Fixes
    • Pressing Escape now dismisses the current terminal announcement and advances to the next queued announcement, matching Enter. After the final announcement, the prompt closes.

The global escape handler had an empty arm for the announcement
prompt, so Esc never reached the popup's own handler even though
the prompt says ENTER or ESC. Delegate Esc to the announcement
prompt handler, the same way the community pin prompt arm does.

Fixes LargeModGames#871
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: LargeModGames/spotatui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e1ea964a-03b7-4583-b657-42fbcf57c6b4
📥 Commits

Reviewing files that changed from the base of the PR and between 0075391 and dd959ca.

📒 Files selected for processing: 2
  • CHANGELOG.md
  • src/tui/handlers/mod.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

Escape now reaches the announcement prompt handler. A test checks that Escape advances through queued announcements and exits the prompt after the last one. The changelog records the behavior.

Changes: Announcement dismissal

Layer / File(s) Summary
Escape delegation and dismissal test
src/tui/handlers/mod.rs, CHANGELOG.md
handle_escape delegates Escape to the announcement prompt handler. A test checks that the first Escape displays the next announcement and the second exits the prompt. The changelog documents the behavior.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to dd959

Escape dismisses announcements, advances to the next queued notice, and exits the prompt after the last one. No actionable merge risk is identified.

Pre-merge checks: Passed 4
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title uses the valid fix(tui): conventional-commit prefix and concisely describes the Escape behavior change for the announcement popup.
Linked Issues check Passed Issue #871 requires Esc to dismiss the active announcement, show the next queued announcement, and leave the prompt after the queue is empty. The PR delegates the ActiveBlock::AnnouncementPrompt Esc…
Out of Scope Changes check Passed The reported changes are limited to the announcement Esc delegation, its regression test, and a changelog entry for issue #871. These changes directly support the linked issue. No unrelated implementa…
Full details: Linked Issues check

Explanation

Issue #871 requires Esc to dismiss the active announcement, show the next queued announcement, and leave the prompt after the queue is empty. The PR delegates the ActiveBlock::AnnouncementPrompt Esc path to announcement_prompt::handler, which already implements this behavior. The added esc_dismisses_the_announcement_prompt test checks two queued announcements and both route transitions. The reported slim-build tests, formatting check, and Clippy check pass.

Full details: Out of Scope Changes check

Explanation

The reported changes are limited to the announcement Esc delegation, its regression test, and a changelog entry for issue #871. These changes directly support the linked issue. No unrelated implementation or test changes are identified in the supplied whole-PR summary.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
✨ Simplify code
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@LargeModGames
LargeModGames merged commit 6841c06 into LargeModGames:main Oct 17, 2026
32 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.

Announcement popup: Esc does not dismiss it

2 participants