Skip to content

Studio: resizable Model hub split view, smaller row kebab, centred token icon - #13966

Merged
shimmyshimmer merged 6 commits into
mainfrom
studio-hub-split-resize
Oct 16, 2026
Merged

shimmyshimmer merged 6 commits into
mainfrom
studio-hub-split-resize

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

What changed

Draggable split divider. In the Model hub split layout (Discover and On Device), you can now drag the vertical line between the model list and the detail panel to resize the two panes.

  • The list pane goes from 340 px up to whatever leaves the detail panel 480 px. The bounds are clamped in JS while you drag and again in CSS, so a saved width still fits after the window gets narrower.
  • The width is saved in localStorage under unsloth.hub.splitListWidth, next to the other Hub layout preferences (unsloth.hub.allModelsView). Both tabs share it.
  • Double-click the divider, or press Home while it has focus, to go back to the default width. The arrow keys resize it in 16 px steps. The divider is a role="separator" with aria-valuenow/min/max.
  • While you drag, the width is written directly onto the pane once per animation frame, and the page re-renders only when you let go. It reuses the app's shared drag overlay (acquireDragOverlay) for the cursor and hit testing.
  • Until you drag, nothing changes: the pane keeps its existing clamp(460px, 32%, 620px) / max-w-[44%] default. Below lg the layout stays stacked as before, and the divider is not shown.

The existing ResizablePanelGroup (react-resizable-panels) was not used here. It needs the panes inside a Group, which would change the tree between split, card and compact layouts and remount the catalog (losing scroll and state) on every layout switch. A small handle on the existing pane avoids that.

On device row kebab. On Device rows had a 32 px kebab hover background, almost the full height of the row. It is now 24 px, round, with a 14 px icon, the same as the kebab on the detail panel's variant card (gguf-download-card.tsx).

Verification

  • npm run typecheck, npm test (12475/12475), npm run build pass. biome check reports no new diagnostics in the touched files. The repo-wide baseline is unchanged.
  • Isolated Studio (own UNSLOTH_STUDIO_HOME, own port), driven with Playwright at 1440 and 1920 px wide, on both Discover and On Device:
    • Default width before and after: 460 px at 1440, 493 px at 1920 (unchanged).
    • Dragged to the minimum: 340 px. Dragged to the maximum: 620 px at 1440, 1062 px at 1920 (detail panel at 480 px). The list rows truncate names and keep the likes, downloads and age columns. The title, tag chips, download bar, stat chips and README in the detail panel wrap without overflow (scrollWidth == clientWidth on the page).
    • The width persists across reloads. Double-click resets it, and the arrow keys move it by 16 px.
    • Kebab hover background: 32x32 before, 24x24 after.

Screenshots

Discover at 1440 px, divider dragged to the minimum (left) and maximum (right):

Discover drag min and max

On Device at 1440 px, the same two extremes:

On Device drag min and max

On Device row kebab on hover, 32 px before and 24 px after:

Kebab before and after

Token indicator at the worst-case zoom and UI scale combinations, before and after:

Token icon centring

Not tested here

Touch and pen dragging (the pointer events are the same, but untested). Desktop (Tauri) webview, which should behave the same as Chromium.

Token indicator centring. The red "set a token" circle next to the transport toggle drew its shield glyph as an inline SVG on top of a CSS background. The two snap to the pixel grid separately, and the old fixed -0.5px nudge assumed one scale, so at fractional interface scales or browser zoom the glyph sat up to about 1px left of centre. The disc and the glyph are now one SVG, so they always line up. The glyph geometry is already centred in its 24-unit box, so the nudge is gone.

Measured as the glyph's ink centroid against the disc centre across browser zoom 0.67x to 2x and UI scale 0.7 to 1.3 (30 combinations): largest offset went from 1.06 to 0.26 CSS px, and the mean from 0.58 to 0.05 px horizontally. The token-set and hover states were checked in dark and light themes.

shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 16, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 16, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 16, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 16, 2026
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-10-16T06:48:14.598032Z ff2fb3b 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 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: 409c536db5

ℹ️ 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 +216 to +219
onPointerCancel={endDrag}
onLostPointerCapture={() => {
if (dragRef.current) endDrag();
}}

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 Reconcile the width when a drag is cancelled

After a drag has painted --hub-split-list-width directly onto the pane, a pointercancel or unexpected loss of pointer capture only calls endDrag; it neither commits pendingRef.current nor restores the width held in React state. In those cancellation scenarios the pane therefore remains at an unpersisted width, while subsequent keyboard input and reloads use the old value and make it jump. Restore the committed CSS variable or commit the pending width before ending the cancelled drag.

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.

Fixed in 7139d14: pointercancel and lost capture now go through the same commit path as release, so the painted width is stored.

if (event.key === "ArrowLeft" || event.key === "ArrowRight") {
event.preventDefault();
const step = event.key === "ArrowRight" ? RESIZE_STEP : -RESIZE_STEP;
onWidthChange(clamp((width ?? limits().now) + step));

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 Resize from the rendered width after viewport clamping

When a saved width exceeds the current maximum after the window narrows, CSS displays the pane at limits().max but width still contains the larger persisted value. The first arrow-key press is calculated from that hidden value and then clamped back to the same visible maximum, so it does not resize by the advertised 16 px and also overwrites the wider saved preference. Base keyboard resizing on the rendered limits().now value instead.

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.

Fixed in 7139d14: arrow keys step from the rendered width (keyboardSplitWidth), with a regression test.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: ff2fb3bed8

ℹ️ 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 cc0cb59 into main Oct 16, 2026
@shimmyshimmer
shimmyshimmer deleted the studio-hub-split-resize branch October 16, 2026 08:47
danielhanchen added a commit that referenced this pull request Oct 16, 2026
…13991)

## Summary

`Frontend build + bundle sanity` is red on main again. #13969 merged
with it red, and its run reported `over the startup budget: transfer
1995.0 KB > 1994.7 KB, raw 6633.8 KB > 6632.7 KB`. Main at 6106de9
measures 6,796,799 B raw / 2,044,202 B transfer, against limits of
6,792,425 / 2,042,777.

Measured commit by commit (one machine and build, Node 24, 95 chunks
throughout, `rm -rf dist` before each build):

| commit | raw B | transfer B |
|---|---|---|
| 1790106 (#13983, last raise from me) | 6,791,768 | 2,042,404 |
| 7d33eff (#13965) | 6,792,034 | 2,042,515 |
| cc0cb59 (#13966) | 6,792,447 | 2,042,693 |
| 7bee02d (#13969) | 6,793,737 | 2,043,138 |
| ce83dee (#13973) | 6,796,298 | 2,044,201 |
| 6106de9 (main, after #13974, #13972, #13951, #13945) | 6,796,799 |
2,044,202 |

The two largest steps:
- Inline chat markdown tables with hover controls and the expand dialog
(#13973): +2,561 B raw / +1,063 B transfer, in the eager chat chunk.
- Latest Unsloth Models ranking (#13969): +1,290 B raw / +445 B
transfer.

#13945 already raised the budget for its own 497 B.

## Change

The budget is set to the measured build plus the margin main had at
1790106 (160 B raw, 189 B transfer), with the per-commit numbers
recorded beside the limits as in the earlier raises. If #13973's expand
dialog should be lazy-loaded instead, that is a follow-up for its owner.
This only gets main and every open PR off a red that none of them
caused.

## Testing

- `npm run build && npm run bundle:check` on main with this change:
within budget (0.2 KB transfer, 0.2 KB raw to spare). Without it: over
by 4,374 B raw / 1,425 B transfer.
- `tests/bundle-budget-cli.test.ts` and
`tests/bundle-budget-closure.test.ts`: 43 passed.
- `prettier --check scripts/check-bundle-budget.ts`: clean.
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