Skip to content

Studio: add configurable chat width - #10958

Merged
mahiatlinux merged 8 commits into
unslothai:mainfrom
shimmyshimmer:feat/studio-chat-width
Sep 15, 2026
Merged

mahiatlinux merged 8 commits into
unslothai:mainfrom
shimmyshimmer:feat/studio-chat-width

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Chat messages and the composer have fixed width limits, leaving large unused margins on wide screens even when sidebars are closed. Add Settings > Appearance > Preferences > Chat width with three options:

  • Standard: keep the existing layout.
  • Wide: increase the maximum width to 72rem.
  • Full width: use the available chat pane width with small margins.

The setting applies to messages, message editing, and the composer, including comparison panes. It uses the existing appearance persistence and reset behavior, falls back to Standard for missing or invalid stored values, and is included in settings search. All 12 locales include the new labels.

The server reports whether chat width was explicitly stored. Older customization records preserve and upload the local width during hydration, while explicit server choices still take precedence. Writes from older clients preserve the stored width.

Validation

  • Application type check passed.
  • Four backend width migration cases, six frontend width hydration cases, and three existing locale hydration checks passed.
  • Strict translation parity and 14 frontend appearance tests passed.
  • Browser checks with the real chat components passed at 390, 768, 1280, 1920, and 2560 px, including pane resizing and reload persistence, without horizontal page or chat viewport overflow.
  • Settings UI checks passed for selection, keyboard navigation, persistence, and reset.

At 2560 px, message width increased from 744 px in Standard to 1128 px in Wide and 2485 px in Full width. Reducing the pane by 600 px reduced Full width by the same amount.

Targeted lint still reports the existing react-hooks/set-state-in-effect error in the unchanged FontSizeInput function.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 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-09-15T06:08:48.040979Z 9c42c2e 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[bot]

This comment was marked as resolved.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 825c6105ed

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

A fixed 72rem collapses onto Full once the pane is narrower than about
1150px, and the two presets then render the same width. At 1000px both gave
1000, and at 900px both gave 900, so on a laptop two of the three options
were indistinguishable.

Make Wide half the room between Standard and the pane, so the presets stay
distinct wherever there is room to give:

  pane     standard  wide  full
  2560px        768  1664  2560
  1280px        768  1024  1280
  1000px        768   884  1000
   900px        768   834   900

It also pulls the far end back: Wide at 2560px was already clamped to 1152,
which is barely past Standard on a display that size.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

One thing worth changing before this lands: the Wide preset is a fixed 72rem, which collapses onto Full once the pane is narrower than about 1150px. Measured against a build of this branch:

pane Standard Wide Full
2560px 768 1152 2560
1280px 768 1152 1280
1000px 768 1000 1000
900px 768 900 900

At 1000px and below, Wide and Full are the same control, so on a laptop two of the three options do nothing different from each other. At the other end, Wide on a 2560px display is still clamped to 1152, barely past Standard.

Making Wide half the room between Standard and the pane keeps the three-preset UI and stays distinct wherever there is room to give:

setVar(
  "--custom-chat-max-width",
  c.chatWidth === "full"
    ? "100%"
    : c.chatWidth === "wide"
      ? "calc(48rem + (100% - 48rem) * 0.5)"
      : null,
);
pane Standard Wide Full
2560px 768 1664 2560
1280px 768 1024 1280
1000px 768 884 1000
900px 768 834 900

The percentage resolves per pane exactly like the current value, so the sidebar and compare-mode behaviour this PR already handles is unaffected.

I have this committed locally and verified on top of 825c610: npm run typecheck clean, build passed, strict i18n parity passed, and the frontend suite at 7474 passing with 0 failing. No test pins 72rem. I could not run the backend migration tests locally, though the change does not touch backend code. Happy to push it here, or leave it for you to apply.

Also closed #10960, which was a duplicate of this feature. Worth knowing why, since it is a trap for anything else touching this area: it added a chatWidth property to AppearanceCustomization too, typed number | null against this one's string union. A trial merge conflicted in only three files while the store and all 12 locales auto-merged silently into duplicate chatWidth keys in the same object literal, which typechecks at 1822 errors with nothing in the git output to flag it.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

Pushed it, so the previous comment's offer is stale: the Wide change is now on this branch as 2c3a7f8 rather than waiting on you. Everything else in that comment stands, including the verification and the note about the backend tests not having been run locally.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

Codex is right about the double application, and the numbers are worse than the estimate. Reverted my Wide change in 8090efd, so wide is back to the 72rem this PR shipped.

The composer shell at thread.tsx:2311 caps at var(--custom-chat-max-width, 46rem) while already sitting inside an element capped at the same variable: the dock child at :2146, the welcome root at :2253, and the compare wrapper in chat-page.tsx. A fixed value survives that, since min(72rem, min(72rem, pane)) is still 72rem. A percentage does not, because it resolves against each element's own containing block.

Measured on this branch:

pane wide value messages composer gap
1536px 72rem (shipped) 1152 1152 0
1536px my formula 1152 960 192
2560px my formula 1664 1216 448

A 448px gap between the composer and the messages is far worse than the problem I was trying to fix, so it goes.

Worth saying plainly that the original concern still stands: 72rem collapses onto Full below about 1150px of pane, so at 1000px both render 1000 and two of the three presets stop differing. But it cannot be fixed by swapping the value. Any cap that adapts to the pane is non-idempotent under nesting, so the cap has to be applied at exactly one boundary, with the inner shell filling it rather than recomputing it. That is a structural change to how the three composer paths are laid out, and it needs the ProjectComposer call site audited too, so it is yours to make rather than something I should bolt on here.

Sorry for the noise. The revert is verified: npm run typecheck clean and the build passes, and the shipped 72rem behaviour is restored exactly.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

Full ran to the pane edge. Give it a 3rem gap either side.

It cannot be done by narrowing the variable alone. The composer shell reads
the same one its parents are already capped by, so calc(100% - 6rem) lands as
100% - 12rem on the composer. This is the nesting Codex flagged on the earlier
Wide attempt, and it is why that one was reverted.

Give the shell its own variable, set to 100% whenever the setting is active, so
it fills whatever its parent was capped to and the cap applies once. That is a
no-op at every current width: in wide the parent is already 72rem, in full it
is already the pane, and on the projects page the parent is a fixed 44rem.

Measured at a 1536px pane:

  mode          messages  composer
  standard           744       736
  wide              1128      1152
  full before       1512      1536
  full after        1416      1440

Holds at 2560px: 2440 / 2464, not re-inset.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

Pushed e5b58c2: Full now keeps a 3rem gap either side instead of running to the pane edge.

This needed the nesting problem solved first, since narrowing the variable alone would have repeated the earlier mistake. The composer shell reads the same variable its parents are already capped by, so calc(100% - 6rem) lands as 100% - 12rem on the composer. Measured at a 2560px pane: messages 2440, composer 2368 if the shell keeps sharing the variable.

So the shell now has its own, set to 100% whenever the setting is active, and it fills whatever its parent was capped to. The cap applies exactly once.

That part is a no-op at every current width, which is the reason it is safe to do here rather than as a separate change. In wide the parent is already 72rem, in full it is already the pane, and on the projects page ProjectComposer sits inside a fixed max-w-[44rem], so 100% resolves to what the shell already rendered in each case. I checked all three ComposerAnimated call sites for exactly that.

Measured at a 1536px pane:

mode messages composer
standard 744 736
wide 1128 1152
full before 1512 1536
full after 1416 1440

Holds at 2560px (2440 / 2464) and at 900px (780 / 804), so it is not re-inset as the pane grows.

npm run typecheck is clean and the build passes. I have not run the backend suite, as before, though nothing here touches backend code.

Worth noting this also unblocks the Wide change I reverted earlier: with the shell no longer re-reading the cap, a pane-relative Wide would no longer compound. I have deliberately not re-landed it, since that is a product call about the preset rather than a fix.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

On the project composer one: the observation is correct, the suggested fix is not, so I have not applied it.

It is true that the setting does nothing on a project's landing page. ProjectComposer sits inside the max-w-[44rem] column, so it stays 704px in every mode.

But that column is not a composer wrapper. It holds the folder icon and project title, the composer, and the Chats list below it. Pointing it at the width variable moves all three. Measured at a 2560px pane:

today with the wrapper on the variable
project composer 704 2464
project header and Chats list 704 2464

So the fix as described widens the whole project landing page, which is not what a setting labelled "Set the width of messages and the composer" should do. The other option in the suggestion, moving the fixed width off the ancestor, has the same effect for the same reason.

Widening only the composer inside that column is not right either: it would render at 2464px directly above a 704px Chats list and below a 704px header.

Worth noting this is pre-existing rather than something the recent commits introduced. Before the shell variable the composer resolved to min(72rem, 44rem), and after it resolves to 100% of the same 44rem parent. 704px both ways, so e5b58c2 is neutral here.

If project landing pages should follow the setting, that is a layout decision about the whole page, and the header and chat list need to be part of it. Happy to do it if you want that, but it is a bigger change than this PR and I would rather not fold it in silently.

Separately, the other two findings on this PR are already resolved on the current head: the legacy-hydration one by your own 825c610, which adds the chatWidthSaved presence flag the comment asked for, and the double-application one by e5b58c2.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: e5b58c2973

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

@mahiatlinux

mahiatlinux commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Fixed Full width shrinking narrow chat panes in 3120f13. The inset now preserves at least the Wide preset's cap. Added tests/studio/playwright_chat_width.py; two repair commits pushed to this PR's original branch.

Follow-up 8621a42 removes the extra welcome padding. The new transition assertion fails on 3120f13 and passes in Chromium and Firefox; Wide stays 1152px on both empty and active threads.

Verification

  • Reproduced on the original head and original merge result: at a 390px viewport, Full reduced messages from 340px to 220px and the composer from 366px to 270px. The regression fails there and passes with the repair: 340px and 366px.
  • Live Studio browser checks passed in Chromium 151.0.7922.34 and Firefox 153.0 on Ubuntu 26.04 x86_64, at 390, 768, 900, 1280, 1536, 1920 and 2560px. Checked all three presets, message editing, welcome and comparison layouts, sidebar collapse, server persistence, reload and reset. No horizontal page overflow.
  • The repaired merge passed the same browser regression, including the standalone script's login and navigation flow.
  • Backend personalization: 37 passed on the original head, repaired head and original merge. Running the PR's cases against the merge base produced seven expected failures for the new width field and metadata; 30 existing cases passed.
  • Focused frontend appearance, hydration and sidebar migration checks: 32 passed. npm run typecheck, production build, strict translation parity and focused Python lint passed.

At 1920px with the sidebar open:

Preset Message width Composer width
Standard 744px 736px
Wide 1128px 1152px
Full 1470px 1494px

UI evidence

Separate production builds, app homes, databases and browser contexts. Before is merge base de1f4a743409f0c8403947d6a94144b65dc67635; after is 8621a4297566a7c1633bc81b8d99f9b28b425890. Both sides use the same saved conversation. All seven composites were opened and inspected.

Appearance setting before and after

Chat messages and composer before and after

Wide · Editing · Welcome · Comparison · Sidebar collapsed

Commands, logs, measurements, dependency versions and original images.

Upstream merge

Merged 1811677f024a88b6cbe6d36e7d3d91b27c2c0190 in 9c42c2e7f20fff81cdf3c96145526bef5821f367. CompareShell retains upstream's symmetric padding and the configurable width cap. Three task commits are now on the original branch.

The two upstream centering regression tests pass on the final commit: executed result.

The final merge tree is 17b2ec4ec1748ccba92bc049452378e191ec594e, identical to the previously executed candidate. Its type check, production build and live Chromium regression passed, including real login, all presets across seven viewport sizes and the welcome-to-active transition. At 1920px, Full measures 1460px for messages and 1484px for the composer with the symmetric gutters. The candidate patch, resolution and executed browser measurements preserve this verification.

GitHub reports the PR mergeable. The previous pre-commit mergeability error cleared; replacement CI is queued. Latest review found no major issues on final head 9c42c2e7f20fff81cdf3c96145526bef5821f367. Review convergence is complete.

@mahiatlinux

Copy link
Copy Markdown
Contributor

@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: 3120f13743

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

@mahiatlinux

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 8621a42975

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

@mahiatlinux

Copy link
Copy Markdown
Contributor

@codex review

@mahiatlinux
mahiatlinux self-requested a review September 15, 2026 06:04
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 9c42c2e7f2

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

@mahiatlinux mahiatlinux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Ready to merge, all manually checked.

@mahiatlinux
mahiatlinux merged commit f95ed71 into unslothai:main Sep 15, 2026
36 of 42 checks passed
danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Sep 15, 2026
…d on (unslothai#11001)

* Run the chat width presets in CI, and two guards main is currently red on

Three merges left main failing guards that every open PR then inherits. Lint CI's
"Workflow guard suites" step and Repo tests (CPU, studio) are red on main right
now, and six open PRs show the failure as their own.

1. unslothai#10958 added tests/studio/playwright_chat_width.py and no workflow that runs
   it. test_every_playwright_driver_is_invoked_by_ci exists for exactly that and
   says so. It could not be wired as written: it took CHAT_THREAD_ID and no CI
   step can produce a thread id, so the presets shipped with a driver that runs
   nowhere.

   The driver now seeds its own conversation through /api/chat/threads, the way
   playwright_thread_scoped_settings.py does, and CHAT_THREAD_ID stays honoured
   when set. Seeding needs no model: the messages endpoint stores whatever roles
   it is given, and an assistant-role message renders the
   .aui-assistant-message-root every assertion here measures. Verified against a
   real Studio: the seeded thread renders the bubble, and the sweep passes.

   Its sign-in also handled only the already-rotated case, so it could not have
   run against a fresh CI boot even with a thread id. Same two-branch shape as
   its siblings now.

   While making it run, one assertion that could not fail: the preset ordering is
   >=, so three presets pinned to the same width satisfy every line of it. The
   setting could stop working entirely and the driver would pass. At the widest
   viewport the three are separated by construction (48rem / 72rem /
   max(72rem, 100% - 6rem) in appearance-custom-store.ts), so that separation is
   now required. Pinning --custom-chat-max-width in a live browser: the old
   assertions pass, the new one fails with "at 2560px Wide gives message 744px,
   no more than Standard's 744px, so the preset is doing nothing".

2. unslothai#10985 added studio/nvidia_probe.py, imported by both install_llama_prebuilt.py
   and install_python_stack.py, which studio-mac-install-matrix.yml lists as
   inputs. Editing the probe did not run the matrix that depends on it. Added to
   both triggers.

3. unslothai#10988 (mine) added tests/studio/test_core_setup_zoo_revision_notice.py, which
   reads a workflow file but was not in workflow-trigger-lint's guard step, the
   only job with no paths filter. A PR editing only workflow files never
   collected it. Added.

The 1054 tests in the guard step pass, as does tests/studio (9687 passed; the two
failures there are on main already and untouched by this: an mlx import and a
PR-scoped guard).

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Tighten the comments this PR adds

Comment/docstring text only. comment_tools.py check --strict-ext
--allow-docstring-edits: 3/3 OK. The guard step's 1054 tests still pass, and the
driver still runs green end to end against a real Studio.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
danielhanchen pushed a commit that referenced this pull request Sep 15, 2026
Adds a Text encoder precision control to the Images Advanced panel (Default, FP8 storage, FP8 compute, INT8, NVFP4), sent to both download planning and loading from one snapshot. Default omits the field, so existing behaviour is unchanged.

The select is seeded from resolvedSeedKey, the mechanism the other Advanced selects already use, so the panel can no longer give two controls opposite answers after a Reapply. An edit made while a load is staging survives it; Reapply is how the user applies it.

Merged with three inherited failures, all reproduced on the merge base 66a38c7 and none caused by this PR: the startup bundle budget (5374.9 KB > 5371.1 KB, the identical number on main), and the unregistered playwright_chat_width.py from #10958, which reds both Repo tests (CPU, studio) and workflow-trigger lint.
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…d on (unslothai#11001)

* Run the chat width presets in CI, and two guards main is currently red on

Three merges left main failing guards that every open PR then inherits. Lint CI's
"Workflow guard suites" step and Repo tests (CPU, studio) are red on main right
now, and six open PRs show the failure as their own.

1. unslothai#10958 added tests/studio/playwright_chat_width.py and no workflow that runs
   it. test_every_playwright_driver_is_invoked_by_ci exists for exactly that and
   says so. It could not be wired as written: it took CHAT_THREAD_ID and no CI
   step can produce a thread id, so the presets shipped with a driver that runs
   nowhere.

   The driver now seeds its own conversation through /api/chat/threads, the way
   playwright_thread_scoped_settings.py does, and CHAT_THREAD_ID stays honoured
   when set. Seeding needs no model: the messages endpoint stores whatever roles
   it is given, and an assistant-role message renders the
   .aui-assistant-message-root every assertion here measures. Verified against a
   real Studio: the seeded thread renders the bubble, and the sweep passes.

   Its sign-in also handled only the already-rotated case, so it could not have
   run against a fresh CI boot even with a thread id. Same two-branch shape as
   its siblings now.

   While making it run, one assertion that could not fail: the preset ordering is
   >=, so three presets pinned to the same width satisfy every line of it. The
   setting could stop working entirely and the driver would pass. At the widest
   viewport the three are separated by construction (48rem / 72rem /
   max(72rem, 100% - 6rem) in appearance-custom-store.ts), so that separation is
   now required. Pinning --custom-chat-max-width in a live browser: the old
   assertions pass, the new one fails with "at 2560px Wide gives message 744px,
   no more than Standard's 744px, so the preset is doing nothing".

2. unslothai#10985 added studio/nvidia_probe.py, imported by both install_llama_prebuilt.py
   and install_python_stack.py, which studio-mac-install-matrix.yml lists as
   inputs. Editing the probe did not run the matrix that depends on it. Added to
   both triggers.

3. unslothai#10988 (mine) added tests/studio/test_core_setup_zoo_revision_notice.py, which
   reads a workflow file but was not in workflow-trigger-lint's guard step, the
   only job with no paths filter. A PR editing only workflow files never
   collected it. Added.

The 1054 tests in the guard step pass, as does tests/studio (9687 passed; the two
failures there are on main already and untouched by this: an mlx import and a
PR-scoped guard).

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Tighten the comments this PR adds

Comment/docstring text only. comment_tools.py check --strict-ext
--allow-docstring-edits: 3/3 OK. The guard step's 1054 tests still pass, and the
driver still runs green end to end against a real Studio.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
Adds a Text encoder precision control to the Images Advanced panel (Default, FP8 storage, FP8 compute, INT8, NVFP4), sent to both download planning and loading from one snapshot. Default omits the field, so existing behaviour is unchanged.

The select is seeded from resolvedSeedKey, the mechanism the other Advanced selects already use, so the panel can no longer give two controls opposite answers after a Reapply. An edit made while a load is staging survives it; Reapply is how the user applies it.

Merged with three inherited failures, all reproduced on the merge base 66a38c7 and none caused by this PR: the startup bundle budget (5374.9 KB > 5371.1 KB, the identical number on main), and the unregistered playwright_chat_width.py from unslothai#10958, which reds both Repo tests (CPU, studio) and workflow-trigger lint.
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