Skip to content

Studio: ship the loaded models indicator off by default - #8346

Merged
oobabooga merged 2 commits into
mainfrom
studio/loaded-models-default-off
Aug 10, 2026
Merged

oobabooga merged 2 commits into
mainfrom
studio/loaded-models-default-off

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Aug 10, 2026 •

Copy link
Copy Markdown
Member

The loaded models indicator shipped on. It should ship off.

Before

getShowLoadedModels read "on unless explicitly disabled":

return localStorage.getItem(STORAGE_KEY) !== "false";

An absent key means a fresh install, so every install got the corner card and its 5s status poll without asking for either.

After

The same key, read the other way round, so absent reads as off:

return localStorage.getItem(STORAGE_KEY) === "true";

The writer stores both values rather than removing the key on disable:

localStorage.setItem(STORAGE_KEY, show ? "true" : "false");

That matters for a tab still running the old bundle during an update, or for a rollback. The old reader treats a missing key as enabled and there is a storage listener on this key, so removing it on disable would let the old tab take the event and turn the card back on. "false" is off under both readers. Absent still means off under the new one, so the default is unaffected.

Existing installs

The only value the old code ever wrote was "false", on disable. "false" === "true" is false, so anyone who already turned it down stays off and sees no change. Nobody has "true" stored, since the old enable path removed the key rather than writing it, so there is no half-migrated state to handle.

The one intended change: an install that left it alone now has it off. That is the point of the PR.

Where the toggle is

Settings > General > Notifications, first row, "Loaded models indicator". Unchanged, and the labels are unchanged.

Testing

tests/loaded-models-dismiss.test.ts, four new cases: the default is off, both toggles store a value the older reader honours, an older explicit "false" still reads as off, and a cleared key falls back to off rather than on. Confirmed the first two fail against the old module, and the second also fails against the first draft of this PR, which removed the key on disable. The other two pass either way, which is the point of them: they are the migration and reset invariants, and they have to hold on both sides.

One existing case asserted the old default indirectly ("closing the card does not switch the setting off" read getShowLoadedModels() as true on a clear store). It now switches the setting on first, so it tests what its name says instead of leaning on the default.

tests/studio/playwright_loaded_models_indicator.py: boot() takes show and seeds the key on by default, so every existing check still exercises the card. The preference section now covers both off paths, the default and an older explicit "false".

  • tsc --noEmit clean
  • npm test, 1603 passing
  • i18n:check:strict clean
  • npm run build clean
  • py_compile clean on the smoke suite
  • Biome on both touched frontend files: 21 warnings and 0 errors, before and after, identical

It was on unless explicitly disabled, so every install got a corner card
and a 5s status poll nobody asked for. Invert it: the key is written on
enable and removed on disable, so absent now reads as off.

An older explicit "false" still reads as off, so anyone who already
turned it down is unaffected. The Playwright suite switches it on in
boot() and now covers the default as well.
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@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: b26e34867f

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

} else {
localStorage.setItem(STORAGE_KEY, "false");
// Remove rather than store "false" so the default stays off.
localStorage.removeItem(STORAGE_KEY);

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 Store false when disabling for old clients

When an older Studio tab remains open during an update, or the installation is rolled back, disabling the indicator here does not remain disabled: the previous implementation interprets a missing key as enabled (getItem(STORAGE_KEY) !== "false"). Removing the key therefore makes the old tab re-enable the card and polling after its storage event; persisting "false" would remain off under both the old and new readers while still leaving fresh installs off by default.

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.

Correct, fixed in b19e307.

Confirmed the mechanism rather than taking it on faith: the old reader is getItem(STORAGE_KEY) !== "false", so a missing key is enabled, and subscribe does listen for storage events on this key. A tab still running the old bundle would take the removal and turn the card back on.

Disabling now writes "false" instead of removing:

localStorage.setItem(STORAGE_KEY, show ? "true" : "false");

Truth table across the two readers:

stored old reader new reader
absent on off
"true" on on
"false" off off

So every value this code writes is read the same way by both, and only the fresh-install default differs, which is the change this PR is for.

Added a case pinning it, which fails against the previous commit. Also added one for a cleared key, since Reset all local preferences removes it and the default has to survive that.

Disabling removed the key, and the old reader treats a missing key as
enabled. A tab still running the old bundle would take the storage event
and turn the card back on. Write "false" instead: off under both
readers, and absent still means off, so the default is unchanged.
@oobabooga

Copy link
Copy Markdown
Member

I checked this through and found no blockers.

  • Fresh installs keep the loaded models card and its 5s poll off.
  • It can still be enabled from Settings > General > Notifications and appears in the bottom-right when a model is loaded.
  • Existing opt-outs stay off, reset returns it to off, and disabling still works with older open tabs.

Merging now.

@oobabooga
oobabooga merged commit 48f010d into main Aug 10, 2026
35 of 45 checks passed
@oobabooga
oobabooga deleted the studio/loaded-models-default-off branch August 10, 2026 20:38
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.

3 participants