-
-
Notifications
You must be signed in to change notification settings - Fork 228
feat(ui/ux): update xserver quick menu to align with new UI #686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
utkarshdalal
merged 7 commits into
utkarshdalal:master
from
xXJSONDeruloXx:feat/xserver-quickmenu-sidepanel
Mar 2, 2026
+233
−203
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
56538f0
ui(xserver): switch in-game back menu to QuickMenu side panel
xXJSONDeruloXx 7a05463
feat: add controller driven nav to new opt menu
xXJSONDeruloXx 3af59bf
fix: dont bold focused text to avoid wrapping
xXJSONDeruloXx 61dc8a6
chore: akshually left is better
xXJSONDeruloXx 721052f
Merge upstream/master into feat/xserver-quickmenu-sidepanel
xXJSONDeruloXx 9355ecd
fixed button presses and pausing in new sidebar
2ff602f
Merge pull request #11 from utkarshdalal/feat/xerver-quickmenu-sidepa…
utkarshdalal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
FocusRequester.requestFocus() Jetpack Compose return value boolean failure💡 Result:
FocusRequester.requestFocus()does return aBoolean(in newer Compose it’sfun requestFocus(...): Boolean). It returnstrueif focus was successfully requested, orfalseif the focus request was canceled. [1]What “failure” usually means in practice:
focusProperties { enter/exit = Cancel }, or the target can’t be focused / isn’t focusable). In that case you’ll typically just getfalse. [1][2]FocusRequesterisn’t attached to any node yet (you forgotModifier.focusRequester(...), the modifier order is wrong, or you’re calling it before the node exists—common with subcomposition likeScaffold). That often throwsIllegalStateException: FocusRequester is not initialized…rather than returningfalse. [3]LaunchedEffect), and ensure the requester is associated first. [2][4]How to debug/handle it:
falsedoesn’t tell you why):val focusRequester = remember { FocusRequester() }[3]Modifier.focusRequester(focusRequester)and is actually focusable (e.g.,TextField, or addfocusTarget()/focusable()where appropriate) [2]requestFocus()fromLaunchedEffect/event after the node is in the hierarchy (and insideScaffoldcontent ifScaffoldis involved). [3]Sources: [1] FocusRequester API (requestFocus returns
Boolean, false if canceled) (developer.android.com), [2] “Change focus behavior” (how to request focus; focus properties can prevent focus) (developer.android.com), [3]IllegalStateException: FocusRequester is not initialized…explanation and common fixes (stackoverflow.com), [4] Compose focus codelab warning that callingrequestFocus()without being associated can crash (developer.android.com).Citations:
🏁 Script executed:
Repository: utkarshdalal/GameNative
Length of output: 127
🏁 Script executed:
Repository: utkarshdalal/GameNative
Length of output: 703
Check the Boolean return value of
requestFocus()to properly retry focus requests.At line 243–244,
requestFocus()returns a Boolean but the code ignores it and always returns immediately. This skips retries when focus is denied (returnsfalse) without throwing an exception. Only exception-triggered retries work, leaving cancellations unhandled.Proposed fix
LaunchedEffect(isVisible, menuItems.size) { if (isVisible) { repeat(3) { try { - firstItemFocusRequester.requestFocus() - return@LaunchedEffect + val focused = firstItemFocusRequester.requestFocus() + if (focused) { + return@LaunchedEffect + } } catch (_: Exception) { // Focus request may fail if composition is not ready. - delay(80) } + delay(80) } } }📝 Committable suggestion
🤖 Prompt for AI Agents