Commit graph

64 commits

Author SHA1 Message Date
Aleksander Grygier
e8d7128fea
ui: type /cwd and other slash commands anywhere in the chat input (#33070)
* ui: type the working directory on a /cwd line in the chat input

On a desktop, choosing the working directory from the + menu or the chip
puts `/cwd <path>` above the message being written, with the caret after
the path, instead of opening a separate search field. The suggestions
follow what is typed there, Enter picks only from them, and closing the
picker gives the message back as it was.

The chat form's pickers float above the line being written, also in the
collapsed form, and fit their suggestions between a min and a max width.
A directory under home always shows from `~/`.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: find working directories by a partial name, allowing for a typo

A plain name on the /cwd line is now looked up anywhere under home, not
only among its direct children, with the nearest folders listed first.
A search that finds nothing is retried allowing for one wrong, missing,
extra or swapped character.

Assisted-by: Claude (Fable 5.2)

* ui: keep the path pickers at one width and list hidden folders last

The @ mention and /cwd pickers no longer resize with their results, and
folders that are hidden or sit inside a hidden folder rank below regular
ones unless the query itself starts with a dot.

Assisted-by: Claude (Fable 5.2)

* ui: list a relative path's own folder before its deeper namesakes

A query with a path in it (ui/lib/voi) was matched only below some other
folder, never at the top of the scope, so hidden copies were the only
results. The path is now also followed from the scope itself and listed
first.

Assisted-by: Claude (Fable 5.2)

* ui: fix the folder pickers' review findings

- Read a backslash as a path separator under a Windows home or working
  directory, in the /cwd and @ pickers.
- Leave Enter to an IME composition, and to the message when the caret is
  below the /cwd line.
- Close the /cwd line before sending, so it is not sent as text.
- Keep the highlighted folder when the deeper results arrive, and do not
  leave the deep search's failure unhandled.
- Walk the typo search nearest depth first and stop once it finds something.
- Surface the deep search's error when a relative path finds nothing.

Assisted-by: Claude (Fable 5.2)

* ui: highlight the first suggestion of every new round in the pickers

A list that renders under a resting pointer no longer counts as a hover, and the
folder picker starts each round of results on its first folder.

Assisted-by: Claude (Fable 5.2)

* ui: keep the new chat's form in place as chips appear under it

Assisted-by: Claude (Fable 5.2)

* ui: drop the command picker's icons and shorten /compact's description

Assisted-by: Claude (Fable 5.2)

* ui: always edit the system message in the chat form, without a model selector

The + menu turns the form into the system message editor whether or not the
conversation shows its system message, and the editor offers no model selector.

Assisted-by: Claude (Fable 5.2)

* ui: add /system-message and keep the form's size in system message mode

The command turns the chat form into the system message editor. The editor's
dashed edge is an inset outline in place of the card's own edge, so the card
keeps its size.

Assisted-by: Claude (Fable 5.2)

* ui: find a rooted path's name further down, and retry a failed home lookup

`@~/llama.cpp` and `/cwd ~/llama.cpp` list `~/git/llama.cpp` when home itself
holds no such name. A failed lookup of the server's home directory is no longer
kept for the session, so the working directory can show from `~/` once it works.

Assisted-by: Claude (Fable 5.2)

* ui: type slash commands anywhere in the message

A command is found at the caret, after other words or on another line, not only
at the start of the input. Picking one takes just the command out and leaves the
words around it, and /cwd stays where it was typed (the + menu writes it at the
caret), so the path no longer jumps to a line of its own above the message.

Assisted-by: Claude (Opus 5.5)

* ui: keep the words after an argless command, and track /cwd by its edits

- only /prompt and /cwd read the words after them: Enter after
  `use /m the small one` no longer picks /model and deletes the sentence
- the open /cwd picker follows its own command after an edit, never
  another /cwd the message names, and closes when its command is deleted
- a blocked send leaves the /cwd command and its picker alone
- callers of the server home share one request
- a typo-tolerant folder search whose every glob fails shows the error
- hidden folders sort last behind backslash separators too

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-26 21:25:36 +01:00
Aleksander Grygier
5d7bb89f47
ui: fix the phone model sheet's search field and reasoning row (#33144)
* ui: fix the phone model sheet's search width and reasoning row

Give the sheet's foot the lists' gutter, so the search field lines up
with the inset groups above it. Draw the reasoning effort as an inset
group like the All models row, with its levels sliding open inside it.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: give the sheet search and header values the plain text field look

The phone model sheet's search borrowed the chat form's glass surface,
gradient edge and all; it is now a plain SearchInput in the chat form's
pill shape. The header value fields drew their own transparent textarea
next to Input keys; they use the shared Textarea, so every text field has
the same background and border.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: hide the reasoning row while the phone model sheet searches

A typed search gives the sheet to its results; the reasoning row comes
back once the search is cleared.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: use a model for dictation from the phone model sheet

Holding a model that hears offers Use for dictation, as the desktop row's
microphone does, and the model chosen for it can hand the choice back to
Automatic.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: tidy the phone model sheet after review

- Keep for dictation on the model Automatic picked, instead of Use for
  dictation on a model that already transcribes it.
- Keep the reasoning row mounted while a search hides it, so its levels
  are as they were left.
- Name the Reasoning row label once for both pickers.
- Restore the stores the dictation test changes, and cover the keep case.
- Mention the dictation options on the Mobile Flows page.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-26 19:58:57 +01:00
Aleksander Grygier
0ac39e4705
ui: NVFP4 as 4-bit in Discover, model details inside Search (#33120)
* ui: show NVFP4 quants in the 4-bit row of Discover Models details

The quant regexes only knew MXFP, so NVFP4 files had no quant token,
landed in "Other" and showed their whole filename on the chip.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: show a model's details inside the search dialog

Picking a Hugging Face model in Search now keeps the dialog open and
shows the Discover details pane under the search input, below the picked
row, instead of opening the full Discover dialog. Esc, typing or picking
the row again goes back to the results.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: keep the search dialog one size, match the model details skeleton

The search dialog no longer grows when a model's details open in it. The
details skeleton follows the loaded layout: row heights, chip widths that
wrap where the real ones do, a readme title, and no leftover block under
the quant rows.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: leaner model details in the search dialog

The details shown in Search drop the "View on Hugging Face" button and
the description, through a `compact` prop on the details pane, and the
search dialog is a step wider so the metadata chips fit on one line.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-26 19:54:31 +01:00
Aleksander Grygier
fa9f928f25
ui: move the demo harness to ui/lib/demo and render videos on the Llama brand (#33125)
* ui: render demo videos in a window on a brand ground

A demo video is now rendered from the recorded frames: the app in a rounded window on a Llama brand ground, camera zooms with motion blur, captions under the window, and an optional logo card. DEMO_POLISH=0 gives the plain screencast as before.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: let demos mock llama-server and record Storybook stories

Assisted-by: Claude (Opus 5.5 Medium)

* ui: check chat search end to end against a mocked llama-server

Assisted-by: Claude (Opus 5.5 Medium)

* ui: add a skill to demo, test and document Llama Chat and Llama UI changes

Assisted-by: Claude (Opus 5.5 Medium)

* ui: describe the demo render in the README and the ui-demo skill

Assisted-by: Claude (Opus 5.5 Medium)

* ui: zoom the whole stage in demo videos, show taps on touch demos

The camera now moves over the stage, so the window comes closer with its corners and the ground round it. The render runs in a Chromium of its own at 1x. A touch device shows a fingertip tap in place of the cursor.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: make the demo camera moves shorter and snappier

Assisted-by: Claude (Opus 5.5 Medium)

* ui: fix tiled shadows when the demo camera zooms in

Each copy of the window is now laid out where the camera puts it instead of scaled with a transform: Chromium cut the scaled shadow into tiles, which left light rectangles round a zoomed window. The motion blur now spans half a frame, like a 180 degree shutter.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: draw the zoomed demo window on one canvas

The motion blur copies are drawn on one stage canvas, with the squircle corners and the shadow in 2D, instead of as one layer each: twelve large layers overran Chromium's tile memory while the camera moved, and the dropped tiles showed as light blocks round the window.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: leave phone demos unzoomed in the ui-demo skill and README

Assisted-by: Claude (Opus 5.5 Medium)

* ui: show each demo video beside its description in the PR

A test's description annotation is written to the video manifest; when the tests have one, the Demo section puts one video to a row with its title and description.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: move the demo harness to ui/lib/demo

The recorder, the render, the Demo driver, storage and the pr and docs commands are now @ggml-org/llama-demo in ui/lib/demo, for any app in the suite. It imports only Playwright's types: the app passes in its page, so it runs from source with nothing installed. Llama Chat keeps its fixtures, servers and traces command in its demo folder.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: harden the demo render and the pr command

The render cleans up after a failure and removes the part-written mp4. A page the render cannot frame records plainly instead of losing its captions, demos fail early outside Chromium, and the render's extra time is added after the demo, so a test.setTimeout() in it cannot take it away. demo:pr finds the app in the worktree from git's own prefix, a description's line breaks stay inside its table cell, zoomIn scrolls its target into view, and a quick second tap keeps its fingertip.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: teach the ui-demo skill to shape, check and publish a demo

Assisted-by: Claude (Opus 5.5 Medium)

* ui: import the demo harness as @ggml-org/llama-demo

Llama Chat adds ui/lib/demo as a local file: dependency, which npm links, and imports it by name instead of by relative path. Nothing is published; npm ci leaves a link that only the demo commands follow.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-26 17:15:39 +01:00
Jesse
436d7e81ca
DPI setting for PDF as Images - Inkling-2-Mini-BF16's work (#33061) 2026-11-26 14:57:50 +01:00
Nick Towle
a866b4ade6
ui: pass theme to toasts (#33082) 2026-11-26 14:12:27 +01:00
Aleksander Grygier
8c6418001d
ui: read the Enable MCP setting through one getter (#33067)
uiStore.isMcpEnabled and mcpStore.isFeatureEnabled read the same setting. The MCP store's getter stays, and the two callers of the UI store's use it.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-26 11:53:21 +01:00
Aleksander Grygier
074f1f3f73
ui: npx llama-chat talks to llama-server on :9931 by default (#33095)
Without --server, the CLI's config.json now points the app at
llama-server's default port on the host the page was opened from,
instead of the CLI's own address, which has no API and answered 404.
Bump @ggml-org/llama-chat and llama-chat to 0.3.1.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-26 08:52:24 +01:00
Aleksander Grygier
9c003a97ab
ui: open settings, the + menu and the model picker as sheets on phones, and manage MCP from settings (#33036)
Some checks failed
Release / windows-cuda (13.5, arm64) (push) Blocked by required conditions
Release / windows-cuda (12.4, x64) (push) Blocked by required conditions
Release / windows-cuda (13.5, x64) (push) Blocked by required conditions
Release / windows-sycl (push) Blocked by required conditions
Release / ubuntu-24-sycl (fp16, ON) (push) Blocked by required conditions
Release / ubuntu-24-sycl (fp32, OFF) (push) Blocked by required conditions
Release / ubuntu-24-rocm (10.0.0, x64, gfx908;gfx90a;gfx942;gfx950;gfx1010;gfx1011;gfx1012;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103;gfx1150;gfx1151;gfx1152;gfx1200;gfx1201) (push) Blocked by required conditions
Release / ubuntu-26-zdnn (push) Blocked by required conditions
Release / ios-xcode (push) Blocked by required conditions
Release / ui-build (push) Blocked by required conditions
Server (sanitize) / server (RelWithDebInfo, ADDRESS) (push) Waiting to run
Server (sanitize) / server (RelWithDebInfo, UNDEFINED) (push) Waiting to run
Server (self-hosted) / server-cuda (push) Waiting to run
Server (self-hosted) / server-metal (push) Waiting to run
Server (self-hosted) / server-kleidiai (push) Waiting to run
Server / ubuntu (push) Waiting to run
Server / windows (push) Waiting to run
UI (self-hosted) / E2E Tests (push) Blocked by required conditions
UI (self-hosted) / Build static output (push) Waiting to run
UI (self-hosted) / Checks (push) Blocked by required conditions
UI Storybook / Deploy to Hugging Face Spaces (push) Waiting to run
UI / Build static output (push) Waiting to run
UI / Checks (push) Blocked by required conditions
UI / Library checks (push) Waiting to run
UI / Voice checks (push) Waiting to run
UI / Harness checks (push) Waiting to run
UI / Chat-only build (push) Waiting to run
UI / E2E Tests (push) Blocked by required conditions
Check Pre-Tokenizer Hashes / pre-tokenizer-hashes (push) Has been cancelled
Python check requirements.txt / check-requirements (push) Has been cancelled
* ui: add inset lists, rounder bottom sheets and a native select to the design system

Inset lists (grouped rows with inset dividers, titles and captions) are surface utilities in llama-ui, documented in DESIGN.md and the Surfaces story. Bottom drawers get the sheet radius and rounder inset groups, switches a finger-sized variant, and SearchInput an inputClass prop.

NativeSelect is a trigger styled like the app's select that opens the OS's own picker, and useSheetPages a page stack with slide transitions for sheets.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: open settings and the add menu on phones as sheets of inset pages, and manage MCP from settings

On a phone, Settings is a full-height sheet over the sidebar: theme tiles, then a row per section that pushes the section's page, with Tools, tool groups and MCP servers as further pages. Changes apply as they are made. Selects open the OS picker, number fields are 16px so iOS does not zoom, and switches are finger-sized.

The + menu is a sheet of the same inset pages, which stays open while the file picker is up. Settings and a primary New chat button sit at the bottom of the phone sidebar, and Show less sticks to the bottom of the chat list.

Show MCP becomes Enable MCP: while it is off, no MCP server is connected and chats get no MCP tools. The servers are managed from Settings, in a dialog on the desktop and a page in the phone sheet; the sidebar entry and /mcp-servers are removed. Someone who already added a server gets Enable MCP on.

A setting can name the devices it applies to, and is listed only there. Switching sections scrolls back to the top, the system message has a placeholder, inputs offer no browser autofill, the desktop settings sidebar sits on the dialog's background, and the sidebar footer groups its rows only when it shows more than one.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: pick models on a phone from a short sheet, and list the desktop selector's models without a Local models section

On a phone, the model picker opens on a short view: the chat's model, the dictation model, loaded models, favorites and recent ones, marked In chat and Dictation. A tap switches the model; holding a row opens its menu, with More details and Unload for a loaded model. All models is a page of its own, in the same grouped rows. The reasoning effort keeps its list of levels, above the search, which is a SearchInput at the foot of the sheet in the chat form's surface.

On the desktop, the server's models are listed in their family groups without a Local models section around them. They sit in an Other models section only when favorites or loaded models are listed above them, and the section headings have no icons.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: let demos touch, hold and seed chats, and import traces through either settings section

demo.tap and demo.hold drive touch input on a phone viewport, a chats option seeds the sidebar with conversations, and trace imports find Data or Import/Export in the settings.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: release llama-ui 0.7.0 and llama-chat 0.3.0

Llama UI gains the sheet components (SheetHeader, SheetPages, InsetList and its rows) and NativeSelect; Llama Chat gains the phone sheets and Enable MCP.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-25 22:39:55 +01:00
Aleksander Grygier
eb56575095
ui: stop the streaming reply with Escape (#33051)
Assisted-by: Claude (Opus 5.5 Medium)
2026-11-25 20:02:31 +01:00
maxipesfix
5e4fda8ed0
ui: fix for a chat form update loop with large fonts and long model names (otherwise web interface gets Error 500) (#33037)
Some checks failed
Release / windows (x64, vulkan, -DGGML_VULKAN=ON, ggml-vulkan) (push) Blocked by required conditions
Release / windows-cuda (13.5, arm64) (push) Blocked by required conditions
Release / windows-cuda (12.4, x64) (push) Blocked by required conditions
Release / windows-cuda (13.5, x64) (push) Blocked by required conditions
Release / windows-sycl (push) Blocked by required conditions
Release / ubuntu-24-sycl (fp16, ON) (push) Blocked by required conditions
Release / ubuntu-24-sycl (fp32, OFF) (push) Blocked by required conditions
Release / ubuntu-24-rocm (10.0.0, x64, gfx908;gfx90a;gfx942;gfx950;gfx1010;gfx1011;gfx1012;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103;gfx1150;gfx1151;gfx1152;gfx1200;gfx1201) (push) Blocked by required conditions
Release / ios-xcode (push) Blocked by required conditions
Release / ui-build (push) Blocked by required conditions
Server (sanitize) / server (RelWithDebInfo, ADDRESS) (push) Waiting to run
Server (sanitize) / server (RelWithDebInfo, UNDEFINED) (push) Waiting to run
Server (self-hosted) / server-metal (push) Waiting to run
Server (self-hosted) / server-cuda (push) Waiting to run
Server (self-hosted) / server-kleidiai (push) Waiting to run
Server / ubuntu (push) Waiting to run
Server / windows (push) Waiting to run
UI (self-hosted) / Checks (push) Blocked by required conditions
UI (self-hosted) / E2E Tests (push) Blocked by required conditions
UI (self-hosted) / Build static output (push) Waiting to run
UI Storybook / Deploy to Hugging Face Spaces (push) Waiting to run
UI / Build static output (push) Waiting to run
UI / Checks (push) Blocked by required conditions
UI / E2E Tests (push) Blocked by required conditions
UI / Library checks (push) Waiting to run
UI / Voice checks (push) Waiting to run
UI / Harness checks (push) Waiting to run
UI / Chat-only build (push) Waiting to run
CI (webgpu) / format (push) Has been cancelled
Update Operations Documentation / update-ops-docs (push) Has been cancelled
* ready for PR

* addressing review comments
2026-11-25 15:43:01 +01:00
Aleksander Grygier
41c7a1b49d
ui: fix tool result media shown twice, uncapped and dropped after its run (#33010)
* ui: drop images of old turns from the context, read_media loads them again

When read_media is offered and the model has vision, the images of user
turns far behind leave the request. A note stays in their place with an
"attachment:" path, and read_media resolves that path from the
attachments the browser holds, with no call to the server. Without the
tool, attachments are sent as before.

The cut moves once per 4 turns, so the server keeps its cache between
moves. The chat request, the pre-encode and the compaction summary read
the same list.

Images of a tool result now get the max resolution cap that attached
images get.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: store the media of a tool result once

The tool result message was created with its extracted media, then
onAttachments appended the same extras to it again, so the trace showed
every read_media image twice. The callback had no other use and goes.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: images of tool results follow the cut of old turns

A stored tool result now sends its media to the model as the run that
called the tool did, only what the model can read, through one helper,
so the image stays in later turns and the server's cache stays valid.
Before, it left the request once the run ended, with no note to load it
again.

The cut of old turns now covers tool results too, read_media's own
included: their images leave with a note and an "attachment:" path.

Media stored twice by the earlier bug is sent, noted and shown once.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: keep attached images in the context

Takes back the cut of old turns: images of turns far behind stay in the
request, and read_media has no "attachment:" path. Each move of the cut
made the server process everything after the removed image again, which
costs far more than the tokens of the image it frees.

The fixes stay: the media of a tool result is stored once, its images
get the max resolution cap, and it goes along in later turns.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: send the media of a stored tool result in agent requests

The agent request turned a tool message with content parts into an
empty string, so a stored tool result with media reached the model
with no text and no image on later turns.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-25 14:13:26 +01:00
Aleksander Grygier
77026f6e61
ui: open the warm microphone only once the pointer rests on its button (#33033)
The record button opened the microphone as soon as the pointer entered it,
so a mouse only passing over turned the browser's recording indicator on.
It now waits until the pointer (or the focus) has rested on the button for
VOICE_WARMUP_REST_MS; moving on the button restarts the wait.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-25 13:47:52 +01:00
Aleksander Grygier
c8eda101c1
ui: add file extensions to the Vite config's local imports (#33023)
Assisted-by: Claude (Opus 5.5 Medium)
2026-11-25 13:43:04 +01:00
Aleksander Grygier
0cac1220e3
ui: time each tool group by its own loop and show the task time in the reply stats (#33030)
The tool call group's timer now times its own loop of calls, from its first
call's start to its last call's end, ticking while it runs and kept once the
reply is done. The harness records each call's id and wall-clock start and
end with its timing for this.

The reply's statistics show the whole task time next to the generation
stats, ticking while an agentic reply runs.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-25 13:16:19 +01:00
Aleksander Grygier
1ed4e77f4d
ui: search home by default in the working-directory picker and pin tool call chevrons (#33028)
* ui: search home by default in the working-directory picker

A plain query now navigates home as if typed after `~/`, and Enter on a
plain query commits that folder under home. Queries starting from a root
(`/`, `C:\`, `\\host\share`) or `~` still navigate the absolute tree.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: pin the tool call chevron and timer to the end of the row

Tool call, group, reasoning and search result headers span the full
width: the title takes the rest of the row and truncates, while the
timer and the chevron stay at the right end, so a title that changes
while it streams no longer moves them.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-25 13:14:03 +01:00
Aleksander Grygier
de30697285
ui: import conversations or settings by dropping them anywhere in the app (#32958)
* ui : add global drag-and-drop import for conversations and settings

Dropping an exported conversation (.zip, .jsonl) or settings (.json)
anywhere in the app now routes to a global importer instead of attaching
the file to a message. A state machine in use-drop-import classifies the
file, shows a review dialog (settings diff, single-conversation preview,
or bulk picker), and applies it on confirmation. The chat screen defers
import files so they are not treated as attachments.

* ui : preview settings diff before importing from Import/Export tab

The Import/Export settings tab now opens the same settings diff dialog
used by drag-and-drop (showing which values would change) before applying
an imported settings file. It reuses computeSettingsDiff from the global
drop-import hook instead of importing immediately.

* ui : fix formatting in drag-and-drop import

* ui : use SvelteMap/SvelteSet and fix eslint in drag-and-drop import

* ui : adapt drag-and-drop import to current lint rules

Assisted-by: Claude (Opus 5.5 Medium)

* ui : fix importing dropped conversations

Store a plain snapshot of the previewed conversation, since IndexedDB
cannot clone the reactive proxy, and collapse drops that carry the same
conversation more than once to its newest copy, so the selection list
no longer crashes on duplicate keys.

Assisted-by: Claude (Opus 5.5 Medium)

* ui : simplify the dropped conversation preview dialog

Drop the icon and the description from the header, and give the
preview padding and a subtler border.

Assisted-by: Claude (Opus 5.5 Medium)

* ui : set the dropped conversation preview on a recessed surface

Assisted-by: Claude (Opus 5.5 Medium)

* ui : ask to open a dropped conversation after importing it

Assisted-by: Claude (Opus 5.5 Medium)

* ui : diff dropped settings against what importing applies

Importing applies the file over the defaults, so a key the file leaves
out goes back to its default instead of showing as unset.

Assisted-by: Claude (Opus 5.5 Medium)

* ui : match the settings import preview to the conversation preview

Assisted-by: Claude (Opus 5.5 Medium)

* ui : set the drop import text through type roles

Assisted-by: Claude (Opus 5.5 Medium)

* ui : attach dropped files on the chat unless they are exports

The chat now reads each dropped .json, .jsonl or .zip and hands only real
Llama Chat exports to the importer, through a drop-import context set by the
layout; everything else is attached as on master, mixed drops included. Its
drag events no longer bubble to the document, so the import overlay no
longer shows over the chat or stays up after an attachment drop.

Assisted-by: Claude (Opus 5.5 Medium)

* ui : one drop area to import and a choice of what to export

The Import/Export tab now has a single drop area (or file picker) that takes
conversations, settings or a full backup and goes through the same previews
as dropping anywhere in the app. Export asks for conversations, settings or
everything; everything is one ZIP with the conversations and settings.json,
which importing reads back, showing the settings first and the conversations
after. Sensitive data is an inline checkbox instead of its own dialog.

Bulk import now reports conversations already in the library instead of
counting them as imported, and reloads groups like the tab used to.

Assisted-by: Claude (Opus 5.5 Medium)

* ui : import demo traces through the Import/Export drop area

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-25 09:56:31 +01:00
Aleksander Grygier
36d818e161
ui: edit the system message in the chat form when it is hidden in conversations (#32967)
* ui: edit the system message in the chat form when it is hidden in conversations

Assisted-by: Claude (Opus 5.5 Medium)

* ui: open the hidden system message from a chip under the chat form

Assisted-by: Claude (Opus 5.5 Medium)

* ui: keep a new chat's system message as a form attachment until the first message

Assisted-by: Claude (Opus 5.5 Medium)

* ui: open the chat form in two rows while it holds the system message attachment

Assisted-by: Claude (Opus 5.5 Medium)

* ui: show a conversation's hidden system message in a chip under the chat form

The attachment stays for a new chat, until the first message sends it.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: show the system message chip whenever a conversation has one

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-25 08:42:41 +01:00
Aleksander Grygier
e8906e6b0c
ui: add --ui-agent for agent mode without server tools or the MCP proxy (#33004)
Some checks are pending
Release / windows (arm64, vulkan, -G "Ninja Multi-Config" -DGGML_VULKAN=ON -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake, ggml-vulkan) (push) Blocked by required conditions
Release / windows (x64, vulkan, -DGGML_VULKAN=ON, ggml-vulkan) (push) Blocked by required conditions
Release / windows-cuda (13.5, arm64) (push) Blocked by required conditions
Release / windows-cuda (12.4, x64) (push) Blocked by required conditions
Release / windows-cuda (13.5, x64) (push) Blocked by required conditions
Release / windows-sycl (push) Blocked by required conditions
Release / ubuntu-24-sycl (fp16, ON) (push) Blocked by required conditions
Release / ubuntu-24-sycl (fp32, OFF) (push) Blocked by required conditions
Release / ubuntu-24-rocm (10.0.0, x64, gfx908;gfx90a;gfx942;gfx950;gfx1010;gfx1011;gfx1012;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103;gfx1150;gfx1151;gfx1152;gfx1200;gfx1201) (push) Blocked by required conditions
Release / ubuntu-26-zdnn (push) Blocked by required conditions
Release / ios-xcode (push) Blocked by required conditions
Release / ui-build (push) Blocked by required conditions
Server (sanitize) / server (RelWithDebInfo, ADDRESS) (push) Waiting to run
Server (sanitize) / server (RelWithDebInfo, UNDEFINED) (push) Waiting to run
Server (self-hosted) / server-metal (push) Waiting to run
Server (self-hosted) / server-cuda (push) Waiting to run
Server (self-hosted) / server-kleidiai (push) Waiting to run
Server / ubuntu (push) Waiting to run
Server / windows (push) Waiting to run
UI (self-hosted) / Build static output (push) Waiting to run
UI (self-hosted) / Checks (push) Blocked by required conditions
UI (self-hosted) / E2E Tests (push) Blocked by required conditions
UI Storybook / Deploy to Hugging Face Spaces (push) Waiting to run
UI / E2E Tests (push) Blocked by required conditions
UI / Build static output (push) Waiting to run
UI / Checks (push) Blocked by required conditions
UI / Library checks (push) Waiting to run
UI / Voice checks (push) Waiting to run
UI / Harness checks (push) Waiting to run
UI / Chat-only build (push) Waiting to run
* ui: add --ui-agent to run Llama Chat with browser tools only

Assisted-by: Claude (Opus 5.5 Medium)

* ui: say that --ui-agent leaves direct MCP servers available

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-25 07:08:29 +01:00
Aleksander Grygier
0ce7f213b0
ui: run Llama Chat apart from llama-server, named in config.json or npx --server (#32945)
* ui: run Llama Chat apart from llama-server, named in config.json

The app reads config.json, a file next to index.html, once before it
starts. A "server" URL in it sends every API request there instead of
to the app's own origin: /props, /v1, /models, /tools, the CORS proxy
and the realtime socket. Without one nothing changes.

npx llama-chat --server <url> answers that file itself, and
npx llama-chat build --server <url> writes it. The service worker
leaves it out of its cache, so a host can change it without a new
build.

Assisted-by: Claude (Fable 5.2)

* ui: release Llama Chat 0.2.0 with --server

Bumps @ggml-org/llama-chat and llama-chat to 0.2.0 so the publish
workflow ships the --server flag to npx once this reaches master.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: expect the Llama Chat name in the PWA manifest e2e test

#32890 named the PWA Llama Chat by default, but the E2E test still
expected llama-ui, so the UI workflow failed on master and on every UI PR.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-24 17:38:56 +01:00
Aleksander Grygier
96eb41bc48
ui: fix prebuilt UI download in shallow clones (#32952)
In a shallow clone the git commit count is not the build number, so the build asked for a UI version that does not exist (b1 with --depth 1) and fell back to 'latest'. Use the release tag on HEAD when it was fetched, else 'latest'.

Also check a downloaded archive right after extraction. If it does not have the files this checkout needs, drop it and build without an embedded UI instead of failing the build.

Refs #32780

Assisted-by: Claude (Fable 5.2)
2026-11-24 17:34:34 +01:00
Aleksander Grygier
8bf2eae708
ui: expect the Llama Chat name in the PWA manifest e2e test (#32959)
#32890 named the PWA Llama Chat by default, but the E2E test still
expected llama-ui, so the UI workflow failed on master and on every UI PR.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-24 17:10:20 +01:00
Aleksander Grygier
ba8521a44e
ui: smooth chat form height and working directory chip across routes (#32950)
* ui: ease the chat form height and fade the working directory chip across routes

Assisted-by: Claude (Opus 5.5 Medium)

* ui: open the room for the working directory chip first, then fade it in

Assisted-by: Claude (Opus 5.5 Medium)

* ui: skip the working directory chip transition when the route changes

Assisted-by: Claude (Opus 5.5 Medium)

* ui: resize the working directory chip's box in full before fading the chip in

Assisted-by: Claude (Opus 5.5 Medium)

* ui: halve the working directory chip transition

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-24 15:29:51 +01:00
ZhaolunYin
2e779d5e70
Webui nix fix (#32645)
Some checks are pending
Release / ubuntu-24-sycl (fp16, ON) (push) Blocked by required conditions
Release / ubuntu-24-sycl (fp32, OFF) (push) Blocked by required conditions
Release / ubuntu-24-rocm (10.0.0, x64, gfx908;gfx90a;gfx942;gfx950;gfx1010;gfx1011;gfx1012;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103;gfx1150;gfx1151;gfx1152;gfx1200;gfx1201) (push) Blocked by required conditions
Release / ubuntu-26-zdnn (push) Blocked by required conditions
Release / ios-xcode (push) Blocked by required conditions
Release / ui-build (push) Blocked by required conditions
Server (sanitize) / server (RelWithDebInfo, ADDRESS) (push) Waiting to run
Server (sanitize) / server (RelWithDebInfo, UNDEFINED) (push) Waiting to run
Server (self-hosted) / server-metal (push) Waiting to run
Server (self-hosted) / server-cuda (push) Waiting to run
Server (self-hosted) / server-kleidiai (push) Waiting to run
Server / ubuntu (push) Waiting to run
Server / windows (push) Waiting to run
UI (self-hosted) / Build static output (push) Waiting to run
UI (self-hosted) / Checks (push) Blocked by required conditions
UI Storybook / Deploy to Hugging Face Spaces (push) Waiting to run
UI / Build static output (push) Waiting to run
UI / Checks (push) Blocked by required conditions
UI / Library checks (push) Waiting to run
UI / Voice checks (push) Waiting to run
UI / Harness checks (push) Waiting to run
UI / Chat-only build (push) Waiting to run
UI / E2E Tests (push) Blocked by required conditions
Update Operations Documentation / update-ops-docs (push) Waiting to run
Release / windows (x64, vulkan, -DGGML_VULKAN=ON, ggml-vulkan) (push) Blocked by required conditions
Release / windows-cuda (13.5, arm64) (push) Blocked by required conditions
Release / windows-cuda (12.4, x64) (push) Blocked by required conditions
Release / windows-cuda (13.5, x64) (push) Blocked by required conditions
Release / windows-sycl (push) Blocked by required conditions
UI (self-hosted) / E2E Tests (push) Blocked by required conditions
* applied fix for write into nix store

* added cuda_nvml_dev to package.nix because it is required for compilation

* chore: lint brand-favicons.ts

---------

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>
2026-11-24 15:04:39 +01:00
Aleksander Grygier
97bbf98fdf
ui: make Llama Chat a plain chat unless llama-server offers agent features (#32949)
Llama Chat showed its tools, MCP and agentic settings and ran the agentic
loop for every server. Now it does so only for a llama-server that offers
its built-in tools or its proxy, which --agent turns on together; the app
reads this from /props and /tools. Without them it is a plain chat: a
message and its reply, with reasoning when the model gives it. The chat
store sends the classic request, the tools store has no tools and the MCP
store connects to no server, so the tools menu, the working folder, the MCP
entry and page, and the Tools and Agentic settings are gone. Tool calls in
earlier conversations still display.

The Show MCP setting moves from General to the Agentic settings, with the
rest of what agent mode adds.

VITE_PUBLIC_AGENTIC=false builds an app that is a plain chat for every
server, and leaves Llama Harness's loop out of the bundle: the harness gets
a ./trace entry with the phrasing alone, and Vite resolves the package to a
small stub that re-exports it. A CI job builds the variant and checks the
loop is not in it.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-24 15:00:46 +01:00
Aleksander Grygier
ae6a7ad2c5
ui: move the agentic loop and trace phrasing into @ggml-org/llama-harness (#32927)
* ui: add @ggml-org/llama-harness, the agentic loop as a package, in ui/lib/harness

Llama Harness is the agentic loop as headless TypeScript with no UI, no DOM and no dependencies. It streams a turn, runs
the tools the model called, gives it the results, and repeats until the model answers without a tool call. An app gives
it an inference client and tools, and reads the run as a stream of events: run(messages, tools, signal). It ships a
client for any OpenAI-compatible endpoint, so it also runs on its own in Node. The UI workflow type-checks, tests and
packs it.

Assisted-by: Claude (Fable 5.2)

* ui: run Llama Chat's agentic loop through @ggml-org/llama-harness

The loop leaves the agentic store, which now gives the harness what the app owns: ChatService as its inference client,
the enabled tools behind the permission gate, and the callbacks that store each turn. Its API and the flow's callbacks
are unchanged. A unit test runs the flow end to end with the server and the tools mocked.

Chat compiles the harness from source through an alias, so the builds that copy or isolate ui/apps/chat now bring
ui/lib/harness along: CMake and Nix through LLAMA_HARNESS_DIR, the Dockerfiles with a COPY.

Assisted-by: Claude (Fable 5.2)

* ui: bring the architecture docs in line with the ui/ folder

The layout card no longer calls the move planned, the harness is in the
pages, and they say that Llama Chat does not import @ggml-org/llama-ui yet.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: phrase agent traces in @ggml-org/llama-harness

The plain-language lines of an agent trace move out of Llama Chat into the
harness, as a headless trace module any app on it can use: what one tool call
did ("Read app.ts"), what it is doing now ("Running npm test", "Thinking"),
what a run of calls did ("Ran 3 commands, read 2 files"), and how calls fold
into one row with the reasoning around them.

createTracePhraser knows llama-server's built-in tools. An app adds its own
with resolvers and a phrasing table; any other tool reads as "Used <tool>"
with its main argument, and a call with a description shows the model's own
words. The lenient parse of streamed arguments and the targeted read of a
path in a whole-file argument move with it.

Llama Chat keeps its Svelte components and phrases only its own tools: the
browser tools, web search and tool_search. Its functions keep their names and
signatures, so nothing that renders a trace changes.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-24 11:12:47 +01:00
Aleksander Grygier
a6ac41c757
ui: match tool call timer font size to its title (#32922)
Assisted-by: Claude (Opus 5.5 Medium)
2026-11-24 09:25:18 +01:00
Aleksander Grygier
3fccd98e9d
ui: let the chat form's model selection decide the submit state (#32920)
When the last assistant message came from a model that is no longer
available, the submit button stayed red and disabled even after an
available model was picked in the form, since availability checked the
conversation's model first. The form's selection now decides it; the
conversation's model only counts when nothing is selected.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-24 09:25:04 +01:00
Aleksander Grygier
8355b88625
ui: remove the Matte theme and the Light surfaces setting (#32906)
Paper is now the only light theme: its surface tokens stay the base
values, and the theme-matte overrides, the setting, its enum and the
Storybook surface switch are gone.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-23 21:38:18 +01:00
Aleksander Grygier
325914defd
ui: show an agentic reply as a grouped Agent Trace (#32879)
* ui: show tool calls in the trace as a grouped, plain-language log

Tool calls and all the reasoning around them, up to the answer, collapse
into one row whose title sums up what happened ("Ran 2 commands, read 1
file"), so a model that thinks before every call still reads as one row
of work. Two calls, or one call with reasoning beside it, make a group;
without per-turn stats a group spans turns.

Each call reads as a sentence: built-in tools get hand-written phrasing
in two tenses, MCP and unknown tools read as "Used <tool> <argument>",
and the generic block shows simple arguments as labelled fields. A call
that has the argument a display setting picks (description by default,
overridable per tool in Settings > Tools) shows it as the model wrote it
instead, for any tool that declares it. A shell row always shows the
command, after "Ran" or after that description, and opens into the
terminal; the permission card shows the command that would run.

An open group is a list of rows under one rule, with no icons in the
headings; a running row shimmers. While a group is live its title says
what is happening now ("Reading package.json", "Thinking"), with a timer
since the prompt was sent, and the loop records the task's total time,
which the response stats show. Thoughts and tool calls now stay collapsed
while generating, with a one-time migration of the saved old default.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: keep a live reply steady while its status changes

The status line ( Loading weights, Processing 40% ) sat above the content
before the first token and below it afterwards, and collapsed to nothing
while tokens streamed, so the stats and actions under it jumped. It is now
one row in the trace column with a trace row's box, shown only while
nothing else is moving, and while a tool group closes the reply it becomes
that group's live title instead.

The model badge shows from the start of a live reply, the user message
reserves its stats row while the prompt is processed, and a collapsed
group title is muted.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: glide a sent message to the top of the screen

Sending snapped the page to its bottom in one frame, and layout that
settled a moment later was followed with more snaps. The page now eases
there: the target is read again every frame, so late layout bends the
motion instead of ending it with a jump, and corrections shortly after a
send are glided to as well.

A frame that arrives late counts as one frame, so a busy page slows the
glide instead of skipping it. Wheel, touch and scroll keys hand the page
back at once; typing the next message does not. Reduced motion keeps the
jump.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: show tool images in the trace and in one slideshow of the thread

A closed tool group shows every image its calls produced under its title,
64px tall at their own proportions, in a carousel once they overflow; the
strip fades out when the group opens. A call with images shows tiny
thumbnails beside its title while its row is closed.

A group thumbnail, or an image in a user message, opens one slideshow of
every image, audio clip and video in the open thread, in thread order, at
the clicked item.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: quiet the conversation around its messages

Stats and actions under earlier messages stay hidden until the reader
points at the message or tabs into it, changing only opacity so nothing
moves; the latest exchange keeps them in view and touch screens keep them
shown. A Display setting, Always show message statistics, keeps every
message's statistics in view.

With them out of sight the spacing tightens: messages sit 1rem apart, the
answer sits 0.75rem from the trace rows around it, and the user message's
stats and actions sit closer together. A queued message no longer sticks
to the bottom of the screen and scrolls with the conversation.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: name the agentic reply an Agent Trace and give basic chat its own view

A reply that ran the agentic loop is now an Agent Trace: the component
that renders it is ChatMessageAgentTrace, with matching class names and
docs. A basic chat reply, with no tool calls, renders through the new
ChatMessageAssistantResponse as its reasoning and its answer, without the
trace's grouping, timer and permission handling. hasAgenticContent picks
the view, so a live reply becomes a trace the moment its first tool call
streams in.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-23 17:24:05 +01:00
Aleksander Grygier
1094646c1f
ui: set code in messages at the size of the text around it (#32892)
Inline code and code blocks were 14px next to 16px text. Llama Mono
has Llama Sans's x-height, so the two read as one size without the
mono being scaled down. The chat form's editor follows.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-23 16:21:45 +01:00
Aleksander Grygier
27d0a1fc73
ui: unmount a closed collapsible's body after one transition (#32881)
bits-ui rebuilds the Collapsible.Content snippet args when its close
transition ends, which re-ran the region's effect and restarted the
unmount timer, so a closed body stayed mounted for two transitions
instead of one. Reading `open` through a derived keeps the effect from
rerunning when only the args object changes.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-23 16:20:15 +01:00
Aleksander Grygier
b6d5ce4bc9
ui: drop tool calls cut off by Stop from the next request (#32738)
* ui: drop tool calls cut off by Stop from the next request

A tool call stopped mid-stream could stay on its message with cut-off
arguments. The server parses every call's arguments as JSON, so the next
message in that chat ("Continue") failed with "Failed to parse tool call
arguments as JSON". Requests now leave such calls out, with the tool results
that answer them, and send a call with no arguments as {}.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: add a demo trace that ends in a stopped tool call

A conversation whose last tool call was stopped while its arguments were
still streaming, for recording the fix in the previous commit.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-23 16:18:59 +01:00
Aleksander Grygier
a0677c341b
ui: use a red edge on the send button's error state (#32856)
The error state reused the primary button's edge, which shows as a light
ring in dark mode. Use the danger button's edge instead.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-23 15:47:30 +01:00
Aleksander Grygier
2359d27a36
ui: name the PWA from the build env and default it to Llama Chat (#32890)
The manifest is built in Node by its Vite plugin, where import.meta.env is not set, so it was
always named llama-ui whatever VITE_PUBLIC_APP_NAME said. The plugin now names it from the env
Vite loaded (.env files included), and the default name is Llama Chat.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-23 15:45:44 +01:00
Aleksander Grygier
4663f9ca8a
ui: smooth height transition for every collapsible (#32873)
Some checks failed
Release / windows (arm64, opencl-adreno, -G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/opencl-arm64-release" -DGGML_OPENCL=ON -DGGML_OPENCL_USE_ADRENO_KERNELS=ON, ggml-opencl) (push) Blocked by required conditions
Release / windows (arm64, vulkan, -G "Ninja Multi-Config" -DGGML_VULKAN=ON -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake, ggml-vulkan) (push) Blocked by required conditions
Release / windows (x64, vulkan, -DGGML_VULKAN=ON, ggml-vulkan) (push) Blocked by required conditions
Release / windows-cuda (13.5, arm64) (push) Blocked by required conditions
Release / windows-cuda (12.4, x64) (push) Blocked by required conditions
Release / windows-cuda (13.5, x64) (push) Blocked by required conditions
Release / windows-sycl (push) Blocked by required conditions
Release / ubuntu-24-sycl (fp16, ON) (push) Blocked by required conditions
Release / ubuntu-24-sycl (fp32, OFF) (push) Blocked by required conditions
Release / ubuntu-24-rocm (10.0.0, x64, gfx908;gfx90a;gfx942;gfx950;gfx1010;gfx1011;gfx1012;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103;gfx1150;gfx1151;gfx1152;gfx1200;gfx1201) (push) Blocked by required conditions
Release / ubuntu-26-zdnn (push) Blocked by required conditions
Release / ios-xcode (push) Blocked by required conditions
Release / ui-build (push) Blocked by required conditions
Server (sanitize) / server (RelWithDebInfo, ADDRESS) (push) Waiting to run
Server (sanitize) / server (RelWithDebInfo, UNDEFINED) (push) Waiting to run
Server (self-hosted) / server-metal (push) Waiting to run
Server (self-hosted) / server-cuda (push) Waiting to run
Server (self-hosted) / server-kleidiai (push) Waiting to run
Server / ubuntu (push) Waiting to run
Server / windows (push) Waiting to run
UI (self-hosted) / Checks (push) Blocked by required conditions
UI (self-hosted) / E2E Tests (push) Blocked by required conditions
UI (self-hosted) / Build static output (push) Waiting to run
UI Storybook / Deploy to Hugging Face Spaces (push) Waiting to run
UI / Build static output (push) Waiting to run
UI / Checks (push) Blocked by required conditions
UI / Library checks (push) Waiting to run
UI / Voice checks (push) Waiting to run
UI / E2E Tests (push) Blocked by required conditions
Update Operations Documentation / update-ops-docs (push) Has been cancelled
* ui: give every collapsible the smooth height transition

Llama UI's Collapsible.Content now force-mounts the bits-ui content and
renders the animated region the chat used to keep as CollapsibleRegion:
height eases open and shut, and the body unmounts once the collapse is
over. The chat's standalone regions use Collapsible.Root/Content, so the
tool groups in settings, the tools menu and drawer and the terminal block
animate like the rest.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: keep collapsible spacing inside the content

Collapsible.Content now stays in the layout while closed, so a margin on
it left a gap under a closed MCP tools list, connection log or server
info. The margin moves onto the content inside, as does the story's
spacing.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-23 14:12:41 +01:00
Wenyu Chen
212c547fe9
ui: add cancel button to cancel model loading (#32225) 2026-11-23 09:27:44 +01:00
Aleksander Grygier
80325823d4
ui: open the context gauge panel on click as a popover (#32685)
* ui: open the context gauge panel on click as a popover

Assisted-by: Claude (Opus 5.5 Medium)

* ui: give the context gauge trigger the ghost button hover

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-21 13:21:47 +01:00
Aleksander Grygier
e46069c409
ui: fix the flaky reset check of the MermaidPreview Flowchart story (#32675)
Assisted-by: Claude (Opus 5.5 Medium)
2026-11-20 19:43:24 +01:00
Aleksander Grygier
427a836734
ui: stage Llama Voice's sources for CMake and Docker UI builds (#32680)
Llama Chat compiles @ggml-org/llama-voice from ui/lib/voice/src, but the
CMake stage and the Docker UI stages copied only ui/lib/ui, so their npm
build could not resolve the voice imports. Stage ui/lib/voice/src next to
Llama UI and track it as an input of the CMake build.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-20 19:42:49 +01:00
Aleksander Grygier
79e81b0bd4
ui: voice messages and dictation with live waveforms and transcripts (#32531)
* ui: add a voice engine for capture, peaks and transcription

Voice input needs a live waveform, a clip that can be sent and drawn,
and a transcript, whether the model streams text while the user speaks
or not. This adds the engine for it in src/lib/voice, with no imports
of app stores or components, so it can move into a package later.

- VoiceCapture: one microphone start gives live levels (RMS on a dB
  curve, fixed history, newest last), PCM16 mono chunks at 16 kHz from
  an inline AudioWorklet (ScriptProcessor fallback), and on stop a
  16-bit mono WAV clip with its duration and peaks. Tracks, nodes and
  the context are released on stop, cancel, a failed start and page hide.
- computePeaks / computePeaksFromAudio: normalised peaks of samples, a
  buffer, or a stored base64 or Blob file.
- transcribeClip: POST /v1/audio/transcriptions, with the server's own
  error message on failure.
- RealtimeTranscriber: the /v1/realtime?intent=transcription socket,
  queueing audio until session.created, a final commit, and a typed
  RealtimeUnsupportedError when the model cannot stream or the socket
  is refused (a browser websocket cannot send the API key header).
- startVoiceSession and VoiceRecorder: try realtime, fall back to one
  HTTP transcription of the clip, and expose levels and live text.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: add voice waveform and transcript components to Llama UI

Voice input needs three visuals that the app can feed with its own
recording and transcription logic: the live waveform while recording,
a playable waveform of a recorded clip, and a clip with its transcript
that opens on hover, keyboard focus or a tap.

VoiceWaveformLive draws input levels as many bars as fit the width,
newest on the right, and holds still with reduced motion.
VoiceWaveform plays a clip through its own audio element, fills the
played part in the primary colour, seeks by press, drag and arrow keys
(a slider) and pauses any other clip that was playing.
VoiceTranscriptReveal keeps the transcript in the DOM for screen
readers while it is closed, and shows transcribing and error states.

The waveform math (resampling peaks, bar capacity, seek and time
formatting) is in src/lib/voice with unit tests. The components are
exported from the package root and from @ggml-org/llama-ui/voice, which
Llama Chat resolves to the sources like the other entry points.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: add stories and tests for the voice components

Storybook gets UI/Blocks/Voice: the live waveform fed by a fake
microphone meter in a chat form row, the clip waveform in its sizes and
states, and the transcript reveal in each state and on touch. The demo
audio is a WAV synthesised in the story, so no binary file is added.

The play functions check seeking by keys and by press, the reveal on
hover, keyboard focus and a tap, and a clip without audio. Pressing play
needs a real click before a browser plays audio, so a client test covers
play and pause and one clip pausing another.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: store voice messages with their transcript and send it to models that cannot hear

A voice message recorded in the chat form is an audio attachment like an
uploaded file, plus what the app needs to draw and read it. The audio
attachment gets four optional fields: voice (recorded in the app),
transcript, peaks and durationMs. Stored rows, export and import carry
them as they are, so no migration is needed and older messages keep
working.

The transcript is for reading. A model with audio input still gets the
audio alone; a model without it (the user switched models later) gets the
transcript as a labelled text part in place of the audio. When the
model's modalities are not known yet, or there is no transcript, the
audio goes as before.

A transcript often comes back after the message was sent. The new
voiceTranscriptsStore follows each pending transcript by the clip's name,
hands it to a send that happens after it arrived, and otherwise writes it
into the stored attachment of the message it went out with, in the open
chat or, if the user left it, in the database.

Copying a message now includes its voice transcript.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: add Voice settings and resolve what the microphone does per model

The user should not have to think about which kind of voice input is in
use, so the app decides it from the conversation's model and two
settings. resolveVoiceMode is a small pure function: with Voice input on
Automatic and a chat model that has audio input, a recording is a voice
message, transcribed by that same model so a router swaps nothing.
Otherwise it is dictation, with the chat model when it can hear, else,
in router mode, with the chosen transcription model. When no model can
transcribe, the microphone is unavailable and says why.

Settings get a Voice section of their own rather than more rows in
General, which is already long: these four belong together and one of
them lists the server's models.

- Voice input: Automatic (default) or Always dictate.
- Transcription model: Same as chat model (default) or, in router mode,
  any model with audio input; on a single-model server it only says
  whether that model can transcribe. It notes that dictating with
  another model loads it beside the chat model.
- Transcribe voice messages: on by default.
- Transcription language: empty for automatic.

The keys live in the settings registry like the others, so defaults,
storage, reset and export need nothing new. The model picker is drawn by
SettingsChatVoiceTab, the way Extensions and Tools draw their sections.

Assisted-by: Claude (Opus 5.5 Medium)
Co-authored-by: Nicolas Mowen <14866235+NickM-27@users.noreply.github.com>

* ui: record voice messages and dictation from the chat form

The microphone now does what the conversation's model allows, without
the user choosing a mode: its label says "Send a voice message" or
"Dictate", and when no model can take audio it is disabled and says why
(shown in router mode only when some model there has audio input, so the
reason can be acted on; a single-model server without audio keeps the
send button as before). The microphone errors keep their warning state
and toast, now also for the voice engine's own capture errors.

Recording goes through the voice engine's VoiceRecorder instead of the
MediaRecorder flow. While it records, the actions row becomes a
recording row: cancel, the live waveform, the elapsed time and stop.
Escape or cancel drops the recording. The form keeps its two rows while
recording, so the message stays visible on desktop and the row fits the
phone layouts and the expanded sheet.

- Dictation writes the live transcript into the message at the caret
  as it streams. DictationSpan replaces only the dictated stretch, moves
  it when the user types before it, keeps what is typed after it, and
  hands text the user edits over to them. When nothing streams, the row
  shows Transcribing... after stop and the text goes in once it is back.
  Cancel takes the dictated text out again. No audio is attached.
- A voice message streams its live text, if any, under the waveform,
  not into the message. On stop the clip is attached as a voice file
  with its peaks and length, and its transcript is followed by the voice
  transcripts store (unless Transcribe voice messages is off).

Realtime transcription is skipped for servers reached through a tunnel
or with an API key, which a browser websocket cannot carry. The first
dictation with a separate router model shows a one-time note that it
loads beside the chat model.

The form takes an optional voiceRecorder, so tests and stories can run
it without a microphone.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: draw audio attachments as playable waveforms with their transcript

A voice message should read as a clip, not as a file chip. Audio
attachments now render with Llama UI's VoiceWaveform inside
VoiceTranscriptReveal, through a direct branch in the core attachment
item (voice is core, so it does not go through the extension renderers):
the removable sm chip in the chat form, and the md clip in a sent
message, on the user bubble's surface.

- The audio plays from an object URL made from the stored base64 (or the
  uploaded file's data URL), revoked when the clip leaves the screen.
- A clip stored without peaks, an older voice message or an uploaded
  audio file, gets them computed from its audio once per session, in
  memory only; uploaded files keep their name under the waveform.
- The transcript opens under the clip on hover, keyboard focus or a tap,
  and shows Transcribing... while the voice transcripts store waits for
  it, Transcription unavailable when it failed, and nothing when none
  was asked for.
- The full-screen preview keeps its player and shows the transcript.

Tests run the chat form with a fake recorder: the microphone per mode,
the recording row, dictation around typed text, the Transcribing...
state, cancel, and a voice message chip whose transcript arrives later
and goes with the send. Stories show the form recording each kind, a
recorded chip, and sent voice messages with the transcript, pending,
and computed peaks.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: drop the old audio recorder and proxy realtime transcription in dev

The voice engine replaced AudioRecorder, so it goes. The dev server now
proxies WebSockets on /v1, so realtime transcription works under vite dev.
The VoiceCapture test waits for the tone to be recorded instead of a fixed
700 ms, which a loaded test run could miss.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: dictate with a model that is already loaded when the chat model cannot hear

The Transcription model setting's Automatic choice now falls back to a
router model with audio input that is already loaded, so dictating with a
text-only chat model works without picking a model and loads nothing.
A picked model still wins, and the empty value is a named constant.
Idea from upstream PR 27567, by NickM-27.

Assisted-by: Claude (Opus 5.5 Medium)
Co-authored-by: Nicolas Mowen <14866235+NickM-27@users.noreply.github.com>

* ui: fill the recording waveform, and open voice message transcripts

- The live waveform fills the row from the start: a recording shorter
  than the row is stretched over all its bars, a longer one scrolls with
  the newest level on the right. No dotted placeholder.
- A voice message's transcript is open under its clip, in the chat form
  while it comes in and in the sent message, with the toggle beside it
  to fold it.
- Settings > Voice > Collapse transcripts (off by default) keeps them
  folded instead, opening on hover, keyboard focus or a tap.

Assisted-by: Claude (Opus 5.5 Medium)
(cherry picked from commit 2a93f2f948ed976e40f693ce5d3acf1168284b05)

* ui: record voice without ducking other audio, from the first word

- Voice input asks for the raw microphone signal: no echo cancellation,
  noise suppression or auto gain. Echo cancellation made the system treat
  a recording as a call, which lowers or interrupts other playback, and
  auto gain faded the first words in.
- One AudioContext serves every recording, with the capture worklet
  loaded once, suspended in between and, where the browser allows it,
  without an output device, so recording never touches the speakers.
- The chat form prepares it when it gets focus (no microphone, so no
  recording indicator), and a mouse starts recording on press.
- A recording starts counting once audio flows: until then the bar says
  Starting... instead of running the timer. Development builds log how
  long each step of a start took.
- Settings > Voice > Microphone: Automatic (the system default, or the
  built-in microphone when the default is a Bluetooth headset, which
  would switch to its low-quality call mode), System default, or a
  listed microphone.

Assisted-by: Claude (Opus 5.5 Medium)
(cherry picked from commit 76643e7210d21617d734fdfde677e84af7273153)

* ui: show voice text live in the message box, and follow transcripts as spoken

- A model that hears but has no live ASR (e.g. LFM3-Omni) now gives text
  while you record: the realtime client commits the audio piece by piece,
  at the pauses the levels show, one piece at a time, and the final
  commit takes only what is left.
- A voice message's live text shows as the empty message box's
  placeholder. Clicking into the box makes it text to edit there, and
  what is said next follows it. On stop the text leaves the box and goes
  with the clip; when it was edited, the edit is the clip's transcript.
- Llama UI gains VoiceSpokenText and spokenLength(): spoken words in the
  full foreground colour, which they keep, the rest muted. A clip's
  transcript follows its playback (estimated over the parts with speech,
  as there are no word timings), and live text brightens as it arrives.
- The recording bar has a send button that stops and sends in one go.

Assisted-by: Claude (Opus 5.5 Medium)
(cherry picked from commit ce773017f902f8a5690ab9ecca368cecb6427422)

* ui: let the capture test start with silence

A capture starts with its first audio block, which can come before a
stream's first sound, so the steady tone is checked from where it begins.

Assisted-by: Claude (Opus 5.5 Medium)
(cherry picked from commit a41ee5337b83fef685a5cbaff176925f1647ce9d)

* ui: show live voice text sooner, and keep silence from becoming "yeah"

- A model that transcribes per commit (LFM3-Omni) gets shorter pieces:
  cut at a 0.35 s pause after speech, or at the next quiet moment once a
  piece reaches 3 s, so the text follows the speaker within a few
  seconds in dictation, the message box and voice mode.
- When the recording stops, the audio after the last piece is committed
  only if speech was heard in it. LFM3-Omni transcribes a commit of pure
  silence as "Yeah." (or "はい。"), which ended up at the end of the text.
  A recording whose only piece is that rest still commits it.

Assisted-by: Claude (Opus 5.5 Medium)
(cherry picked from commit 43e52cbab0fba9d8e84b9491890a406e3c6c90f3)

* ui: transcribe a recording cut at pauses once more as a whole

Live text comes piece by piece, cut at the speaker's short pauses, and a
model reads each piece as a sentence of its own: "I went. To the store."
When the recording ends, one pass over the whole clip gives the final
text, punctuated by meaning, in dictation and in voice mode alike. The
pieces' text stays the live text until then, and is kept when that pass
fails or the recording is longer than two minutes.

Assisted-by: Claude (Opus 5.5 Medium)
(cherry picked from commit 359dd9632e6c88000a1d23c2575bd1e6fcdd9ec1)

* ui: give live text over HTTP for models without a realtime session

A model that hears but cannot hold a realtime session, such as
Qwen3-ASR, was transcribed only after the recording, so dictation
showed no text while speaking. The recording is now cut at the
speaker's pauses as with a realtime session, and each piece sent to
/v1/audio/transcriptions on its own, one at a time, its text joined
live. The audio is kept from the start, so what is said while the
socket answers goes with the first piece. The whole clip is still
transcribed once more at the end, and the pieces' text is kept if
that fails. A server a websocket cannot reach (an API key, a remote
server) gets live text the same way.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: say when the browser processes the microphone despite the raw request

The browser keeps one processing setting per microphone: while a call,
another tab or voice mode has it open with echo cancellation, a
dictation that asked for the raw signal is processed too, sounds
distant, and the system may lower other sound. The capture now warns
when it gets processing it did not ask for, and its development log
names the microphone, its rate and what processing is on.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: keep the microphone beside the stop and send buttons

While a reply streams, or once the message has text, the microphone no longer
gives way to the main button: it stays beside it as a quieter, secondary
button, so more can be dictated without clearing the message or waiting for
the reply.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: show the voice components' stories with Llama UI

VoiceWaveform and VoiceTranscriptReveal are Llama UI components, so their
stories move to the library's Storybook, under Llama UI/Voice, with the demo
audio they play. Llama Chat's Storybook shows them there too, and its own
voice stories take the demo audio from the library. VoiceWaveformLive stays
with Llama Chat, as its demo records through the chat form's microphone.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: add a noise suppression setting for voice input

Recordings stay raw by default. Settings > Voice can now switch the
browser's noise suppression on; echo cancellation and automatic gain stay
off either way, as they interrupt other sound and fade the first words in.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: keep live voice text coming when the room is never quiet

Pieces were cut only at a quiet moment, so with music or talk in the room
none was ever cut and no text showed until the recording ended. A piece half
as long again as its longest length is now cut where it is.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: add echo cancellation and automatic gain settings for voice input

Settings > Voice now has a switch for each kind of microphone processing the
browser offers. All three stay off by default, so recordings are raw; each
one says what switching it on costs.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: put the microphone after the stop button, filled like it

While a reply streams, the microphone is the last button of the row and
looks like the stop and skip buttons beside it, instead of a bare icon
before them.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: say when dictated text is being refined, and send it refined

After a recording with live text, the whole clip is transcribed once more
so pauses do not end sentences. The form now says so while that pass is
out, and a send asked for meanwhile waits for it, so the message goes out
with the refined text rather than the pieces.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: keep the send button in place and put the microphone beside it

The send button no longer gives way to the microphone on an empty
message. The microphone stands before it as a quieter, tertiary button,
with the same tooltip, warning and recording states as before.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: let a recording be sent while a reply streams, once it has words

While a reply streams, the recording row now shows its send button as
soon as the first transcribed words are in the message, so the
recording no longer has to be stopped first. The microphone also stays
beside the send button once a voice message is attached.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: raise quiet speech for transcription, and say when it is too quiet

A quiet microphone gave the model near silence to transcribe. A new
Voice setting, Boost quiet speech (on by default), raises speech to a
level speech models hear well, up to eight times louder: the audio
streamed for live text as it goes, and the whole recording in one pass
when it stops, so its first words get the same gain as the rest. Only
speech is measured, never the silence around it, loud speech is left
as it is, and a soft limiter keeps raised peaks from clipping. When
speech stays quiet even at the highest gain, the recording row says so.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: keep the voice engine free of app code

The engine in lib/voice imported the microphone messages from the app's
utils and the WAV type from its enums, the only two things keeping it
from moving into a package of its own. The microphone checks and
messages move into the engine (voice/support.ts), next to the capture
that needs them; the uploaded-file helpers stay in the app's utils.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: start voice sessions from one voice service

How a recording reaches the server (routes, API key, whether the
realtime socket can be used) and how the Voice settings become capture
and transcribe options were built inside the chat form's voice hook,
and copied into every other feature that records. VoiceService builds
them in one place: a feature asks it for its session options and adds
only its own callbacks.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: tell speech from the room in one place

The pause detector, the speech gain and (in voice mode) the listener for
speech over a reply each followed a noise floor with their own numbers.
A SpeechDetector now does it for all of them, in dB, with one set of
settings in VOICE_SPEECH.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: let any text field take dictation

Writing dictated text into a field (at the caret, around the user's
typing, replaced by the whole recording's text when it comes) moves out
of the chat form's hook into a plain createDictation(). The hook keeps
what is the chat form's own: voice messages, toasts and the hint.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: move the recording row into Llama UI

VoiceRecordingBar draws the row shown while recording (cancel, waveform
and time, send, and a caption or warning under it) from data alone, so
voice mode or a notes page can show the same row. The chat form passes
its labels and its microphone button as the stop button.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: keep the voice engine's Svelte recorder behind its own entry

VoiceRecorder, the one part of lib/voice written with runes, moves to
lib/voice/svelte, so the rest of the engine is plain TypeScript any app
can use without Svelte.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: move voice input into its own package, Llama Voice

The voice engine (capture, the speech signal, transcription over the
realtime socket or HTTP) and dictation into a text field move from the
app to ui/lib/voice as @ggml-org/llama-voice, so another app, such as a
notes app, can use them. The Svelte recorder is its ./svelte entry.
Llama Chat compiles the sources, as it does Llama UI's, and keeps its
server and settings wiring. The package has its own type check, tests
and build, and a CI job for them.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: show which model does what in voice input

The model picker and the Models manager mark each model that hears:
Dictation on the one that transcribes dictation, Speech to text on
transcription models such as Qwen3-ASR, and Voice on chat models that
take voice messages. A loaded model kept only for dictation sits apart
from the chat models, a model can be made the dictation model from its
row, and Settings > Voice groups the transcription models apart from
the chat models with audio input. A voice store now resolves what the
microphone does, for the chat form and the model lists alike.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: warn of a quiet microphone inside the recording row

The too-quiet line under the waveform made the form grow and jump. The
warning now stays inside the row: the waveform turns the warning colour,
an icon sits by the time, and the advice opens above the row in a
tooltip for a few seconds, then on hover or focus. Screen readers still
hear it when it appears.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: open the microphone while the pointer is on its button

The first seconds of a recording could come out quiet while the
microphone settled, and the too-quiet warning showed for them. With the
pointer or the focus on the microphone button, the microphone now opens
ahead of the press (only when the page may already use it, so nothing
asks), and the recording takes it at once; it is let go shortly after
the pointer leaves without a press. The warning also waits until the
speech has stayed too quiet for two seconds.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: tidy voice input after review

Fix a microphone left open when a recording is cancelled while it starts
or the pointer leaves while it opens, a capture that is still letting go
silencing the next one, and live text stopping after a realtime error.
Share the dictation model choice, the transcript lookup, base64 decoding,
PCM joining and stopping a stream instead of repeating them, and export
only Llama Voice's public API.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: pin Llama Voice's dev dependencies to Llama UI's versions

Assisted-by: Claude (Opus 5.5 Medium)

* ui: let demos speak into a synthetic microphone

Assisted-by: Claude (Opus 5.5 Medium)

* ui: keep the microphone for voice input, off the audio files entry

The attach menu's Audio Files entry used a microphone, which now sits
beside the form's own microphone button. The microphone stands for
recording and dictation only; a model's audio modality is headphones, and
the audio files entry is a file with headphones.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: set voice input on the slimmed design tokens

Voice input's components use the type roles, the one corner scale and
shadcn's utility names for the neutral colours, as the rest of Llama UI
and Llama Chat do since the design tokens were slimmed down.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: name voice states, platform strings, patterns and tunings

Addresses the review on the voice PR:

- Llama Voice: VoiceCaptureState, VoiceRecorderStatus, RealtimeState and
  RealtimeUnsupportedReason are enums (src/enums.ts, exported); DOMException
  names, AudioContext states, transcription form fields, socket protocols,
  device kinds, worklet messages, error messages, regexes and tuning values
  are named constants.
- Llama UI: VoiceTranscriptStatus, VoiceWaveformSize and
  VoiceRecordingBarStatus are enums; KeyboardKey, MouseButton and PointerType
  join its UI enums; the voice components' sizes, labels, timings, selectors
  and patterns move to constants/voice.constants.ts. The voice unit tests
  move from src to tests/unit.
- App: ChatFormVoiceState is an enum, the recording bar's status comes from a
  map, and the voice code uses the enums above, BooleanString, HEADERS and
  new voice constants in place of inline strings, regexes and numbers.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: keep all of Llama UI's tests under tests

The Model UI formatting spec moves to tests/unit and the button spec to
tests/client, next to the voice specs; the test projects now read only
tests/unit and tests/client.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: show a transcript's words without the model's own format

Qwen3-ASR names the language before its text (language French<asr_text>...) and
VibeVoice-ASR answers with timed segments as JSON, which the server passes on as they
are. The voice engine now takes both off, over HTTP and over the realtime socket, also
while segments still stream, so the message box and the clip show the words alone.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: dictate when a speech-to-text model is picked for the conversation

A speech-to-text model has audio input, so on Automatic the microphone recorded a voice
message for it, which such a model has nothing to answer with. It now dictates, as the
model's badge already says it is for.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: say why a live-only model cannot transcribe behind an API key

A browser websocket cannot send the API key, so the realtime socket is left out on a
server that needs one, and a model that only transcribes over it (Voxtral Realtime)
answers the HTTP route with a 501. The clip and the dictation toast now say so instead of
only that transcription is unavailable.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: pick the dictation model with a microphone on its row

The model that transcribes dictation was marked with a filled Dictation badge. It is now
marked by a red microphone among the row's actions in the model picker, beside the heart,
and every other model that hears shows the same microphone on hover: a click makes it the
transcription model, and a click on the chosen one hands the choice back to Automatic. The
badge keeps saying what kind of hearing model a row is, and the Models manager marks the
dictation model with a small microphone beside its name.

Assisted-by: Claude (Opus 5.5 Medium)

---------

Co-authored-by: Nicolas Mowen <14866235+NickM-27@users.noreply.github.com>
2026-11-20 16:34:52 +01:00
Aleksander Grygier
059cac2848
ui: search message content and Discover models from the search dialog (#32670)
* ui: search message content and Discover models from the search dialog

The search dialog matched chat titles only. It now also scans what was
said in each chat (content, reasoning, tool calls and results, attachment
names and text), newest chat first, stopping at the first match per chat
and after 20 chats, and shows a snippet around the match. Ids, timestamps
and base64 payloads are not searched.

With Discover on, it also lists matching catalog models and, once typing
settles, Hugging Face repos; picking one opens Discover on that repo.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: keep the search dialog one width whatever it lists

The shared dialog sizes itself to its content from md up, so the search
was narrow while empty and widened as results came in. It now takes the
full max-w-2xl there, less a margin on narrower windows.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-20 16:20:00 +01:00
Aleksander Grygier
cf4153a9ba
ui: publish llama-ui as an alias of @ggml-org/llama-ui (#32667)
The unscoped llama-ui on npm is a 0.0.1 placeholder. After the scoped
publish, the workflow renames the same build and publishes it again at
the same version, with a readme note pointing at the scoped package.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-20 15:46:18 +01:00
Aleksander Grygier
c6a25fc622
ui: load highlight.js languages on demand (#32661)
* ui: load highlight.js on first use

highlight.js and every lowlight language (~900 KB raw) moved out of
Llama Chat's first load into a chunk that loads with the first code block.

- @ggml-org/llama-ui/code: highlightCode stays synchronous. Until
  highlight.js has loaded it returns the code escaped as plain text and
  starts the load; a $derived or $effect that called it runs again once
  it has loaded. New loadHighlighter() and isHighlighterLoaded().
- Markdown: rehype-highlight runs through a lazy rehype step, like
  KaTeX's: the first message with a code block waits for it, every
  other one renders in the same pass.

First-load JS of the chat page: 3.47 -> 2.56 MB raw, 1.05 -> 0.75 MB
gzip, 0.84 -> 0.60 MB brotli.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: load each highlight.js language on first use

highlight.js now loads one language at a time instead of all ~190 at
once with the first code block: every language is its own chunk, and
the core loads with the first one.

- @ggml-org/llama-ui/code: highlightCode looks a language or alias up
  in a generated table (scripts/generate-highlight-languages.mjs), loads
  it with the languages it embeds (CSS and JavaScript inside HTML, say)
  and returns plain text until then; a $derived or $effect that called
  it runs again once it has loaded. Auto-detection picks among lowlight's
  37 common languages, loaded the first time something auto-detects.
  New loadHighlightLanguages(), isHighlightLanguageLoaded(),
  resolveHighlightLanguage() and getLoadedHighlightLanguages() replace
  loadHighlighter() and isHighlighterLoaded().
- Markdown: rehypeLazyHighlight highlights with lowlight's core and the
  languages a message uses, waiting only for one it is the first to use.
  rehype-highlight is no longer in the pipeline, since it bundles
  lowlight's common languages.

First-load JS of the chat page stays at 2.58 MB raw, 0.76 MB gzip,
0.61 MB brotli: no highlight.js code, only the 14 KB language table.
The first code block now loads its language (1-12 KB for most) and the
20 KB core instead of 900 KB.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: name the code-block class names and shell language as constants

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-20 15:06:10 +01:00
Aleksander Grygier
28de970cc1
ui : focus the chat form when typing with nothing focused (#32570)
A printable key pressed on the chat screen while no field, editor,
dialog or menu has focus now moves focus to the chat form, and the
character lands there.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-20 14:01:50 +01:00
Aleksander Grygier
b81aa847c2
ui: slim the design tokens and set all text through type roles (#32615)
* ui: drop component tokens that only alias a semantic token

A component token now exists only for what a component decides itself:
a value no semantic token has, or one that only this component changes
between themes. Components that take a semantic token as it is read it
directly, so 88 of the 118 component tokens go, with no change to what
is drawn.

Also drops semantic tokens that repeat another one (status-* is fill-*,
elevation-tooltip is elevation-surface), the unused info lamp tokens and
14 primitives nothing reads, and adds fg-soft for the label of an option
that is not the picked one (tabs, toggle group).

Assisted-by: Claude (Opus 5.5 Medium)

* ui: add a short summary on top of DESIGN.md

The rules most changes need, in one screen: components, colour, type,
shape, sizes, surfaces, tokens and no arbitrary values. The sections
below keep the detail.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: derive design tokens by rule and drop the alias layers

Semantic tokens are either a pick (a primitive per theme) or a derivation,
mixed from another semantic token by a fixed rule and declared once: hover
fills, status surfaces and lines, dark shadows (--elevation-strength), the
middle of a matte edge, a lamp's rim and glyph.

Primitives keep colours only. shadcn's colour names stay as Tailwind
utilities and no longer exist as variables; neutral semantic utilities that
duplicated them are gone.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: set all text through type roles and move off-scale values onto the scale

Tailwind's text sizes and bracketed sizes become the type roles, with a new
text-caption-sm (10px) for tags and counts. Body and caption roles no longer
set a weight, and line heights are written as Tailwind writes its own, so the
swap from text-sm and text-xs changes no pixel. A unit test keeps old sizes
from coming back.

Arbitrary values with a scale equivalent use it (z-20, max-w-4/5, min-w-32),
and the two easing curves repeated across the app are ease-out-quint and
ease-sheet. DESIGN.md is updated and regenerated.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: bump @ggml-org/llama-ui to 0.5.0

Removed and renamed tokens are breaking for an app that reads them.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: add a display type role for the biggest headline

The greeting on a new chat keeps its 30px from md up, now as text-display
instead of a Tailwind size.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: one corner scale, one set of shadows and three more derived tokens

Six corner roles named values Tailwind's rounded-md to rounded-4xl
already have, and components used the Tailwind names nine times out of
ten. The roles are gone; the whole scale is computed from --radius.

Tailwind's shadow sizes were restated next to the elevation tokens and
did not follow the theme, so they were five times fainter in dark. The
five uses take elevation tokens and a unit test keeps both from coming
back.

A button group's seam is the button's own text colour at 25%, the dark
status text is the dark status fill, and the pressed shadow scales with
--elevation-strength like the inset one.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-20 11:26:26 +01:00
Aleksander Grygier
9d6f04fa99
ui: show vision as glasses and audio as headphones (#32617)
The model modality icons match the ones the Llama apps use: glasses for
vision, headphones for audio. The attach menu's list of what the model
takes reads the same icons instead of its own microphone and picture.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-20 10:33:34 +01:00
Aleksander Grygier
6aee50801d
ui: set the reasoning effort from the model picker (#32632)
* ui: move the reasoning effort into the model picker

The chat form's row no longer holds the reasoning button: the model
picker ends with a Reasoning row, in place of Manage models, that shows
the level in use and opens the levels under it. A phone's model drawer
has the same row. A desktop server with a single model, whose selector
opens the manager instead of a picker, keeps the button beside it.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: show a reasoning effort that is not the default on the model selector

Next to the model on the closed selector, a set level shows as its word,
and reasoning that is off as a small crossed-out lightbulb. At the
default, which leaves it to the model, nothing more shows.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: keep the model picker's footer in place while it opens in Safari

WebKit pins a bottom-sticky element against the scaled box of a parent
that zooms in, so the Reasoning row rode up over the model list until
the opening animation ended. The desktop picker now scrolls its search
and list in a box of their own, with the footer under it.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-20 09:58:11 +01:00
Aleksander Grygier
55b8d8d898
ui: full-screen diagram preview that zooms around what is on screen, inert diagrams (#32591)
* ui: keep Pele diagrams inert

Pele turns a node with `click ... href` into a live link, where Mermaid's
strict security level left diagrams without links. Unwrap every link in
Pele's output, keeping its children, so the inline block, the live-preview
editor, the preview dialog and the downloaded svg stay inert. The Diagrams
story's flowchart now carries click directives and its play test checks
that no link or href is left.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: open diagrams full screen, zoom around what is on screen

The diagram preview dialog fills the window on every device. The preview
places the diagram from its top left corner, so a zoom keeps a screen point
fixed: the wheel and a trackpad pinch zoom around the pointer, the buttons
and +/- keys around the middle of the screen, wherever the diagram has been
panned to. Two-finger pinch, double-click and arrow keys work too. The
diagram opens fitted and keeps fitting until panned or zoomed; Reset view
fits it again.

Adds MermaidPreview and DialogMermaidPreview stories with play tests and a
unit test for the zoom math.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: add a diagrams trace to the demo fixtures

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-20 09:57:44 +01:00
Aleksander Grygier
80437488a4
ui: cut Llama Chat's first-load JavaScript by 63%, load diagrams, math and PDFs on demand (#32555)
* ui: import Lucide icons by path in modules that run in Node

Assisted-by: Claude (Opus 5.5 Medium)

* ui: register highlight.js languages once, from lowlight's modules

Assisted-by: Claude (Opus 5.5 Medium)

* ui: load the pdf.js worker and nerdamer as files of their own

Assisted-by: Claude (Opus 5.5 Medium)

* ui: draw Mermaid diagrams with Pele

Assisted-by: Claude (Opus 5.5 Medium)

* ui: pin dependency versions and use one Svelte across the UI packages

Assisted-by: Claude (Opus 5.5 Medium)

* ui: build Llama Chat as split chunks

Assisted-by: Claude (Opus 5.5 Medium)

* ui: load KaTeX and pdf.js on first use

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-19 08:37:35 +01:00