llama.cpp
9e93cd80 - ui: a Storybook for Llama UI and Llama Chat (#32485)

Commit
1 day ago
ui: a Storybook for Llama UI and Llama Chat (#32485) * ui: Llama UI's own Storybook in ui/lib/ui The library gets its Storybook (`npm run storybook`, `npm run build-storybook`) with a story for everything it holds, under Llama UI: the foundations, the 29 base components (as actions, forms, display, overlays and navigation), the app components (ActionIcon, SearchInput, SyntaxHighlightedCode), the Model UI and the native app mockups. The stories import the package by its published names, aliased onto src/lib, run as tests under `npm test` (the storybook project in vite.config.ts), and are type-checked with the rest of the package. `npm run dev` starts Storybook next to the SvelteKit check page; the toolbar switches the color mode and the surface theme, and pages that are mostly prose are .svx, through mdsvex. Assisted-by: Claude (Opus 5.5 Medium) * ui: a Storybook for Llama Chat Llama Chat's Storybook gets an introduction, Agents › Design guidelines (DESIGN.md), Llama UI's stories as the library has them, and Llama Chat: its own foundations (safe areas, the splash screens), then one section per src/lib/components/app/<area> (Chat with the chat screen, form, messages, attachments and tabs; Content, Models, MCP, Navigation, Settings, Dialogs, Forms, Actions, Badges, Misc, Servers and PWA), each accessibility story next to its component's. It replaces the flat pages it had (chat message, chat form, markdown content, the PWA refresh alert and their fixtures, and the ChatForm single-row exploration). The stories run on the new tokens and surfaces with the color mode and surface theme in the toolbar (by mode-watcher's key, the ColorMode and SurfaceTheme enums and applySurfaceTheme), and pages that are mostly prose are .svx in an editorial frame (AGENTS.md says how to write them and where a story goes). The story tests run Llama Chat's stories and leave the library's to the library. The brand and communications pages are in ggml-org/llama-brand; the logo files come from @ggml-org/llama-brand. Assisted-by: Claude (Opus 5.5 Medium) * ui: let the ChatScreen story store its reply before the next one starts The ContinueConversation story ended while its reply was still being stored, and the next story reset the stores under it. It now waits for the reply to finish. Assisted-by: Claude (Fable 5.2) * ui: publish the Storybook to its Hugging Face Space on every UI change A new UI Storybook workflow builds ui/apps/chat's Storybook whenever ui/apps/chat or ui/lib/ui changes on master (or on demand) and uploads it to the static Space ggml-org/Llama-UI-storybook, with a Space card naming the commit it was built from. Files the new build no longer has are removed; the Space's .gitattributes stays. It runs only in ggml-org/llama.cpp, takes the UI's Hugging Face token (HF_TOKEN_UI_STATIC_OUTPUT), and the Space can be changed with the HF_SPACE_UI_STORYBOOK variable. Assisted-by: Claude (Opus 5.5 Medium) * ui: run the library's tests, its stories among them, in CI The Library checks job type-checked and packed ui/lib/ui but never ran its tests, so the library's stories, which now hold every library component's, went untested in CI. It installs Chromium and runs `npm test`. Assisted-by: Claude (Opus 5.5 Medium) * ui: draw a floating panel's rim on its border, so its edge is one line Menus, popovers, dialogs and the other matte-float panels carry a 1px border that the surface made transparent, and drew their inner highlight as an inset shadow. An inset shadow sits inside the border, so the 1px of fill between it and the outer ring showed as a second edge. The border now draws the highlight, right inside the ring. Assisted-by: Claude (Opus 5.5 Medium)
Author
Parents
Loading