Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent the RefUI home screen from ending up without a focused/Focusable row after returning to MainView (e.g., after uninstall flows and on state restoration), and bumps the application version to 6.0.33.
Changes:
- Adds focus/state recovery logic in
MainViewto redirect focus when the currently selected row has no items and to refocus after list updates. - Clamps the My Apps (
AppList) index after app list changes (e.g., uninstall) and re-applies focus where appropriate. - Updates RefUI version strings from
6.0.32to6.0.33.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| bolt/package-configs/com.rdkcentral.refui.json | Bumps package version/versionName to 6.0.33. |
| accelerator-home-ui/src/views/MainView.js | Adds focus recovery, index clamping, and refocus logic around AppList/DacApps. |
| accelerator-home-ui/settings.json | Bumps UI settings version to 6.0.33. |
Suppressed comments (2)
accelerator-home-ui/src/views/MainView.js:599
- The new focus corrections in
set appItems()depend onthis.state === 'AppList'/'DacApps'. If the current state has a substate suffix (e.g.AppList.0), the refocus/redirect logic won’t execute and focus can still be lost after app list changes.
// Clamp AppList index if it's now beyond bounds (e.g. after uninstall)
if (this.tag('AppList').length && this.tag('AppList').index >= this.tag('AppList').length) {
this.tag('AppList').setIndex(this.tag('AppList').length - 1)
}
// Re-apply focus if the AppList row is currently focused
if (this.state === 'AppList' && this.tag('AppList').length) {
this._refocus()
}
// If My Apps became empty while focused, move focus to DacApps
if (this.myAppsEmpty && this.state === 'AppList') {
this._setState('DacApps')
}
// If My Apps just became available but focus is on DacApps (wrong initial focus), correct it
if (!this.myAppsEmpty && this.state === 'DacApps' && !this.gracenote && !this.inputSelect) {
this._setState('AppList')
}
accelerator-home-ui/src/views/MainView.js:707
- Similar to the My Apps handling:
set dacApps()checksthis.state === 'DacApps', which won’t match if a substate suffix is ever introduced (or ifthis.stateis persisted/restored with one). Normalizing state before comparison makes the refocus logic resilient.
// Re-apply focus if the DacApps row is currently focused
if (this.state === 'DacApps' && this.tag('DacApps').length) {
this._refocus()
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (1)
accelerator-home-ui/src/views/MainView.js:601
- The
appItemssetter always switches focus fromDacAppstoAppListwhenMy Appsis non-empty and there’s no Gracenote/Inputs. Since$refreshMyAppsRow()is triggered by package changes (install/uninstall) and connectivity events, this can steal focus from a user who intentionally navigated toDacApps, causing an unexpected focus jump on any subsequent refresh.
// If My Apps just became available but focus is on DacApps (wrong initial focus), correct it
if (!this.myAppsEmpty && baseState === 'DacApps' && !this.gracenote && !this.inputSelect) {
this._setState('AppList')
}
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.