Skip to content

Studio: customizable new-chat greeting - #16408

Merged
shimmyshimmer merged 12 commits into
mainfrom
studio-custom-greeting
Nov 1, 2026
Merged

shimmyshimmer merged 12 commits into
mainfrom
studio-custom-greeting

Conversation

@shimmyshimmer

Copy link
Copy Markdown
Member

What changed

The Greeting switch in Settings > Appearance > Preferences is now a row of four tiles beside the Greeting title. Each tile previews that greeting using your own uploads, and the chosen mode's controls sit underneath.

  • Default: the sloth and the time-of-day lines, exactly as before.
  • Custom: your own small icon (removable, for text only) and your own words. A blank text field keeps the built-in lines.
  • Image: an uploaded image replaces the whole greeting (removable).
  • None: no greeting, same as the old switch turned off.

The composer stays exactly where it was in every mode: an image greeting grows upward from the text row's slot, and a row with no icon keeps the icon's height.

Two small wording changes nearby:

  • The Standard chat width option is now labeled Default.
  • The Background image boxes are labeled New chat preview and Conversation preview, so it is clear they preview your current settings.

Storage, sync and migration

  • showGreetingSloth is still the on/off value, so the old switch maps straight onto the tiles (off shows as None, on as Default) and older builds keep reading it. No data rewrite is needed.
  • New profile fields: greetingStyle, greetingIcon, greetingIconDataUrl, greetingText, greetingImageDataUrl. They sync through the personalization endpoint like the avatar.
  • greetingCustomSaved on GET mirrors greetingSlothSaved: a record that predates the fields keeps and re-pushes the local customization instead of resetting it to server defaults.
  • An unknown style or icon value from a newer build falls back to the default instead of failing the whole GET.

Upload safety

  • Only PNG, JPEG, WebP and GIF files under 10 MB are accepted. SVG is rejected.
  • Every upload is decoded and re-encoded through a canvas (reusing the avatar resize helper, now parameterized). Icons are capped at 128 px and about 48 KB, images at 960 px and about 240 KB.
  • The server only stores data:image/(png|jpeg|webp|gif);base64,... URLs, with length caps (96 KB icon, 512 KB image) and a 100-character text limit. The renderer drops anything else before it reaches an <img>.
  • A localStorage write that does not land (quota) is rolled back with an error instead of reporting success.

New and changed strings are translated in all 25 locales.

Verification

  • npm run typecheck, npm test and npm run build pass.
  • pytest studio/backend/tests/test_personalization_settings.py passes, with new cases for SVG and javascript: rejection, the size caps, the legacy flag and the unknown-value fallback.
  • New frontend tests cover mode resolution, sanitizing, upload validation, client limits fitting under the server caps, and legacy-record hydration.
  • Driven in a local Studio with Playwright: Default, Custom with and without an icon, Image with and without an upload, and None, each in light and dark. An SVG upload shows the error, and the server record matched local storage after each change.

Not testable here: the Desktop (Tauri/WebKit) shell. On Safari the WebP encode falls back to PNG through the existing helper.

The Greeting setting now offers Icon and text (sloth, custom icon or none, plus optional custom words), Image (replaces the whole greeting) and Off. showGreetingSloth stays the on/off value, so the old switch maps onto the new choice without a rewrite. Uploads are PNG, JPEG, WebP or GIF only, re-encoded through a canvas and size capped on client and server. New fields sync through personalization, with greetingCustomSaved for legacy records.
The Greeting row now opens a single menu: Unsloth, Custom icon, Text only, Image or Off, with the upload and greeting text for the chosen mode underneath. The sloth option is labeled Unsloth.
The Greeting row now shows four tiles (Default, Custom, Image, Off) that preview each greeting, with the chosen mode's controls under them. Default gets a Sloth icon switch; Custom holds the user's icon, removable for text only, and their words.
The tiles now sit in the row's control slot beside the Greeting title, with a thinner selected outline. The sloth switch is gone (Default is always the sloth), an empty Image tile shows a small accent-coloured landscape, and the greeting image can be removed like the icon.
…efault

The greeting's last tile reads None, its text hint now says a blank field uses the built-in greetings, and the Standard chat width is labeled Default, in all locales.
The greeting upload no longer lists file types under the button; only an upload error shows there. The Background image previews now say they show your current settings.
The None tile shows a muted stop sign instead of an empty box, and the Background image previews read "Here's how your chats will look." in all locales.
The separate caption is gone; the two boxes are labeled New chat preview and Conversation preview, in all locales.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 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-01T14:01:31.465998Z 0dfec72 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.

# Conflicts:
#	studio/frontend/src/components/assistant-ui/thread.tsx
#	studio/frontend/src/features/settings/tabs/appearance-tab.tsx
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 0dfec72f1f

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

@shimmyshimmer
shimmyshimmer merged commit 8da4ba2 into main Nov 1, 2026
@shimmyshimmer
shimmyshimmer deleted the studio-custom-greeting branch November 1, 2026 14:07
danielhanchen added a commit that referenced this pull request Nov 1, 2026
… their copy (#16431)

## Summary

`Chat UI Tests (extra)` fails on PRs based on current main (#16418,
#16421, #16413) in the chat width driver:

```
[chat-width] FAIL in step "measure the 'Standard' preset across 7 viewports" after 30.7s: TimeoutError: Locator.click: Timeout 30000ms exceeded.
  - waiting for get_by_role("option", name="Standard", exact=True)
```

#16408 (`8da4ba2f1c`, customizable new-chat greeting) renamed the chat
width option label from "Standard" to "Default"
(`settings.appearance.custom.chatWidth.standard`) in every locale. The
product change is intended. `tests/studio/playwright_chat_width.py`
clicked the option by its English text, so it waited for an option that
no longer exists.

## Change

- **`playwright_chat_width.py`:** the driver picks each preset by its
position in the open listbox, not by its copy. The component lists the
values as `["standard", "wide", "full"]`. The driver's own names for the
presets (`CHAT_WIDTH_PRESETS`) are unchanged, so the measurements and
messages read the same. I did not switch it to the `_en_catalog` reader,
because `test_en_catalog.py` pins every catalog-reading driver to the
composer workflow, and this one runs in `studio-ui-smoke.yml`.
- **New `tests/studio/test_chat_width_driver_presets.py`:** checks that
`appearance-custom-controls.tsx` still maps over `["standard", "wide",
"full"]` in that order, and that the driver has one preset per option. A
reorder or a new option then fails here instead of measuring the wrong
preset.

## Testing

- The new test, `test_en_catalog.py` and
`test_playwright_suites_run_in_ci.py`: 54 passed.
- Sabotage: with the component's order swapped to `["wide", "standard",
"full"]`, the new test fails.
- The driver itself needs a live Studio. It runs in this PR's own `Chat
UI Tests (extra)` job, and I will only merge once that is green.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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.

1 participant