Skip to content

Studio: keep the composer one row tall inside a conversation - #18447

Merged
shimmyshimmer merged 2 commits into
mainfrom
studio-composer-one-line
Nov 19, 2026
Merged

shimmyshimmer merged 2 commits into
mainfrom
studio-composer-one-line

Conversation

@shimmyshimmer

Copy link
Copy Markdown
Member

Studio: keep the composer one row tall inside a conversation

#18074 raised the empty composer from one row to two (COMPOSER_MIN_ROWS = 2, a 64px editor instead of 40px) so a new chat has room to start typing. Inside a conversation that extra row only pushed the messages up and made the docked composer read as a large empty box.

Now the empty editor reserves two rows only on the new chat screen (thread.isEmpty) and one row once a conversation exists. Typing still grows the box the same way, up to the window-based row limit from #18074.

  • components/assistant-ui/thread.tsx: the min editor height is (16 + 24 * (threadEmpty ? COMPOSER_MIN_ROWS : 1)) * uiSpaceScale.
  • tests/ui-font-size-scales-spacing.test.ts: pins the one-row rule for the main composer; Compare's shared composer keeps two rows.

Verification

  • npm run typecheck and npm test (16735 passed, 0 failed) on a branch that included this change.
  • In a local Studio with gemma-3-270m loaded: after one message, the composer's editor measured 40px; on a new chat it measured 64px.

Not covered

  • Compare (features/chat/shared-composer.tsx) is unchanged and still reserves two rows.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T09:50:39.214949Z d244a56 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

Copy link
Copy Markdown

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

Reviewed commit: d244a5618f

ℹ️ 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 pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Nov 19, 2026
@shimmyshimmer
shimmyshimmer merged commit 848a676 into main Nov 19, 2026
@shimmyshimmer
shimmyshimmer deleted the studio-composer-one-line branch November 19, 2026 11:21
danielhanchen added a commit that referenced this pull request Nov 19, 2026
…oser eases (#18493)

## Summary

The long-chat gate in Frontend CI
(`tests/studio/playwright_thread_window.py`, run by "Frontend build +
bundle sanity") fails intermittently on `main`:

```
AssertionError: the thread opened 6px above its end
```

It failed on the staging `upstream-main` Frontend CI run and 2 of 3
local runs on `main`. A user sees the same thing: opening a long
conversation can land a few pixels above its last message, with the
"scroll to bottom" arrow showing.

## Root cause

Bisected to #18447 ("keep the composer one row tall inside a
conversation"). The check passed 3 of 3 on its parent and failed on it.

#18447 is right to give the new-chat screen a two-row floor and a
conversation a one-row floor. The side effect is in `Thread`'s
composer-height effect. Any growth of the composer calls
`detachFromBottom()` ("as if the user scrolled up"), which is meant for
a draft that grows while typing. The editor eases its height over 280ms,
so when a conversation opens while the empty composer is still easing up
to the new-chat floor, a late growth frame (120px to 126px in the
traces) lands after the thread is seeded. That detaches the freshly
opened conversation, and the spacer shrink that follows is deferred
because the thread is no longer at its end. The thread rests 4 to 9px
above its last message.

## Changes

- `components/assistant-ui/thread.tsx`: composer growth detaches the
thread only while the composer holds a draft (text or attachments) and
no run is active. An empty composer only grows as its row floor eases,
which is not the user reading back, so it no longer strands a
conversation above its end. Growth from typing a multi-line draft
detaches exactly as before.

No change to the composer's sizes or animation, or to #18447's floors.

## Testing

| | `main` | this branch |
|---|---|---|
| Full `playwright_thread_window.py` | 2 of 3 failed | 3 of 3 passed |
| Scripted opens of the 400-message thread ending more than 2px above
the end | 8 of 18 | 0 of 18 (all at 1 to 2px) |

- `npm run typecheck`: passes.
- The guard is the existing CI check; it fails on `main` and passes
here.

## Screenshot

The same 400-message thread opened in the long-chat test page
(`smoke-thread-weight.html`, what CI drives). Before, on `main`, it
opened 4px above its end and shows the scroll-to-bottom arrow; after, it
opens at its end.

![Before and after: a long conversation opened in the thread test
page](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/18493/pr_thread_open_before_after-783dd0c23cfb.png)
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