Fix all Copilot review issues - #6
Conversation
…rror recovery state sync, ARIA semantics, SavedAccount type usage Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses prior automated review feedback by tightening types in the main-process auth service and adjusting renderer navbar accessibility attributes for the account switcher UI.
Changes:
- Update
AuthService.getSavedAccounts()to return the sharedSavedAccounttype. - Adjust ARIA attributes/roles for the navbar account dropdown trigger and popup.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
opennow-stable/src/renderer/src/components/Navbar.tsx |
Updates ARIA attributes/roles for the account dropdown trigger and container. |
opennow-stable/src/main/gfn/auth.ts |
Uses shared SavedAccount typing for the saved accounts API surface. |
| 367 className="navbar-user navbar-user--clickable" | ||
| 368 onClick={() => setAccountDropdownOpen((previous) => !previous)} | ||
| 369 aria-expanded={accountDropdownOpen} | ||
| 370 aria-haspopup="listbox" |
| 391 <div className="navbar-account-dropdown" role="list" aria-label="Switch account"> | ||
| 392 <div className="navbar-account-dropdown-header">Switch Account</div> |
|
@copilot apply changes based on the comments in this thread |
There was a problem hiding this comment.
Pull request overview
This PR follows up on PR OpenCloudGaming#344 by addressing prior Copilot review feedback across the renderer navbar and main-process auth service.
Changes:
- Adjusts the Navbar account-switch dropdown ARIA attributes/roles.
- Refactors
AuthService.getSavedAccounts()to return the sharedSavedAccount[]contract type.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
opennow-stable/src/renderer/src/components/Navbar.tsx |
Updates accessibility attributes/roles for the account dropdown UI. |
opennow-stable/src/main/gfn/auth.ts |
Aligns saved-account typing with shared contract and tweaks session refresh/expiry result handling. |
| 365 <button | ||
| 366 type="button" | ||
| 367 className="navbar-user navbar-user--clickable" | ||
| 368 onClick={() => setAccountDropdownOpen((previous) => !previous)} | ||
| 369 aria-expanded={accountDropdownOpen} | ||
| 370 aria-haspopup="listbox" | ||
| 371 > | ||
| 372 {user.avatarUrl ? ( | ||
| 373 <img src={user.avatarUrl} alt={user.displayName} className="navbar-avatar" /> | ||
| 374 ) : ( | ||
| 375 <div className="navbar-avatar-fallback"> | ||
| 376 <User size={14} /> | ||
| 377 </div> | ||
| 378 )} | ||
| 379 <div className="navbar-user-info"> | ||
| 380 <span className="navbar-username">{user.displayName}</span> | ||
| 381 {tierInfo && ( | ||
| 382 <span className={`navbar-tier ${tierInfo.className}`}>{tierInfo.label}</span> | ||
| 383 )} | ||
| 384 </div> | ||
| 385 <ChevronDown | ||
| 386 size={14} | ||
| 387 className={`navbar-user-chevron${accountDropdownOpen ? " is-open" : ""}`} | ||
| 388 /> | ||
| 389 </button> | ||
| 390 {accountDropdownOpen && ( | ||
| 391 <div className="navbar-account-dropdown" role="list" aria-label="Switch account"> | ||
| 392 <div className="navbar-account-dropdown-header">Switch Account</div> |
There was a problem hiding this comment.
Already addressed in commit 9eae745. The account dropdown now uses consistent menu semantics: aria-haspopup="menu" on the trigger, role="menu" on the container, and role="menuitem" on all four interactive buttons (account switch, remove, add account, sign out all).
| 1102 if (!tokens.clientToken && !tokens.refreshToken) { | ||
| 1103 if (expired) { | ||
| 1104 await this.logout(); | ||
| 1105 return { | ||
| 1106 session: null, | ||
| 1107 refresh: { | ||
| 1108 attempted: true, | ||
| 1109 forced: forceRefresh, | ||
| 1110 outcome: "missing_refresh_token", | ||
| 1111 message: "Saved session expired and has no refresh mechanism. Please log in again.", | ||
| 1112 }, | ||
| 1113 }; |
There was a problem hiding this comment.
Fixed in commit 9eae745. After await this.logout(), session: null is now replaced with session: this.getSession() in the !tokens.clientToken && !tokens.refreshToken expired branch. The logout() method updates all in-memory state synchronously (deletes current session, advances activeUserId to next saved account) before its async persist() call, so getSession() correctly returns the new active session after the await.
|
@copilot apply changes based on the comments in this thread |
2 similar comments
|
@copilot apply changes based on the comments in this thread |
|
@copilot apply changes based on the comments in this thread |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…after logout Agent-Logs-Url: https://github.com/priyanshrv1-oss/OpenNOW1/sessions/bc9cb33e-8e97-4cf8-8986-2a9a584abddc Co-authored-by: PriyanshAg-1 <204138848+PriyanshAg-1@users.noreply.github.com>
Fixed in commit 9eae745. The account dropdown now uses consistent
Fixed in commit 9eae745 — see the reply to the inline comment thread for details on the ARIA menu role changes and the auth session fix. |
There was a problem hiding this comment.
Pull request overview
This PR addresses prior Copilot review feedback from PR OpenCloudGaming#344 by tightening multi-account/session behavior in the main auth service and improving ARIA semantics for the renderer account switch dropdown.
Changes:
- Renderer: updates the account switch dropdown to use
menusemantics (aria-haspopup="menu",role="menu",role="menuitem"). - Main: updates
AuthService.getSavedAccounts()to return the sharedSavedAccount[]type and keeps session state consistent in refresh/expiry flows.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| opennow-stable/src/renderer/src/components/Navbar.tsx | Adjusts account dropdown ARIA roles/attributes and related UI structure. |
| opennow-stable/src/main/gfn/auth.ts | Aligns saved-account typing with shared contract and refines session refresh/expiry handling. |
| 391 <div className="navbar-account-dropdown" role="menu" aria-label="Switch account"> | ||
| 392 <div className="navbar-account-dropdown-header">Switch Account</div> | ||
| 393 <div className="navbar-account-list"> |
There was a problem hiding this comment.
Fixed in commit ffab5bb. Added role="none" to the three non-interactive structural wrapper elements inside role="menu": the header div (.navbar-account-dropdown-header), the list wrapper (.navbar-account-list), and each account row wrapper (.navbar-account-item). The divider already had role="separator". All interactive buttons retain role="menuitem", so the ARIA owned-element contract for role="menu" is now valid.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ne numbers in TS files Agent-Logs-Url: https://github.com/priyanshrv1-oss/OpenNOW1/sessions/f707cd73-f431-41cf-96a8-c5e0c34ab939 Co-authored-by: PriyanshAg-1 <204138848+PriyanshAg-1@users.noreply.github.com>
Already addressed in commit 9eae745 (
Already addressed — ARIA menu roles fixed in 9eae745, structural wrappers (
Already addressed — ARIA menu roles fixed in 9eae745, structural wrappers (
Already addressed — ARIA menu roles fixed in 9eae745, structural wrappers ( |
There was a problem hiding this comment.
Pull request overview
Updates the account-switch dropdown accessibility semantics in the renderer and aligns the main-process AuthService.getSavedAccounts() return type with the shared cross-process contract in @shared/gfn.
Changes:
- Adjusts the Navbar account dropdown ARIA roles (presentational wrappers, separator, menuitems).
- Replaces an inline
getSavedAccounts()return type with the sharedSavedAccountinterface.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| opennow-stable/src/renderer/src/components/Navbar.tsx | Refines ARIA roles within the account dropdown to better match menu semantics. |
| opennow-stable/src/main/gfn/auth.ts | Uses SavedAccount[] from @shared/gfn for getSavedAccounts() to keep the shared contract consistent. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR aims to address prior Copilot review feedback from PR OpenCloudGaming#344 by adjusting the navbar account dropdown’s accessibility markup and aligning the main-process getSavedAccounts() return type with the shared SavedAccount contract.
Changes:
- Updated the account dropdown trigger/popup attributes in
Navbar.tsx(ids/aria-controls, roles, divider semantics). - Replaced an inline structural type in
AuthService.getSavedAccounts()with the sharedSavedAccountinterface.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
opennow-stable/src/renderer/src/components/Navbar.tsx |
Tweaks ARIA relationships/roles for the account dropdown UI. |
opennow-stable/src/main/gfn/auth.ts |
Uses SavedAccount from @shared/gfn for getSavedAccounts() typing. |
| })} | ||
| </div> | ||
| <div className="navbar-account-divider" /> | ||
| <div className="navbar-account-divider" aria-hidden="true" /> |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@copilot apply changes based on the comments in this thread |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Fixes all Copilot AI review comments from PR OpenCloudGaming#344