Skip to content

Studio: keep profile and appearance changes made in another window - #16580

Merged
danielhanchen merged 3 commits into
unslothai:mainfrom
NilayYadav:profile-other-windows
Nov 4, 2026
Merged

danielhanchen merged 3 commits into
unslothai:mainfrom
NilayYadav:profile-other-windows

Conversation

@NilayYadav

@NilayYadav NilayYadav commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

With Studio open in two tabs or windows, a change to the display name, nickname, picture, greeting or appearance (accent colour, fonts, layout) made in one tab was not picked up by the other. The other tab kept the old values in memory, and the next change made there (a nickname, the theme, the language) saved those old values back to the account. Signing in later, or on another device, showed the old name and the old colours, and the changes made in the first tab were lost.

The profile and the appearance customization now reload in every open tab when another tab changes them, the same way browser panel preferences already do. Each tab then saves the current values instead of outdated ones, and the new colours and fonts also show up in the other tab right away.

Screenshots

Before (main) After (this PR)
Tab A set an accent colour and a display name, tab B then edited its nickname. A fresh login shows the old accent and no name. Same steps: the new accent and the name are both kept.

Before/after: a second open tab, no reload

Tab B sits on a new chat while tab A saves a custom greeting ("Hello from the other window") and a red accent. Tab B is then captured without reloading. Base 24d65c1 (left): tab B keeps "How can I help?" and the green accent (--primary #17b88b). This PR at fc81b60 (right): tab B shows the new greeting and the red accent (#d0183c).

Before: tab B keeps the default greeting and green accent. After: tab B shows the greeting and red accent saved in another tab

@NilayYadav NilayYadav self-assigned this Nov 3, 2026
@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

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

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T19:19:05.110495Z 684bc96 Manual request
ℹ️ 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: 52116c5d0f

ℹ️ 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".

if (typeof window !== "undefined") {
window.addEventListener("storage", (event) => {
if (event.key === useUserProfileStore.persist.getOptions().name) {
void useUserProfileStore.persist.rehydrate();

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 Preserve pending edits when another tab hydrates from the server

If tab A edits its name and tab B opens or reloads before A’s 800 ms debounced save runs, B’s usePersonalizationSync loads the old server record and persists it through useUserProfileStore.setState(nextProfile). This new listener imports that stale record into A, whose save-effect cleanup cancels the pending timer. Since the old value matches A’s saved baseline, neither tab saves the edit. Before this change, A retained its edit and its timer saved it. The appearance listener has the same interaction with server-driven replaceAll writes. Preserve or coordinate pending local changes before accepting another tab’s server hydration, and cover this case with both personalization sync hooks active.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Not reachable in practice. The other tab only loads from the server on page load or sign in, and that has to finish inside the 800 ms save debounce here, which a fresh Studio tab can't do. Leaving as is.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 3, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 684bc96440

ℹ️ 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".

@danielhanchen danielhanchen self-assigned this Nov 4, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 4, 2026
@danielhanchen
danielhanchen merged commit f5adb36 into unslothai:main Nov 4, 2026
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.

2 participants