Repository navigation
Studio: draw chat markdown tables inline with hover controls and a centered expand dialog - #13973
Conversation
…ntered expand dialog
…rollbar, darken its expand backdrop
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…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.
#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. 
… 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:  A markdown attachment in the side panel, BEFORE and AFTER:  ## 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.
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-smbefore) 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.tsxprovidesMarkdownTableandStaticMarkdownTable, registered as thetablecomponent in the chat renderer,model-readme.tsx,markdown-preview.tsxandcomposer-draft-preview.tsx. It reuses Streamdown's exportedTableCopyDropdown/TableDownloadDropdown(they find the table throughdata-streamdown="table-wrapper", which the wrapper keeps) and the appDialog. The old wrapper CSS inindex.cssis replaced, and the code block styling is untouched.Verification
npm run typecheck,npm test(12478 pass),npm run build,npm run i18n:check;biome checkis clean on the new file.thalignment 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.table.csvwith 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, hovering the first table: the controls float over the header's right end instead of sitting in their own row.

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



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

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

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

Light, whole reply and expanded:


Not tested here
isAnimatingthe same way the old toolbar did, so they are disabled until the reply finishes.--studio-window-chrome-topvariable as the media viewer.