Repository navigation
Studio: background fit and position controls, outline strength slider, composer setting in Appearance, audio and library polish - #16287
Conversation
…ser setting in Appearance, audio and library polish - Background image: Fit width / Fit height sizing, horizontal and vertical position sliders, and the composer outline as a 0-100% strength slider (default 30%, stronger than the old border line; saved on/off migrate). - Move "Composer at the bottom" from Settings > Chat to Appearance. - Settings > API and the API page quick start drop the Training chip; it only appears while the Train page's API button has that example open. - Library Chats / Archived grid view: no rule under the date headings. - Audio: Transcribe matches Generate (accent button, outline Stop), and the hint line under both keeps its space so the button does not jump. - Chat dictation: 48 rounded bars that grow in height, a fading left edge and a pulsing recording dot. - Images: the empty output panel uses the Images tab icon.
Before / afterBEFORE is the merge base ( Background image controls: the outline switch becomes a strength slider (30% by default), and Horizontal / Vertical position sliders sit under the preset grid. Image sizing: Fit width and Fit height are new. Composer over the background: the ring goes from the light Settings > Appearance: "Composer at the bottom" now sits under Chat width. It is gone from Settings > Chat (0 matches there after, 1 before). Settings > API quickstart: no Training chip. Library, Chats and Archived in grid view: no rule under the date headings (computed Audio > Transcribe: the button matches Generate (44px tall, up from 34px). Images: the empty output panel uses the Images tab icon. Chat dictation: 48 rounded bars instead of 84 stretched dots, a fading left edge and a red recording dot. This was driven by Chromium's fake microphone tone, not real speech. |
Codex Review SummaryThis 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. |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…re address padding while typing
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…, or all pages) (#16297) ## Summary Adds a **Show on** choice to Settings > Appearance > Background image, so the background can be limited to the new chat page or shown everywhere: | Show on | New chat page | Open conversation | Other pages (Library, Hub, ...) | |---|---|---|---| | New chat page | yes | no | no | | Chats (default) | yes | yes | no | | All pages | yes | yes | yes | - "Chats" is today's behaviour and stays the default, so nobody's background changes on update. Saved backgrounds without the field load as "Chats". - With "New chat page", the background goes away as soon as the chat has messages. The new chat welcome marks itself on screen (`useMarkChatWelcome`), and the app-level mount only shows the wallpaper while it is. - The settings preview follows the choice: the Conversation preview shows no background on "New chat page". - "All pages" uses the existing non-chat wallpaper styles that `BACKGROUND_ON_ALL_PAGES` used to gate behind a constant; the constant is gone. - Labels in every locale. Stacked on #16287 (the background fit, position and outline changes), which this builds on. ## Verification - `npm run typecheck`, `npm run i18n:check:strict`, `npm test`, `npm run build` - `tests/chat-background.test.ts` covers the scope default and repair of bad stored values. - In a local Studio build: checked the wallpaper on a new chat, an open conversation and the Library for each of the three choices (9 combinations, all as in the table).
…n the greeting is off (#16301) ## Summary - **Show greeting** moves from Settings > Chat to Settings > Appearance, next to "Composer at the bottom". Same setting, so the saved choice carries over, and settings search finds it under Appearance. - With the greeting off, the centred new chat composer no longer jumps up by the greeting's height. The greeting's row and gap become top padding, so the composer stays where it sits with the greeting on. Composer-at-bottom, the files layout, the expanded writing view and incognito (which always shows its title) are unchanged. Stacked on #16287, which moves "Composer at the bottom" to Appearance. ## Verification - `npm run typecheck`, `npm test`, `npm run build` - In a local Studio build at 1440x900, the composer's top edge is 376px with the greeting on and 376px with it off (it was about 80px higher before).
## What
Appearance settings can now be exported as a theme file and imported
back, so people can share a look or try one someone else made. It lives
in Settings > Appearance under "Theme file", below Code.
- **Export** writes `<name>.unsloth-theme.json`: color theme, light and
dark colors, contrast, element outline, fonts and sizes, code display,
chat width, composer outline and glass (including where it shows).
Sidebar layout, and imported fonts plus the background image, are opt-in
switches.
- **Import** opens a preview before anything changes: the name, light
and dark swatches, what will change, and any warnings (unknown keys,
invalid or out-of-range values, an unknown color theme, a file from a
newer Studio). Apply shows a toast with **Undo**, which puts back the
previous look.
- Personal settings never leave the device and are never overwritten,
Undo included: light/dark/system mode, interface scale, reduce motion
and pointer cursors.
## File format
```jsonc
{
"kind": "unsloth-studio.appearance",
"schemaVersion": 1,
"name": "Midnight Matcha",
"palette": "matcha",
"look": { "colors": {...}, "contrast": 62, "uiFont": "Lato", "chatWidth": "wide", ... },
"glass": { "material": "frosted", "strength": { "light": 40, "dark": 15 }, "lens": "off", "menus": true, "scope": "all" },
"layout": {...}, // opt-in
"fonts": [...], // opt-in
"background": {...} // opt-in
}
```
`look` and `layout` use the customization field names directly. One
table, `FIELD_GROUP` in `appearance-theme/theme-file.ts`, says where
every `AppearanceCustomization` field goes (look, layout, fonts or
personal), and the typecheck fails if a new field has no entry. Applying
a theme first resets every look setting to its default, so the same file
always gives the same look; an older file just gets defaults for
settings added later, and a newer one is applied best-effort with a
warning.
## Untrusted input
- `JSON.parse` only, a 256 KB cap (8 MB when the file carries fonts or a
background) checked before the file is read, and at most 50 warnings
("And N more").
- Fields are read through own-property checks, so `__proto__` keys are
never followed, and every value goes through the existing
`sanitizeCustomization`, glass and background sanitizers.
- Embedded fonts must load through `FontFace.load()`, as in the font
picker, or they are dropped with a warning. Font names match
case-insensitively, as in CSS, and a theme never pushes a selected font
out of the 3-font limit.
- The background must be a PNG, JPEG or WebP base64 data URL and is
decoded and re-encoded through the normal upload path
(`uploadBackgroundImage`). No raw CSS, no URLs fetched.
## Also fixed
The sidebar menu's Appearance item defaults to visible in the frontend
since #16287, but the backend default (`SIDEBAR_MENU_ITEM_DEFAULTS`)
still said hidden, so a GET filled it in as hidden for records missing
it. It now says visible, and `sidebar-nav-backend-parity.test.ts` keeps
the two in sync.
## Verification
- `tests/appearance-theme-file.test.ts`: round trip, personal fields,
hostile input, case-variant and capped fonts, local fonts, layout
opt-in, unloadable fonts, Undo keeping personal settings.
- Frontend node suite, `npm run typecheck`, eslint on touched files,
`npm run i18n:check:strict`, and backend
`test_personalization_settings.py` pass.
## Before / after on two real installs
Two `install.sh --local` Studios, main and this branch, driven in
Chromium. The import file had a newer `schemaVersion`, an unknown key
and an out-of-range UI font size.
Settings > Appearance: the new Theme file section.

Import preview: swatches, the change groups and the three warnings.

After Apply: Matcha, contrast 64, element outline 40, UI font size
clamped to 20, with the Undo toast. Undo then put every value back.

---------
Co-authored-by: LeoBorcherding <[email protected]>
Co-authored-by: Daniel Han <[email protected]>










Summary
A batch of Studio settings and polish fixes.
Settings
SettingsSectiongained an optionalbadgebeside its heading for this.@hugeicons/core-free-icons4.1.1 has an older one, so the 4.4.0 drawing is copied intolib/hugeicons-derived.ts, as other newer icons already are.Background image
--borderline. A saved "off" becomes 0 and a saved "on" becomes the new default.Library
Audio
Chat dictation
Images
Verification
npm run typecheck,npm run i18n:check:strict,npm test(14,523 pass),npm run build,npm run bundle:checktests/chat-background.test.tscovers the outline migration (booleans to 0 / default, clamping), custom positions and the new sizing values.tests/training-api-snippets.test.tschecks that the Training chip shows only when the Train page asks for it.Not testable here