Skip to content

Studio: draw chat markdown tables inline with hover controls and a centered expand dialog - #13973

Merged
shimmyshimmer merged 6 commits into
mainfrom
studio-chat-table-style
Oct 16, 2026
Merged

shimmyshimmer merged 6 commits into
mainfrom
studio-chat-table-style

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

What changed

Markdown tables across Studio (chat replies and thinking, Model Hub READMEs, markdown file and attachment previews, saved prompts, the composer draft preview) no longer sit in a card with an empty toolbar row and a second bordered box inside it. They now render inline in the message flow:

  • No outer card, border or background. A semibold header with one rule under it, thin dividers between rows, no vertical lines, and roomier row padding. Cells use the message font size (they were text-sm before) and long cells wrap.

  • Alignment markers (---:, :---) still apply, so number columns stay right-aligned.

  • Copy, download (CSV / Markdown) and expand show up only on hover or keyboard focus, as small icon buttons over the right end of the header. They stay visible while a copy or download menu is open, and are always shown on touch screens (hover: none).

  • Expand opens a centered rounded panel over a backdrop dimmed to 70% (the Desktop titlebar dims to match), using the same table styling, with a round close button in the top-right corner of the window. Escape, the close button or a click on the backdrop closes it. Before, it opened as a full-window page with a bordered grid.

  • Wide tables scroll horizontally inside the message column. Cells have an 8rem minimum width, so a table with many columns scrolls instead of squeezing every word onto its own line.

  • A wide table fades out on whichever edge still hides columns (the right at first, both mid-scroll, the left at the end), and shows a classic scrollbar under it from the start, so it reads as scrollable before it is touched. The fade stops above the scrollbar. The same applies inside the expand dialog.

  • Icon buttons in chat messages (code block copy and download, the table controls, an image's download button and the diagram controls) now show a round hover fill instead of a rounded square, matching the message action bar.

  • Outside chat the same table is used: the Hub README and interactive markdown previews get the hover controls and expand dialog; previews nested inside another control (inert or plain previews, attachment thumbnails, the composer draft) get the table without controls. The hover controls paint whatever surface is behind them (chat page, browser panel, dialog), so they blend in everywhere. The cell width floor shrinks with the container, so a 5-column table still fits a narrow side panel.

Implementation: markdown-table.tsx provides MarkdownTable and StaticMarkdownTable, registered as the table component in the chat renderer, model-readme.tsx, markdown-preview.tsx and composer-draft-preview.tsx. It reuses Streamdown's exported TableCopyDropdown / TableDownloadDropdown (they find the table through data-streamdown="table-wrapper", which the wrapper keeps) and the app Dialog. The old wrapper CSS in index.css is replaced, and the code block styling is untouched.

Verification

  • npm run typecheck, npm test (12478 pass), npm run build, npm run i18n:check; biome check is clean on the new file.
  • Isolated Studio (own home and port), driven by Playwright: seeded a reply with an aligned 3-column table, a 1-row table, a 12-column table and a bash block, in light and dark.
    • Table wrappers have no border or background, th alignment is right / left / right as written, cell font matches the paragraph (14.53px), the wrapper fits the column exactly (408 to 1152 px, same as the composer), the wide table scrolls inside the column, its fade flags read right only at rest, both mid-scroll and left only at the end, and the scrollbar is 12 px, and the thread viewport has no horizontal overflow.
    • The code block and table icon buttons measure 32 x 32 with a fully round hover fill.
    • Glyph centering: at the default size a 15px glyph in a 32px button sits on a half pixel and painted 0.5px right of its circle. These buttons now round the glyph to an even size (16px at the default), and its ink centroid measures within 0.1px of the circle's centre at 1x, 2x and 3x scale (the download arrow's centroid sits low by the shape itself).
    • Hover shows the controls. Copy as Markdown puts the table on the clipboard, Download as CSV saves table.csv with the table's rows, and Expand opens the dialog, which closes on Escape and on a backdrop click.

Screenshots, BEFORE (left) and AFTER (right), from two builds served by the same isolated Studio:

Dark, whole reply: the card, toolbar row and inner border are gone; the bash block is unchanged.
dark message

Dark, hovering the first table: the controls float over the header's right end instead of sitting in their own row.
dark hover

Wide table (AFTER only; Chromium with classic scrollbars): faded right edge and scrollbar at rest, both edges faded mid-scroll, and the expand dialog.
wide at rest
wide mid-scroll
wide expanded

Dark, expanded: a centered panel over a darker backdrop, with a round close button, instead of a full-window grid.
dark expanded

Model Hub README (unsloth/gemma-3-4b-it-GGUF), BEFORE and AFTER on hover:
hub readme

A markdown attachment opened in the side panel, BEFORE and AFTER (all five columns still fit):
file panel

Light, whole reply and expanded:
light message
light expanded

Not tested here

  • A live streaming reply (CPU host, seeded messages only). The controls use Streamdown's isAnimating the same way the old toolbar did, so they are disabled until the reply finishes.
  • Desktop (Tauri) window chrome offsets for the dialog. It uses the same --studio-window-chrome-top variable as the media viewer.

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 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 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 pushed 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:53:23.787050Z b7f793e 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: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ 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

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: b7f793e9de

ℹ️ 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 Oct 16, 2026
shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 16, 2026
shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 16, 2026
@shimmyshimmer
shimmyshimmer merged commit ce83dee into main Oct 16, 2026
@shimmyshimmer
shimmyshimmer deleted the studio-chat-table-style branch October 16, 2026 08:48
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.
danielhanchen added a commit that referenced this pull request Oct 16, 2026
#13996)

## Summary

`Repo tests (CPU, studio)` fails on main since #13973:

```
tests/studio/test_ui_font_scale_contract.py::test_css_font_sizes_reference_the_scale
E   AssertionError: CSS typography must multiply by var(--ui-font-scale, 1) or be allowlisted here with a reason: ['index.css: font-size: 1rem;']
```

#13973 gave the expanded markdown table dialog `font-size: 1rem`.
Studio's UI font size setting reaches text only through
`--ui-font-scale` and never through the root font size. A bare `1rem`
therefore pins that dialog at 16 px whatever the user picked, while the
same table inline in the chat follows the setting. The contract test is
right, so the CSS is what changes.

## Change

`.aui-md-table-dialog` now uses `calc(1rem * var(--ui-font-scale, 1))`,
like the other scaled rules in `index.css`. At the default UI font size
this renders at 15 px instead of 16 px, matching the chat around it.
With a larger UI font size, the expanded table now grows with it.

## Testing

- `tests/studio/test_ui_font_scale_contract.py`: 12 passed. It fails on
main with the error above.
- Before/after Studio builds (base 1574001 vs this branch), same
scripted reply, UI font size set to 1.25x, the table expanded with View
fullscreen. Computed font size of the dialog: 16 px -> 20 px (cells
too). The inline table text was already scaled on both builds. Before,
the expanded table reads smaller than the table behind it; after, it
matches.

![Expanded markdown table at 1.25x UI font size, before and
after](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/13996/pr13996_md_table_dialog-1b00733775b4.png)
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 17, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 17, 2026
shimmyshimmer added a commit that referenced this pull request Oct 17, 2026
… and the composer draft (#14087)

## What changed

Follow-up to #13973. Markdown tables outside chat now use the same
inline style as chat replies: no card or inner border, a semibold header
with one rule under it, thin row dividers, cells that wrap, and
alignment markers respected.

- **With hover controls (copy, download as CSV or Markdown, expand):**
Model Hub model and dataset READMEs (they had no table controls before),
and interactive markdown previews: markdown files and attachments opened
in the side panel or the document viewer, Library previews, saved
prompts and research reports.
- **Same table, no controls:** previews nested inside another control
(inert and plain previews, attachment thumbnails) and the composer draft
preview.
- The hover controls cover the end of the header, so they paint whatever
surface is behind the table (chat page, browser panel, Hub, dialog)
instead of assuming the chat background. On the lighter side panel the
old fill showed as a dark box.
- The cell width floor is `min(8rem, 15cqi)`: wide tables in chat still
scroll with the edge fade, while a five-column table still fits a narrow
side panel instead of pushing its last column off-screen. Cells wrap at
word boundaries even inside previews that set `overflow-wrap: anywhere`.

Implementation: `markdown-table.tsx` now also exports
`StaticMarkdownTable` and the shared Streamdown icon map, registered as
the `table` component in `model-readme.tsx`, `markdown-preview.tsx` and
`composer-draft-preview.tsx`. The README's own `th` / `td` prose classes
are dropped in favour of the shared ones (its smaller table text size is
kept).

## Verification

- `npm run typecheck`, `npm test` (12537 pass), `npm run build`, `npm
run i18n:check`.
- Isolated Studio built from this branch, BEFORE served from the merge
base:
- Hub README of `unsloth/gemma-3-4b-it-GGUF`: table wrapped inline,
controls on hover, expand opens the dialog.
- A `.md` attachment opened in the side panel: all five columns fit,
hover controls blend with the panel surface; the composer thumbnail
renders the table without controls.
- Chat tables re-checked: no horizontal overflow of the thread, wide
table scrolls with the fade.

Model Hub README, BEFORE (merge base) and AFTER on hover:
![hub
readme](https://raw.githubusercontent.com/shimmyshimmer/unsloth-staging-4/pr-media/pr/14087/pr14087_hub_readme_before_after-291142e24bb8.png)

A markdown attachment in the side panel, BEFORE and AFTER:
![file
panel](https://raw.githubusercontent.com/shimmyshimmer/unsloth-staging-4/pr-media/pr/14087/pr14087_file_panel_before_after-c2a7e214cac6.png)

## Not tested here

- Saved prompts, Library, research reports, release notes and the
composer draft preview were not opened in a browser; they render through
the same `MarkdownPreview` / Streamdown paths exercised above.
- Desktop (Tauri) builds.
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