Skip to content

Fix keyboard reappearing when navigating to Queue#121

Merged
phanan merged 1 commit into
masterfrom
fix/keyboard-reappears-on-queue-navigation
Mar 22, 2026
Merged

Fix keyboard reappearing when navigating to Queue#121
phanan merged 1 commit into
masterfrom
fix/keyboard-reappears-on-queue-navigation

Conversation

@phanan
Copy link
Copy Markdown
Member

@phanan phanan commented Mar 22, 2026

Summary

  • Dismiss keyboard before pushing the Queue screen from Now Playing

When the search field has focus and the user opens the Now Playing sheet, the keyboard hides correctly. However, tapping the queue icon (CupertinoIcons.list_number) causes the keyboard to reappear because Navigator.pushNamed via the root navigator triggers Flutter's focus restoration on the underlying search field.

Fix: call FocusManager.instance.primaryFocus?.unfocus() before navigating.

Test plan

  • All 76 tests pass
  • Manual: Search → tap search box → tap MiniPlayer → tap queue icon → verify keyboard stays hidden

Summary by CodeRabbit

  • Bug Fixes
    • Fixed navigation behavior in the Now Playing screen to properly dismiss active text input when transitioning to the Queue view.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 22, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ed6fdc65-d128-4f8e-a591-a30dc3cc88ec

📥 Commits

Reviewing files that changed from the base of the PR and between 356dc00 and cf841d6.

📒 Files selected for processing (1)
  • lib/ui/screens/now_playing.dart

📝 Walkthrough

Walkthrough

The now-playing screen's queue navigation handler now explicitly clears any active input focus via FocusManager.instance.primaryFocus?.unfocus() before calling Navigator.of(context, rootNavigator: true).pushNamed(QueueScreen.routeName).

Changes

Cohort / File(s) Summary
Focus Management Before Navigation
lib/ui/screens/now_playing.dart
Updated the IconButton handler to call FocusManager.instance.primaryFocus?.unfocus() prior to navigating to QueueScreen, replacing the prior direct navigation callback.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • koel/player#121 — Applies the same change to the IconButton handler in lib/ui/screens/now_playing.dart, calling FocusManager.instance.primaryFocus?.unfocus() before navigating to the queue.

Poem

🐰✨
I twitch my whiskers, tap the light,
I hush the keys before the flight,
Then off we glide to queue and song,
Soft paws, no focus lingers long. 🎶

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main fix: preventing keyboard reappearance when navigating to the Queue screen, which aligns with the changeset's core purpose.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/keyboard-reappears-on-queue-navigation

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

When the search field has focus and the user opens NowPlayingScreen
then taps the queue icon, the keyboard reappears because Flutter
restores focus to the search field when pushing via the root navigator.
Fix by explicitly unfocusing before the navigation.
@phanan phanan force-pushed the fix/keyboard-reappears-on-queue-navigation branch from 356dc00 to cf841d6 Compare March 22, 2026 20:39
@phanan phanan merged commit ddef4e3 into master Mar 22, 2026
1 of 2 checks passed
@phanan phanan deleted the fix/keyboard-reappears-on-queue-navigation branch March 22, 2026 20:39
@coderabbitai coderabbitai Bot mentioned this pull request Mar 28, 2026
6 tasks
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.

1 participant