Skip to content

id(web): settings shows client id; theme names below icons in theme colour (#1792) - #7328

Merged
dezren39 merged 2 commits into
mainfrom
queue/12566-1792-settings-client-id
Nov 8, 2026
Merged

dezren39 merged 2 commits into
mainfrom
queue/12566-1792-settings-client-id

Conversation

@dezren39

@dezren39 dezren39 commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Fixes the #1792 remainder scoped by task 12566 (settings page only).

Sub-items

  • Client id shows 0s / not rendered — FIXED. render_settings now renders a Client Identity section with <code id="client-id-value"> above the display name, and initSettingsIdentity fills it via the new tested helper clientIdForDisplay (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.
  • Display name on settings page under the id, above theme selection — FIXED by the section order: Client Identity → Display Name → Theme (asserted by the new Rust template test).
  • Name propagation to other clients' cursors — VERIFIED-FIXED (no change needed). POST /api/identity/name (identity_update_name_handler, routes.rs) calls collab.update_client_name, which updates every live cursor for that identity and rebroadcasts it; the settings save path already calls that endpoint via updateDisplayName. Evidence: pkgs/id/src/web/routes.rs handler → pkgs/id/src/web/collab.rs update_client_name.
  • Theme names below icons, in each theme's own colour — FIXED. Settings theme buttons are now icon-dot + label stacks (.theme-choice): the label renders below the dot in the theme's own accent (sneak oklch(0.65 0.2 250), arch oklch(0.75 0.25 145), mech oklch(0.7 0.2 55) — the --color-primary hues each theme defines). The existing delegated click handler (closest("[data-theme]") + .theme-btn) still applies.

Tests

  • New Rust test 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.
  • New vitest settings-identity.test.ts: preference order, persisted fallback, missing/all-zeros → placeholder.
  • CI runs the full web + Rust suites for the touched modules.

Task 12566 · queue worker lane code-a


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Closes #1792

@dezren39
dezren39 requested a review from a team as a code owner November 8, 2026 05:52
@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 99077619-a68b-4e1a-ae8c-7dde06556609
Commits

Reviewing files that changed from the base of the PR and between 36e5b3e and d92b078.

Files selected for processing: 5

  • pkgs/id/src/web/templates.rs
  • pkgs/id/web/src/input.css
  • pkgs/id/web/src/main.ts
  • pkgs/id/web/src/settings-identity.test.ts
  • pkgs/id/web/src/settings-identity.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T06:20:46.872073Z d92b078 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread pkgs/id/web/src/main.ts
Comment on lines +599 to +602
clientIdEl.textContent = clientIdForDisplay(
currentIdentity?.clientId,
getStoredIdentity()?.clientId,
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.
@dezren39
dezren39 merged commit b15a9b3 into main Nov 8, 2026
2 of 4 checks passed
@dezren39
dezren39 deleted the queue/12566-1792-settings-client-id branch November 8, 2026 10:45
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.

id(web): settings — client id shows 0s, name propagation to cursors, theme label layout

1 participant