Skip to content

Fix shell search suggestion pick after dismissing OSK with B#101

Open
CyberoniOntoni wants to merge 2 commits into
dfederm:mainfrom
CyberoniOntoni:fix/search-suggestion-gamepad
Open

Fix shell search suggestion pick after dismissing OSK with B#101
CyberoniOntoni wants to merge 2 commits into
dfederm:mainfrom
CyberoniOntoni:fix/search-suggestion-gamepad

Conversation

@CyberoniOntoni

@CyberoniOntoni CyberoniOntoni commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

What & why

Bugfix for a search panel. Pressing "B" to dismiss the on-screen keyboard while shell search suggestions are open navigated to the first result automatically. Had to suppress those dismiss events so the user can browse suggestions with the d-pad and confirm with "A".

Merge after #98. Review commit 387bdeb only (MainPage.xaml, MainPage.xaml.cs).

Out of scope

Shell search implementation is in #98.
Fully tested on XBSX

@CyberoniOntoni

Copy link
Copy Markdown
Contributor Author

Reopening stacked on feature/xbox-shell-focus so the PR is a single commit.

@CyberoniOntoni CyberoniOntoni force-pushed the fix/search-suggestion-gamepad branch from 686005f to 387bdeb Compare June 23, 2026 12:33
@CyberoniOntoni CyberoniOntoni marked this pull request as draft June 23, 2026 12:35
@CyberoniOntoni CyberoniOntoni force-pushed the fix/search-suggestion-gamepad branch 3 times, most recently from 0a7511d to bcdd623 Compare June 23, 2026 13:00
@CyberoniOntoni CyberoniOntoni marked this pull request as ready for review June 23, 2026 15:36
Comment thread src/JellyBox/MainPage.xaml.cs Outdated

if (GamepadInput.IsBackKey(e.Key))
{
// Dismissing the OSK can spuriously fire QuerySubmitted with the first suggestion.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Is this "can" or "does"? Trying to understand if the platform is quirky or flaky.

For added robustness, can you add something like this in the SearchBox_TextChanged when the reason is UserInput (ie add to your existing if).

// a real keystroke means any pending dismiss-suppression is stale
_ignoreQuerySubmittedCount = 0;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Actually, can you use a time-window debounce instead of a counter? That may be more robust regardless of whether it's exactly 2 or not.

@CyberoniOntoni CyberoniOntoni Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is this "can" or "does"? Trying to understand if the platform is quirky or flaky.

It did.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually, can you use a time-window debounce instead of a counter? That may be more robust regardless of whether it's exactly 2 or not.

okay :)

@dfederm dfederm Jun 24, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Is this "can" or "does"? Trying to understand if the platform is quirky or flaky.

It did.

Sorry I realize I was unclear here (and possibly interpreted as a bit rude). What i meant by this was, does it happen sometimes intermittently ("it can") or does it always happen and exactly the same number of times ("it does").

This is moot though if you make it a time Window since it won't matter exactly the number of times the event fires.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is this "can" or "does"? Trying to understand if the platform is quirky or flaky.

It did.

Sorry I realize I was unclear here (and possibly interpreted as a bit rude). What i meant by this was, does it happen sometimes intermittently ("it can") or does it always happen and exactly the same number of times ("it does").

This is moot though if you make it a time Window since it won't matter exactly the number of times the event fires.

its ok. happened each time, when I tried navigating into a search result field.

AutoSuggestBox.SuggestionChosen throws InvalidCastException for custom suggestion items on Xbox. Handle gamepad A/Enter via PreviewKeyDown, mouse/touch via Tapped, and keyboard via QuerySubmitted.ChosenSuggestion. Suppress spurious QuerySubmitted after B dismisses the OSK.
@CyberoniOntoni CyberoniOntoni force-pushed the fix/search-suggestion-gamepad branch from bcdd623 to c173ee6 Compare June 24, 2026 03:44
@CyberoniOntoni

Copy link
Copy Markdown
Contributor Author

There are few more bugs that need to be addressed:

  1. search bar navigation quirk (entering the actual search with keyboard opening requires few inputs instead of just one)
  2. navigating between items horizontally on main page skips columns time to time, so you may end-up selecting left pop-out menu instead of the item in the first column.

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.

2 participants