Commit 8355b8862 for llama.cpp

commit 8355b886250efcb490dec7431c3c0ec1463277a5
Author: Aleksander Grygier <aleksander.grygier@gmail.com>
Date:   Mon Nov 23 21:38:18 2026 +0100

    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)

diff --git a/ui/apps/chat/.storybook/preview.ts b/ui/apps/chat/.storybook/preview.ts
index 7e7a58d16..22f04dd88 100644
--- a/ui/apps/chat/.storybook/preview.ts
+++ b/ui/apps/chat/.storybook/preview.ts
@@ -1,7 +1,5 @@
 import '../src/app.css';
 import { MEDIA_QUERIES } from '#lib/constants/pwa.constants.ts';
-import { SurfaceTheme } from '#lib/enums/ui.enums.ts';
-import { applySurfaceTheme } from '#lib/utils/css.ts';
 // the docs pages' styles, shared with the library's Storybook
 import '../../../lib/ui/.storybook/docs.css';
 import { applyColorScheme } from './color-scheme';
@@ -97,31 +95,12 @@ const preview: Preview = {
 				],
 				title: 'Interaction pace'
 			}
-		},
-		// the light surface theme: Paper (white panels on a grey page) or Matte (grey glass on white)
-		surface: {
-			description: 'Light surface theme',
-			toolbar: {
-				dynamicTitle: true,
-				icon: 'paintbrush',
-				items: [
-					{ title: 'Paper', value: SurfaceTheme.PAPER },
-					{ title: 'Matte', value: SurfaceTheme.MATTE }
-				],
-				title: 'Surface'
-			}
 		}
 	},
 	initialGlobals: {
-		interactionPace: 'human',
-		surface: SurfaceTheme.PAPER
+		interactionPace: 'human'
 	},
 	decorators: [
-		(story, context) => {
-			applySurfaceTheme(context.globals.surface);
-
-			return story();
-		},
 		// `parameters.colorScheme` fixes a story to light or dark, whatever the viewer chose (a scene in a store screenshot)
 		(story, context) => ({
 			Component: ModeWatcherDecorator,
diff --git a/ui/apps/chat/DESIGN.md b/ui/apps/chat/DESIGN.md
index efbc65d93..fc624676d 100644
--- a/ui/apps/chat/DESIGN.md
+++ b/ui/apps/chat/DESIGN.md
@@ -5,8 +5,7 @@ description: >-
   Llama UI, the design system and components of Llama Chat, the chat client llama-server
   bundles. Neutral and quiet: frosted matte surfaces with faint
   blue-grey hairlines, near-flat fills, and status colours for success, warning, error and info. Tokens come in
-  three tiers: primitives, semantic tokens (with a "-dark" twin where dark mode differs and a
-  "-matte" twin where the Matte light theme does) and components. The colors, typography and
+  three tiers: primitives, semantic tokens (with a "-dark" twin where dark mode differs) and components. The colors, typography and
   rounded sections are generated from ui/lib/ui/src/lib/styles by `npm run design:tokens` in
   ui/apps/chat; spacing, components and the prose are kept in sync with the CSS by hand.
 colors:
@@ -123,14 +122,6 @@ colors:
   highlight-inverse: '{colors.white-a12}'
   sheen-start: '{colors.white-a20}'
   elevation-ring: '{colors.black-a5}'
-  surface-page-matte: '{colors.neutral-0}'
-  surface-glass-matte: 'oklch(0.97 0 0 / 0.6)'
-  surface-code-matte: '{colors.neutral-50}'
-  surface-success-matte: 'color-mix(in oklab, {colors.fill-success} 11%, {colors.surface-page-matte})'
-  surface-warning-matte: 'color-mix(in oklab, {colors.fill-warning} 11%, {colors.surface-page-matte})'
-  surface-danger-matte: 'color-mix(in oklab, {colors.fill-danger} 11%, {colors.surface-page-matte})'
-  surface-info-matte: 'color-mix(in oklab, {colors.fill-info} 11%, {colors.surface-page-matte})'
-  field-background-matte: '{colors.surface-page-matte}'
   surface-page-dark: '{colors.neutral-925}'
   surface-muted-dark: '{colors.neutral-800}'
   surface-emphasis-dark: '{colors.neutral-750}'
@@ -815,9 +806,8 @@ here. The `spacing` and `components` sections and the prose are written by hand;
 disagree with the CSS, the CSS wins and this file is updated to match. Storybook shows every
 tier under **Llama UI › Foundations › Colors**.

-Paper light mode is the base. A semantic token that resolves differently in dark mode has a
-`-dark` twin here, and one that resolves differently in Matte a `-matte` twin; components list
-a `-dark` entry wherever their colours change. Translucent component
+Light mode is the base. A semantic token that resolves differently in dark mode has a
+`-dark` twin here; components list a `-dark` entry wherever their colours change. Translucent component
 fills are given as they render over the page, so contrast checks see the real colour.

 ## Colors
@@ -841,12 +831,8 @@ creative (a shape, a numeral, an illustration). Artwork takes its colours from t
 the `art-*` primitives: the day sky and the night sky (llama.app's light and dark hero grounds) and
 cinder, the accent orange; never from the status colours, and never red.

-Light mode has two surface themes, which share everything else (the palette, buttons, fields,
-badges, shadows and dark mode): **Paper**, the default, sets white panels, fields and keys on a
-faint grey page (`neutral-25`); **Matte** sets grey glass on a white page. Matte is the
-`theme-matte` class on `<html>`, chosen with the Light surfaces setting (Settings → General) or
-the Surface switch in Storybook's toolbar, and only its surface tokens differ: `surface-page`,
-`surface-glass`, `surface-code`, `field-background` and `float-panel-background-modal`.
+Light mode sets white panels, fields and keys on a faint grey page (`neutral-25`). Dark mode shares the
+palette, buttons, fields, badges and shadows.

 - **Surfaces:** `surface-page` for the page, `surface-muted` for quiet panels,
   `surface-emphasis` and `surface-selected` for stronger fills and hover or selected rows,
diff --git a/ui/apps/chat/scripts/design-md.js b/ui/apps/chat/scripts/design-md.js
index 94c90b1f5..385d99e3c 100644
--- a/ui/apps/chat/scripts/design-md.js
+++ b/ui/apps/chat/scripts/design-md.js
@@ -28,10 +28,7 @@ const SOURCES = {
 	theme: fileURLToPath(new URL('theme.css', styles))
 };
 // the selectors of the themes a semantic token may change in, and the suffix its twin takes here
-const THEMES = [
-	{ selector: '.theme-matte:not(.dark)', suffix: '-matte' },
-	{ selector: '.dark', suffix: '-dark' }
-];
+const THEMES = [{ selector: '.dark', suffix: '-dark' }];
 // the type roles, by the @theme names Tailwind turns into text-body, text-label-sm, ...: a size with a line height
 const TYPE_ROLE = /^--text-([a-z]+(?:-[a-z]+)*)$/;
 // body and caption text takes the weight around it, which is regular unless a parent says otherwise
diff --git a/ui/apps/chat/src/lib/components/app/settings/SettingsChat/SettingsChat.svelte b/ui/apps/chat/src/lib/components/app/settings/SettingsChat/SettingsChat.svelte
index d54d56a20..fd058cea6 100644
--- a/ui/apps/chat/src/lib/components/app/settings/SettingsChat/SettingsChat.svelte
+++ b/ui/apps/chat/src/lib/components/app/settings/SettingsChat/SettingsChat.svelte
@@ -21,7 +21,6 @@
 	import { ColorMode } from '#lib/enums/ui.enums.ts';
 	import { modelsStore, serverStore, settingsStore } from '#lib/stores/index.ts';
 	import type { SettingsSection, SettingsSectionTitle } from '#lib/types/index.ts';
-	import { applySurfaceTheme } from '#lib/utils/index.ts';
 	import { setMode } from 'mode-watcher';
 	import { fade } from 'svelte/transition';
 	interface Props {
@@ -91,9 +90,6 @@
 	function handleConfigChange(key: string, value: string | boolean) {
 		localConfig[key] = value;

-		// the surface theme previews at once, like the colour theme
-		if (key === SETTINGS_KEYS.SURFACE_THEME) applySurfaceTheme(value);
-
 		// discover needs the hub metadata reads: checking it turns the hub on,
 		// unchecking it turns the hub back off, so the checkbox never lies
 		if (key === SETTINGS_KEYS.ENABLE_DISCOVER_MODELS) {
@@ -108,7 +104,6 @@
 	function handleReset() {
 		localConfig = { ...settingsStore.config };
 		setMode(localConfig.theme as ColorMode);
-		applySurfaceTheme(localConfig[SETTINGS_KEYS.SURFACE_THEME]);
 		mobileHeader?.updateCarousel();
 	}

diff --git a/ui/apps/chat/src/lib/constants/settings-keys.constants.ts b/ui/apps/chat/src/lib/constants/settings-keys.constants.ts
index b3d37b0e0..375b935b0 100644
--- a/ui/apps/chat/src/lib/constants/settings-keys.constants.ts
+++ b/ui/apps/chat/src/lib/constants/settings-keys.constants.ts
@@ -73,7 +73,6 @@ export const SETTINGS_KEYS = {
 	SHOW_THOUGHT_IN_PROGRESS: 'showThoughtInProgress',
 	SHOW_TOOL_CALL_IN_PROGRESS: 'showToolCallInProgress',
 	SINGLE_ROW_CHAT_FORM: 'singleRowChatForm',
-	SURFACE_THEME: 'surfaceTheme',
 	SYMBOLIC_MATH_ENABLED: 'symbolicMathEnabled',
 	SYSTEM_MESSAGE: 'systemMessage',
 	// Sampling
diff --git a/ui/apps/chat/src/lib/constants/settings.constants.ts b/ui/apps/chat/src/lib/constants/settings.constants.ts
index 0c4d4c250..3109299c3 100644
--- a/ui/apps/chat/src/lib/constants/settings.constants.ts
+++ b/ui/apps/chat/src/lib/constants/settings.constants.ts
@@ -11,9 +11,7 @@ import { VOICE_MICROPHONE_AUTO } from '@ggml-org/llama-voice';
 import AudioLines from '@lucide/svelte/icons/audio-lines';
 import Code from '@lucide/svelte/icons/code';
 import Database from '@lucide/svelte/icons/database';
-import File from '@lucide/svelte/icons/file';
 import Funnel from '@lucide/svelte/icons/funnel';
-import GlassWater from '@lucide/svelte/icons/glass-water';
 import ListRestart from '@lucide/svelte/icons/list-restart';
 import Mic from '@lucide/svelte/icons/mic';
 import Monitor from '@lucide/svelte/icons/monitor';
@@ -22,7 +20,7 @@ import PencilRuler from '@lucide/svelte/icons/pencil-ruler';
 import SlidersVertical from '@lucide/svelte/icons/sliders-vertical';
 import Sun from '@lucide/svelte/icons/sun';
 import TextCursorInput from '@lucide/svelte/icons/text-cursor-input';
-import { SurfaceTheme, SyncableParameterType, VoiceInputMode } from '#lib/enums/index.ts';
+import { SyncableParameterType, VoiceInputMode } from '#lib/enums/index.ts';
 import { SettingsFieldType } from '#lib/enums/settings.enums.ts';
 import { ColorMode } from '#lib/enums/ui.enums.ts';
 import type {
@@ -84,17 +82,6 @@ export const SETTINGS_REGISTRY: SettingsSectionEntry[] = [
 				],
 				type: SettingsFieldType.SELECT
 			},
-			{
-				defaultValue: SurfaceTheme.PAPER,
-				help: 'Choose how the light theme draws its surfaces: Paper puts white panels, fields and buttons on a faint grey page; Matte puts grey glass on a white page. Dark mode is the same for both.',
-				key: SETTINGS_KEYS.SURFACE_THEME,
-				label: 'Light surfaces',
-				options: [
-					{ icon: File, label: 'Paper', value: SurfaceTheme.PAPER },
-					{ icon: GlassWater, label: 'Matte', value: SurfaceTheme.MATTE }
-				],
-				type: SettingsFieldType.SELECT
-			},
 			{
 				defaultValue: '',
 				help: `Set the API Key if you are using <code> ${CLI_FLAGS.API_KEY} </code> option for the server.`,
diff --git a/ui/apps/chat/src/lib/enums/index.ts b/ui/apps/chat/src/lib/enums/index.ts
index 1c42190aa..9fb53f8af 100644
--- a/ui/apps/chat/src/lib/enums/index.ts
+++ b/ui/apps/chat/src/lib/enums/index.ts
@@ -105,7 +105,6 @@ export {
 	ScrollCarouselVariant,
 	SidebarAction,
 	SidebarSectionKind,
-	SurfaceTheme,
 	TooltipSide,
 	UrlProtocol
 } from './ui.enums';
diff --git a/ui/apps/chat/src/lib/enums/ui.enums.ts b/ui/apps/chat/src/lib/enums/ui.enums.ts
index c46059434..fd55508d0 100644
--- a/ui/apps/chat/src/lib/enums/ui.enums.ts
+++ b/ui/apps/chat/src/lib/enums/ui.enums.ts
@@ -1,11 +1,5 @@
 export { ColorMode, MouseButton, PointerType, TooltipSide } from '@ggml-org/llama-ui/enums';

-/** The light surface theme: Paper (white panels on a faint grey page) or Matte (grey glass on white). */
-export enum SurfaceTheme {
-	MATTE = 'matte',
-	PAPER = 'paper'
-}
-
 /**
  * ScrollCarousel arrow placement.
  */
diff --git a/ui/apps/chat/src/lib/utils/css.ts b/ui/apps/chat/src/lib/utils/css.ts
index eaca26f1b..99351a7f4 100644
--- a/ui/apps/chat/src/lib/utils/css.ts
+++ b/ui/apps/chat/src/lib/utils/css.ts
@@ -1,15 +1,3 @@
-import { SurfaceTheme } from '#lib/enums/index.ts';
-
-/**
- * Applies the light surface theme: Matte sets the theme-matte class on <html>, which the tokens
- * read (see tokens/semantic.css); Paper, the default, needs no class.
- */
-export function applySurfaceTheme(theme: unknown): void {
-	if (typeof document === 'undefined') return;
-
-	document.documentElement.classList.toggle('theme-matte', theme === SurfaceTheme.MATTE);
-}
-
 /**
  * Converts a rem CSS value to pixels based on the document root font size.
  */
diff --git a/ui/apps/chat/src/lib/utils/index.ts b/ui/apps/chat/src/lib/utils/index.ts
index c1e2ee4a1..ae28ff9cd 100644
--- a/ui/apps/chat/src/lib/utils/index.ts
+++ b/ui/apps/chat/src/lib/utils/index.ts
@@ -390,7 +390,7 @@ export { type GgufMetadata, type GgufValue, readGgufMetadata } from './gguf-meta
 export { uuid } from './uuid';

 // CSS utilities
-export { applySurfaceTheme, remToPx } from './css';
+export { remToPx } from './css';

 // Audio format helper (used by agentic store and chat service)
 export { getAudioInputFormat } from './audio-format';
diff --git a/ui/apps/chat/src/routes/+layout.svelte b/ui/apps/chat/src/routes/+layout.svelte
index 8dfebfe4c..8fcef551b 100644
--- a/ui/apps/chat/src/routes/+layout.svelte
+++ b/ui/apps/chat/src/routes/+layout.svelte
@@ -33,7 +33,7 @@
 	} from '#lib/stores/index.ts';
 	import { initStores } from '#lib/stores/init.ts';
 	import { withBase } from '#lib/utils/base-path.ts';
-	import { applySurfaceTheme, hapticTap } from '#lib/utils/index.ts';
+	import { hapticTap } from '#lib/utils/index.ts';
 	import { browser } from '$app/env';
 	import { afterNavigate, goto } from '$app/navigation';
 	import { page } from '$app/state';
@@ -53,11 +53,6 @@

 	let chatSidebar: { editActiveConversation?: () => void } | undefined = $state();

-	// the light surface theme (Paper or Matte) follows the saved setting
-	$effect(() => {
-		applySurfaceTheme(settingsStore.config[SETTINGS_KEYS.SURFACE_THEME]);
-	});
-
 	let showBuildVersion = $derived(
 		settingsStore.config[SETTINGS_KEYS.SHOW_BUILD_VERSION] as boolean
 	);
diff --git a/ui/lib/ui/.storybook/preview.ts b/ui/lib/ui/.storybook/preview.ts
index 05ff2ad7c..c1793e104 100644
--- a/ui/lib/ui/.storybook/preview.ts
+++ b/ui/lib/ui/.storybook/preview.ts
@@ -49,30 +49,7 @@ const preview: Preview = {
 			test: 'todo'
 		}
 	},
-	globalTypes: {
-		// the light surface theme: Paper (white panels on a grey page) or Matte (grey glass on white)
-		surface: {
-			description: 'Light surface theme',
-			toolbar: {
-				dynamicTitle: true,
-				icon: 'paintbrush',
-				items: [
-					{ title: 'Paper', value: 'paper' },
-					{ title: 'Matte', value: 'matte' }
-				],
-				title: 'Surface'
-			}
-		}
-	},
-	initialGlobals: {
-		surface: 'paper'
-	},
 	decorators: [
-		(story, context) => {
-			document.documentElement.classList.toggle('theme-matte', context.globals.surface === 'matte');
-
-			return story();
-		},
 		// `parameters.colorScheme` fixes a story to light or dark, whatever the viewer chose (a scene in a store screenshot)
 		(story, context) => ({
 			Component: ModeWatcherDecorator,
diff --git a/ui/lib/ui/README.md b/ui/lib/ui/README.md
index 60abf7592..83a42f33d 100644
--- a/ui/lib/ui/README.md
+++ b/ui/lib/ui/README.md
@@ -27,7 +27,7 @@ beside the apps built on it in `ui/apps`.
   `tw-animate-css` (both peer dependencies) and `@ggml-org/llama-brand`'s `css/colors.css` imported before it.
 - `tokens.css`: the three tiers of tokens only, also after `@ggml-org/llama-brand`'s `css/colors.css`. `fonts.css`: Llama Sans and Llama Mono. `surfaces.css`: the matte
   surface utilities.
-- Dark mode is the `dark` class on `<html>`; the Matte light surfaces are the `theme-matte` class.
+- Dark mode is the `dark` class on `<html>`.

 ## What's in it

diff --git a/ui/lib/ui/src/lib/styles/theme.css b/ui/lib/ui/src/lib/styles/theme.css
index 4f89b2571..03ff92773 100644
--- a/ui/lib/ui/src/lib/styles/theme.css
+++ b/ui/lib/ui/src/lib/styles/theme.css
@@ -10,7 +10,7 @@
  *   @import '@ggml-org/llama-brand/css/colors.css';
  *   @import '@ggml-org/llama-ui/theme.css';
  *
- * Dark mode is the `dark` class on <html>; the Matte light surfaces are the `theme-matte` class.
+ * Dark mode is the `dark` class on <html>.
  */

 @import './fonts.css';
diff --git a/ui/lib/ui/src/lib/styles/tokens/components.css b/ui/lib/ui/src/lib/styles/tokens/components.css
index 43e5fc345..24e6143b4 100644
--- a/ui/lib/ui/src/lib/styles/tokens/components.css
+++ b/ui/lib/ui/src/lib/styles/tokens/components.css
@@ -71,11 +71,6 @@
 	/* status lamps and orbs read the status tokens through orb-danger and friends */
 }

-/* Matte: dialogs on the page colour (white), like the page under them */
-.theme-matte:not(.dark) {
-	--float-panel-background-modal: var(--surface-page);
-}
-
 .dark {
 	/* in dark the keys stay frosted glass and quiet fills, lighter than the page */
 	--button-secondary-background: var(--surface-glass);
diff --git a/ui/lib/ui/src/lib/styles/tokens/semantic.css b/ui/lib/ui/src/lib/styles/tokens/semantic.css
index 2301689a0..842e70859 100644
--- a/ui/lib/ui/src/lib/styles/tokens/semantic.css
+++ b/ui/lib/ui/src/lib/styles/tokens/semantic.css
@@ -6,15 +6,13 @@
  * mixed from another semantic token by a fixed rule and so follows it through every theme. The rules:
  * soft text is the text colour at 70%; a hover fill is the fill at 90%; a status surface is its fill mixed
  * into the page and a status line its fill mixed into the default line; a dark shadow is the light one,
- * --elevation-strength times as dense. Derivations are declared once, in :root: .dark and .theme-matte sit
- * on the same element, so they resolve from that theme's picks.
+ * --elevation-strength times as dense. Derivations are declared once, in :root: .dark sits on the
+ * same element, so they resolve from that theme's picks.
  *
- * Light mode comes in two surface themes that share everything else (colours, buttons, fields,
- * shadows): Paper, the default, puts white panels, fields and keys on a faint grey page; Matte
- * (the theme-matte class on <html>) puts grey glass on a white page.
+ * The light surfaces are paper: white panels, fields and keys on a faint grey page.
  */
 :root {
-	/* surfaces: what a region of the page sits on. Paper: the page a faint grey, so glass, fields
+	/* surfaces: what a region of the page sits on. The page a faint grey, so glass, fields
 	   and keys, white, sit lighter than it */
 	--surface-page: var(--neutral-25);
 	--surface-muted: var(--neutral-100);
@@ -133,14 +131,6 @@
 	--blur-control: 0.75rem;
 }

-/* Matte, the alternative light theme: grey glass on a white page, fields on the page colour */
-.theme-matte:not(.dark) {
-	--surface-page: var(--neutral-0);
-	--surface-glass: color-mix(in oklch, var(--neutral-100) 60%, transparent);
-	--surface-code: var(--neutral-50);
-	--field-background: var(--surface-page);
-}
-
 .dark {
 	--surface-page: var(--neutral-925);
 	--surface-muted: var(--neutral-800);