Repository navigation
id(web): settings shows client id; theme names below icons in theme colour (#1792) - #7328
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 13 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 84dd9ff648
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| clientIdEl.textContent = clientIdForDisplay( | ||
| currentIdentity?.clientId, | ||
| getStoredIdentity()?.clientId, | ||
| ); |
There was a problem hiding this comment.
Refresh the displayed client ID after re-registration
When a tab remains open until its identity token expires, navigating to settings starts ensureIdentity() asynchronously in onMainSwapped() but immediately calls initSettingsIdentity(), so this field displays the old client ID. If validation rejects the expired token, ensureIdentity() registers and persists a new identity; its completion handler updates currentIdentity without updating this element. Settings consequently shows an ID different from the browser's actual identity until another navigation or reload. Refresh the displayed ID when the asynchronous identity refresh completes.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in d92b078 (task 12566, lane code-e): the client-id render is extracted to refreshSettingsClientId(), and onMainSwapped now calls it when the async ensureIdentity() refresh completes and currentIdentity is replaced - so a re-registration after token expiry updates the displayed id on a settings page that already rendered the old one. initSettingsIdentity() uses the same helper, so both paths render identically.
Codex P2 on PR #7328: onMainSwapped started ensureIdentity() asynchronously and initSettingsIdentity() rendered the old client id; when re-registration completed, currentIdentity changed but the element did not. Extract refreshSettingsClientId() and call it when the refresh completes.
Fixes the #1792 remainder scoped by task 12566 (settings page only).
Sub-items
render_settingsnow renders a Client Identity section with<code id="client-id-value">above the display name, andinitSettingsIdentityfills it via the new tested helperclientIdForDisplay(settings-identity.ts): in-memory identity first, localStorage-persisted identity as fallback (that persistence is what makes the id stable across in-site navigation). A missing or all-zeros id renders "Not registered yet" — never a fake id.POST /api/identity/name(identity_update_name_handler, routes.rs) callscollab.update_client_name, which updates every live cursor for that identity and rebroadcasts it; the settings save path already calls that endpoint viaupdateDisplayName. Evidence:pkgs/id/src/web/routes.rshandler →pkgs/id/src/web/collab.rsupdate_client_name..theme-choice): the label renders below the dot in the theme's own accent (sneakoklch(0.65 0.2 250), archoklch(0.75 0.25 145), mechoklch(0.7 0.2 55)— the--color-primaryhues each theme defines). The existing delegated click handler (closest("[data-theme]")+.theme-btn) still applies.Tests
test_render_settings_shows_client_id_and_theme_labels(templates.rs): client-id element present, section ordering, per-theme choice classes, old uniform-button markup gone.settings-identity.test.ts: preference order, persisted fallback, missing/all-zeros → placeholder.Task 12566 · queue worker lane code-a
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Closes #1792