Skip to content

Studio: stop docked composer from squeezing download panel - #9334

Merged
wasimysaid merged 5 commits into
unslothai:mainfrom
oobabooga:worktree-download-progress-clip
Aug 20, 2026
Merged

wasimysaid merged 5 commits into
unslothai:mainfrom
oobabooga:worktree-download-progress-clip

Conversation

@oobabooga

@oobabooga oobabooga commented Aug 20, 2026 •

Copy link
Copy Markdown
Member

Problem

Starting a model download from a chat thread can render the download panel only 5px tall. The download continues and its progress values are correct, but the UI appears as a hairline across the "LLMs can make mistakes" note.

BeforeAfter
before-corner after-corner

The overlay rail decides whether it can fit below the coverable chat composer by comparing the available band with the rail's measured floor. Its squeeze probe sets max-height: 0 and reads scrollHeight, but the rail's min-h-0 flex cards collapse to their borders. During a live download, a 121px panel therefore reported a 2px floor.

The published composer form leaves a 5.47px band above the footnote. Because that band appeared larger than the 2px floor, the rail stayed in the corner and accepted a 5.47px cap, clipping the panel almost completely.

Fix

Floor the rail card by card rather than as one number:

const MIN_CARD_ROOM = 128;

function cardFloorRoom(squeezed: number, natural: number): number {
  return Math.max(squeezed, Math.min(natural, MIN_CARD_ROOM));
}

export function usableFloorRoom(
  cards: readonly { squeezed: number; natural: number }[],
  natural: number,
): number {
  const floor = cards.reduce(
    (total, card) => total + cardFloorRoom(card.squeezed, card.natural),
    STACK_GAP * Math.max(0, cards.length - 1),
  );
  return Math.min(Math.round(floor), natural);
}

Each card keeps enough room for the download header and one row, a card shorter than that is asked for what it has, and a card with a larger minimum of its own still wins. The sum is bounded by the rail's natural height.

Per card and not over the sum, because a rail floored as one number is answered by whichever card carries a min-height. The app update card's is 189px at the default font scale, which clears 128 on its own while the min-h-0 download panel next to it still measures its borders. That leaves the same hairline on the welcome screen at 1366x640, where the composer's band is 200px: the rail took the corner at a 200px cap, the banner held its own minimum, and the panel came back as an 8px strip with 7px of its 41px header showing and no scrollbar to reach it by.

Two things the per-card reading needs that the aggregate one did not.

cardHeight reads offsetHeight, not a bounding rect, for the reason use-panel-anchor.ts already has it. The update cards animate in from scale: 0.96 and a rect is measured through that transform: 176.64 against a layout 184 at 1366x640, still 193.71 against 196 at the last reflow. A finished transform resizes nothing, so no observer comes back with the settled figure and the short reading is the floor the placement keeps. It also matches scrollHeight, the total the sum is clamped against.

inRailFlow drops fixed and absolute children. Dragged, the loaded models card pins itself position: fixed and leaves the rail's flow; scrollHeight drops it, so a floor that still counted it asked for 225px where 128 was needed and lifted the rail off a corner it fitted in. The persistentTail walk had the same fault, counting a card that lands on nothing as part of the run guarding the composer, and now uses the same list.

overflowing moves off floorRoom and onto the height the cards actually collapse to. The floor is now larger than that wherever a card would rather be clipped than shrink, and a clipped card is not a fold to scroll to: reading the floor there would give the rail pointer-events-auto, and with it the clicks crossing its gutter, for a scrollbar it does not have.

The docked composer is still cleared instead of accepting its 5px strip. The behavior added in #8462 is preserved: a welcome-screen band that holds one usable card keeps the rail in the corner, and longer lists scroll there.

Verification

Layout Window Before After
Chat thread 1280x800 bottom 16, cap 5.47 bottom 149, cap 635
Chat thread 1280x520 bottom 16, cap 5.47 bottom 149, cap 355
Welcome + update card 1366x640 cap 200, panel 8px cap 608, panel 120.77px
Welcome, models card dragged out 1366x640 bottom 344, cap 280 bottom 16, cap 200
Welcome 1280x800 Whole card in corner Unchanged
Welcome, 3 jobs 1280x800 241px card in corner Unchanged
  • node --test tests/monitor-stack-inset.test.ts: 66 passed, including the banner-plus-panel floor, the 1366x640 placement, the layout-box reading and the dragged card
  • node --test tests/update-banner-flex-priority.test.ts: 15 passed
  • npm run typecheck
  • npm run build
  • ESLint and Biome checks on the changed files
  • npm test: 13 failures, all in context-window-visible.test.ts and thread-scoped-sampling-simulation.test.ts, reproduced on the PR's own base
  • Live Chromium against a running Studio: the docked layout at 1280x800, 1280x520 and 1366x640, and the welcome layout at 1366x640, 1024x640 and 1280x800, each with and without the app update card
  • The 26 viewports tests/studio/playwright_update_banner_layout.py sweeps, welcome and docked, with and without a download: the rail takes pointer input exactly when it scrolls in all of them, and 3 to 5 of them do scroll
  • Its composer-clearance check at its own viewports (921x534, 768x500) plus 1366x640, 1024x640 and 1280x800, with the loaded models card up: tailOverlap is 0 in all of them

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 8d2462ab41

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

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@oobabooga

Copy link
Copy Markdown
Member Author

@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: 0ba7c06c70

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

Comment on lines +539 to +540
const cards = [...node.children].filter(inRailFlow);
const grown = cards.map(cardHeight);

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 Re-measure when a card leaves the rail flow

When the loaded-models card is dragged while the remaining download content still keeps the rail at its cap, changing the wrapper to position: fixed does not necessarily change any observed height, and the MutationObserver below watches only childList, not class/style attributes. Consequently measure() may never rerun, leaving floorRoom, neededRoom, and persistentTail computed with the now-fixed card despite this filter. Fresh evidence in this revision is that the new filter is evaluated only inside that untriggered measurement callback; observe the direct children's flow-affecting attribute changes or explicitly request a measurement when dragging begins.

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.

I could not reproduce this one, and I think the premise does not hold: leaving the flow always changes a box the ResizeObserver is watching.

The card's wrapper is flex min-h-0 justify-end, so it is shrinkable, and the rail's height is min(content, cap). That leaves two cases and no third:

  • the rail is over its cap, so the deficit was distributed and the shrinkable card is carrying some of it. Going fixed, it stops being a flex item and takes its own box, so its height changes.
  • the rail is under its cap, so its height is its content. Removing the card's height plus a gap changes the rail's own box.

Measured at 1366x640 with the observer armed on the rail and its children, driving a real drag. Every row fired, and every post-drag placement is the one the remaining in-flow content warrants:

rail contents card before drag events on drag placement
1 download 89 (unshrunk) card 89.05, RAIL 217.81 -> 120.77 344/280 -> 16/200
3 downloads 66 (shrunk) card 89.05, RAIL 280 -> 200 344/280 -> 16/200
5 downloads 47 (shrunk) card 89.05, RAIL 280 -> 200 344/280 -> 16/200
llama banner 89 (unshrunk) card 89.05, RAIL 236.3 -> 139.25 344/280 -> 16/200
llama banner + 1 download 53 (shrunk) card 89.05, panel 71.8 -> 120.77 344/280 unchanged
llama banner + 5 downloads 22 (shrunk) card 89.05, panel 103.22 -> 132.75 344/280 unchanged

The last two are unchanged because 344/280 is the right answer both times, not because the measurement was skipped: with the card gone the in-flow floor is still 268 and 275 against a 200px band, so the rail stays lifted. The events show the measurement ran.

You are right that the MutationObserver watches only childList. It does not have to carry this: the ResizeObserver watches the rail and every descendant and filters on height, and the height it needs is always one of the two above.

Rejecting, but if you have a configuration where both the wrapper and the rail keep their heights across the drag, I will take it.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 20, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 20, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 20, 2026
@oobabooga

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 0ba7c06c70

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

@wasimysaid

Copy link
Copy Markdown
Collaborator

Review + GitHub Actions UI evidence

Pinned review: 0ba7c06c703c17516ec6b1f99125e9c0a6fae5d5 — no blocking code findings.

I reproduced the real Studio flow in Chromium at 1366×640 on fresh upstream main. The two fork branches used the same harness and differ only in studio/frontend/src/features/settings/stores/monitor-frame-store.ts:

  • Fix reverted — expected-failing run: panel visible 8px, header 7px, row 0px, Cancel hidden; the download card is reduced to a hairline.
  • PR head — passing run: panel visible 120.77px, full 41px header + 77.77px row, Cancel visible.

PR 9334 GitHub Actions before/after

Conclusion: the clipping issue and its fix are verified; I found no new blocker. The inspected upstream Backend/Frontend reds are stale-base failures whose fixes are already on current main but absent from this PR head, so a rebase is still needed for green upstream checks.

@wasimysaid
wasimysaid merged commit 4c5423a into unslothai:main Aug 20, 2026
27 of 31 checks passed
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