feat(settings): Inter as default UI font + UI font picker (T-460)

Vendor Inter (variable + italic, OFL) under assets/fonts/inter/ and make it
the default application UI face, replacing Josefin Sans (which stays bundled
as a selectable option). pubspec font family + licenses.yaml entry per D-42.

Settings → Appearance gains a UI-font select (Inter / Josefin Sans). The root
DefaultTextStyle reads app.ui.font (kUiFontSettingKey) over the default and
re-applies live on settings change, so a pick takes effect immediately. Bump
the default UI weight to w400 — Inter reads better at Regular than Josefin's
Light.

The monospace picker is deferred to T-471: clideMonoFamily is a const at ~38
call sites (not inherited), so a live mono picker needs the family routed
through context first.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-17 20:15:01 +02:00
co-authored by Claude Opus 4.8
parent b1057b41c8
commit 21d435d1f1
12 changed files with 219 additions and 17 deletions
@@ -5918,3 +5918,6 @@ INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, chang
INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, changed_by, changed_at, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FD15W7SBVAD3QR5NVE67PKWR', 'status', 'ready', 'in_progress', NULL, '2026-06-17 12:11:21', '2026-06-17 12:11:21.874', '2026-06-17 12:11:21.874', NULL, '20c4f05dc5ffc8a29a0e6c2f94dfaf4b', 2) ON CONFLICT(hash) DO NOTHING;
INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, changed_by, changed_at, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FDB1VFADV4QK1YG29T658T8C', 'description', NULL, 'Follow-up to T-457. The Claude settings category sets new-session defaults (model/effort/permission) via generic schema selects — those persist + seed NEW sessions but don''t touch running ones. Add the ''Claude settings changes detected — apply to current sessions?'' prompt: on a default change with ≥1 running session, confirm via DialogRouter, then apply to all sessions through the existing builtin.claude/command channel (/model, /effort, /permissions). Needs a custom control (the generic select can''t prompt), so swap the Claude category''s selects for a custom-control widget per D-? / the T-452 escape hatch.', NULL, '2026-06-17 12:21:31', '2026-06-17 12:21:31.456', '2026-06-17 12:21:31.456', NULL, '799b77b6ec7862c856957d948326cffd', 2) ON CONFLICT(hash) DO NOTHING;
INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, changed_by, changed_at, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FD15W7SBVAD3QR5NVE67PKWR', 'status', 'in_progress', 'done', NULL, '2026-06-17 12:21:39', '2026-06-17 12:21:39.311', '2026-06-17 12:21:39.311', NULL, 'dd983e8a5ccfae1b0dea46a8b5e78249', 2) ON CONFLICT(hash) DO NOTHING;
INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, changed_by, changed_at, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FD91A7VEW3VCY7QX1END2Z3G', 'status', 'backlog', 'in_progress', NULL, '2026-06-17 18:04:55', '2026-06-17 18:04:55.887', '2026-06-17 18:04:55.887', NULL, '227e7299a000813f50e7036f018322bf', 2) ON CONFLICT(hash) DO NOTHING;
INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, changed_by, changed_at, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FDDJ17C3GZWNE98NRVXP189C', 'description', NULL, 'Follow-up to T-460. T-460 shipped the UI-font picker (live via the root DefaultTextStyle, single seam) + bundled Inter as default. The MONOSPACE picker is deferred because clideMonoFamily is referenced as a const in ~38 sites (terminal, diff, code blocks, ClideText fontFamily) — not inherited. To make the mono picker apply live, route the mono family through context (a small FontScope InheritedWidget or the theme) read by those sites, then add a ''Monospace font'' select in Appearance writing app.mono.font (kMonoFontSettingKey already defined in typography.dart). Default JetBrains Mono.', NULL, '2026-06-17 18:11:49', '2026-06-17 18:11:49.697', '2026-06-17 18:11:49.697', NULL, '54ec9200fb4cd124e3413a6e134575ea', 2) ON CONFLICT(hash) DO NOTHING;
INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, changed_by, changed_at, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FD91A7VEW3VCY7QX1END2Z3G', 'status', 'in_progress', 'done', NULL, '2026-06-17 18:14:38', '2026-06-17 18:14:38.272', '2026-06-17 18:14:38.272', NULL, '9c7cb301a7539212e90bf16210684d97', 2) ON CONFLICT(hash) DO NOTHING;
+50
View File
@@ -7187,3 +7187,53 @@ INSERT INTO tickets (record_id, type, parent_record_id, title, description, stat
INSERT INTO tickets (record_id, type, parent_record_id, title, description, status, priority, assigned_to, team, decision_ref, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FDB1VFADV4QK1YG29T658T8C', 'task', '06FD07ECS3GK2V7Z2WYYPJHJYC', 'Claude defaults: ''apply to current sessions?'' prompt on change', NULL, 'backlog', 'medium', NULL, NULL, NULL, '2026-06-17 12:21:23.411', '2026-06-17 12:21:23.411', NULL, '924eef1841e09a2a49c1c39d9bfc1331', 2) ON CONFLICT(record_id) DO UPDATE SET type=excluded.type, parent_record_id=excluded.parent_record_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at > tickets.updated_at OR (excluded.updated_at = tickets.updated_at AND excluded.hash > tickets.hash);
INSERT INTO tickets (record_id, type, parent_record_id, title, description, status, priority, assigned_to, team, decision_ref, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FDB1VFADV4QK1YG29T658T8C', 'task', '06FD07ECS3GK2V7Z2WYYPJHJYC', 'Claude defaults: ''apply to current sessions?'' prompt on change', 'Follow-up to T-457. The Claude settings category sets new-session defaults (model/effort/permission) via generic schema selects — those persist + seed NEW sessions but don''t touch running ones. Add the ''Claude settings changes detected — apply to current sessions?'' prompt: on a default change with ≥1 running session, confirm via DialogRouter, then apply to all sessions through the existing builtin.claude/command channel (/model, /effort, /permissions). Needs a custom control (the generic select can''t prompt), so swap the Claude category''s selects for a custom-control widget per D-? / the T-452 escape hatch.', 'backlog', 'medium', NULL, NULL, NULL, '2026-06-17 12:21:23.411', '2026-06-17 12:21:31.456', NULL, '61f297cc5f01d6f6e43e1fa64efd4875', 2) ON CONFLICT(record_id) DO UPDATE SET type=excluded.type, parent_record_id=excluded.parent_record_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at > tickets.updated_at OR (excluded.updated_at = tickets.updated_at AND excluded.hash > tickets.hash);
INSERT INTO tickets (record_id, type, parent_record_id, title, description, status, priority, assigned_to, team, decision_ref, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FD15W7SBVAD3QR5NVE67PKWR', 'task', '06FD07ECS3GK2V7Z2WYYPJHJYC', 'Claude settings category — mirror the sidebar Config panel', 'Mirror lib/builtin/claude/src/meta_sidebar/config_tab.dart in the settings modal: SETTINGS controls (model / effort / permission mode / output style via SettingControlRow publishing the slash command on the live session, D-6 / T-414) plus carded config lists (Skills / Agents / Commands / Hooks / Permissions / MCP Servers) that open their .md (T-183). Reuse the data the sidebar already loads (ClaudeConfig). Wireframe: docs/design/wireframes/settings/settings-claude.png.', 'done', 'medium', NULL, NULL, NULL, '2026-06-16 13:20:52', '2026-06-17 12:21:39.311', NULL, '2f3f27095398a0a0e0240b2e0eac34c2', 2) ON CONFLICT(record_id) DO UPDATE SET type=excluded.type, parent_record_id=excluded.parent_record_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at > tickets.updated_at OR (excluded.updated_at = tickets.updated_at AND excluded.hash > tickets.hash);
INSERT INTO tickets (record_id, type, parent_record_id, title, description, status, priority, assigned_to, team, decision_ref, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FD91A7VEW3VCY7QX1END2Z3G', 'task', '06FD07ECS3GK2V7Z2WYYPJHJYC', 'Appearance: UI + monospace font pickers (bundle Inter as the default UI font)', 'Add two font pickers to the **Appearance** tab of the new settings UI (renders alongside the theme picker, T-452; uses the schema field renderer T-448 and the sectioned-card layout from T-302 / ui-design `surface.md`). Part of the builtin.settings-ui epic (T-444).
**Two controls (enum/select fields in the Appearance "TYPOGRAPHY" card):**
- **UI font** the proportional/sans face used for app chrome + prose (today `clideUiFamily`, currently JosefinSans Light 300 via `DefaultTextStyle`).
- **Monospace font** the code/paths/IDs/terminal/editor face (today `clideMonoFamily` = JetBrainsMono).
- Each option renders its label **in its own face** as an inline preview.
**Bake in Inter as the default UI font.**
- Bundle **Inter** (https://fonts.google.com/specimen/Inter SIL Open Font License 1.1, Rasmus Andersson) under `assets/fonts/inter/`, register it in `pubspec.yaml` `fonts:`, and add the `assets/licenses.yaml` entry in the SAME commit (D-42 two-step rule). Make Inter the default UI font, replacing JosefinSans Light as the shipped default. Keep **JetBrainsMono** as the default mono.
**Font registry + wiring (the real work):**
- A small curated registry of bundled faces per role (UI: Inter + 12 others; mono: JetBrainsMono + 12 others) so the pickers have real options without a system-font crawl (v1 = bundled-only; system-font enumeration can be a follow-up).
- `lib/widgets/src/typography.dart` `clideUiFamily` / `clideMonoFamily` are constants today make them resolve from the active setting (and update `root_shell.dart`''s `DefaultTextStyle` + every `fontFamily: clideMonoFamily` consumer: editor, terminal, code blocks, markdown, path/ID text). The terminal (`xterm.dart` fork) takes its own font config route the mono setting there too.
- Persist as settings keys (e.g. `appearance.font.ui`, `appearance.font.mono`) through the SettingsStore schema the renderer reads; scope via the standard model (Always/global default, project override allowed) see T-449.
**Acceptance:**
- Inter ships and is the default UI font on a fresh install; JetBrainsMono remains default mono. licenses.yaml documents Inter (+ any other added faces).
- UI + mono pickers in the Appearance tab change the live app font and persist across restart, at the chosen scope.
- Each picker previews options in-face; unknown/removed font falls back gracefully to the default.
- No contrast/a11y regression (re-run the contrast gate; faces are metric-different but token colours unchanged).
**Files:** `pubspec.yaml` (fonts:), `assets/fonts/inter/`, `assets/licenses.yaml`, `lib/widgets/src/typography.dart`, `lib/src/shell/root_shell.dart` (DefaultTextStyle), mono consumers (editor / terminal / markdown / code-block), the Appearance settings category (T-452) + schema registration.
**Related:** T-444 (epic), T-452 (Appearance category where these render), T-448 (field renderer), T-449 (scope), ui-design `theme.md` (typography section: clideUiFamily / clideMonoFamily / clideFont* sizes), D-42 (bundled-dep documentation), D-44 (theming).', 'in_progress', 'medium', NULL, NULL, NULL, '2026-06-17 07:39:25.019', '2026-06-17 18:04:55.886', NULL, '1a2523c3f827cd90a373427f2895a87c', 2) ON CONFLICT(record_id) DO UPDATE SET type=excluded.type, parent_record_id=excluded.parent_record_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at > tickets.updated_at OR (excluded.updated_at = tickets.updated_at AND excluded.hash > tickets.hash);
INSERT INTO tickets (record_id, type, parent_record_id, title, description, status, priority, assigned_to, team, decision_ref, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FDDJ17C3GZWNE98NRVXP189C', 'task', '06FD07ECS3GK2V7Z2WYYPJHJYC', 'Settings → Appearance: monospace font picker (needs context-driven mono family)', NULL, 'backlog', 'medium', NULL, NULL, NULL, '2026-06-17 18:11:42.049', '2026-06-17 18:11:42.049', NULL, '77cf08e7fff9bed103494aeeed8c7185', 2) ON CONFLICT(record_id) DO UPDATE SET type=excluded.type, parent_record_id=excluded.parent_record_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at > tickets.updated_at OR (excluded.updated_at = tickets.updated_at AND excluded.hash > tickets.hash);
INSERT INTO tickets (record_id, type, parent_record_id, title, description, status, priority, assigned_to, team, decision_ref, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FDDJ17C3GZWNE98NRVXP189C', 'task', '06FD07ECS3GK2V7Z2WYYPJHJYC', 'Settings → Appearance: monospace font picker (needs context-driven mono family)', 'Follow-up to T-460. T-460 shipped the UI-font picker (live via the root DefaultTextStyle, single seam) + bundled Inter as default. The MONOSPACE picker is deferred because clideMonoFamily is referenced as a const in ~38 sites (terminal, diff, code blocks, ClideText fontFamily) — not inherited. To make the mono picker apply live, route the mono family through context (a small FontScope InheritedWidget or the theme) read by those sites, then add a ''Monospace font'' select in Appearance writing app.mono.font (kMonoFontSettingKey already defined in typography.dart). Default JetBrains Mono.', 'backlog', 'medium', NULL, NULL, NULL, '2026-06-17 18:11:42.049', '2026-06-17 18:11:49.697', NULL, '2e4cf96e04c1be6ce99cac33c4350d3c', 2) ON CONFLICT(record_id) DO UPDATE SET type=excluded.type, parent_record_id=excluded.parent_record_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at > tickets.updated_at OR (excluded.updated_at = tickets.updated_at AND excluded.hash > tickets.hash);
INSERT INTO tickets (record_id, type, parent_record_id, title, description, status, priority, assigned_to, team, decision_ref, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FD91A7VEW3VCY7QX1END2Z3G', 'task', '06FD07ECS3GK2V7Z2WYYPJHJYC', 'Appearance: UI + monospace font pickers (bundle Inter as the default UI font)', 'Add two font pickers to the **Appearance** tab of the new settings UI (renders alongside the theme picker, T-452; uses the schema field renderer T-448 and the sectioned-card layout from T-302 / ui-design `surface.md`). Part of the builtin.settings-ui epic (T-444).
**Two controls (enum/select fields in the Appearance "TYPOGRAPHY" card):**
- **UI font** the proportional/sans face used for app chrome + prose (today `clideUiFamily`, currently JosefinSans Light 300 via `DefaultTextStyle`).
- **Monospace font** the code/paths/IDs/terminal/editor face (today `clideMonoFamily` = JetBrainsMono).
- Each option renders its label **in its own face** as an inline preview.
**Bake in Inter as the default UI font.**
- Bundle **Inter** (https://fonts.google.com/specimen/Inter SIL Open Font License 1.1, Rasmus Andersson) under `assets/fonts/inter/`, register it in `pubspec.yaml` `fonts:`, and add the `assets/licenses.yaml` entry in the SAME commit (D-42 two-step rule). Make Inter the default UI font, replacing JosefinSans Light as the shipped default. Keep **JetBrainsMono** as the default mono.
**Font registry + wiring (the real work):**
- A small curated registry of bundled faces per role (UI: Inter + 12 others; mono: JetBrainsMono + 12 others) so the pickers have real options without a system-font crawl (v1 = bundled-only; system-font enumeration can be a follow-up).
- `lib/widgets/src/typography.dart` `clideUiFamily` / `clideMonoFamily` are constants today make them resolve from the active setting (and update `root_shell.dart`''s `DefaultTextStyle` + every `fontFamily: clideMonoFamily` consumer: editor, terminal, code blocks, markdown, path/ID text). The terminal (`xterm.dart` fork) takes its own font config route the mono setting there too.
- Persist as settings keys (e.g. `appearance.font.ui`, `appearance.font.mono`) through the SettingsStore schema the renderer reads; scope via the standard model (Always/global default, project override allowed) see T-449.
**Acceptance:**
- Inter ships and is the default UI font on a fresh install; JetBrainsMono remains default mono. licenses.yaml documents Inter (+ any other added faces).
- UI + mono pickers in the Appearance tab change the live app font and persist across restart, at the chosen scope.
- Each picker previews options in-face; unknown/removed font falls back gracefully to the default.
- No contrast/a11y regression (re-run the contrast gate; faces are metric-different but token colours unchanged).
**Files:** `pubspec.yaml` (fonts:), `assets/fonts/inter/`, `assets/licenses.yaml`, `lib/widgets/src/typography.dart`, `lib/src/shell/root_shell.dart` (DefaultTextStyle), mono consumers (editor / terminal / markdown / code-block), the Appearance settings category (T-452) + schema registration.
**Related:** T-444 (epic), T-452 (Appearance category where these render), T-448 (field renderer), T-449 (scope), ui-design `theme.md` (typography section: clideUiFamily / clideMonoFamily / clideFont* sizes), D-42 (bundled-dep documentation), D-44 (theming).', 'done', 'medium', NULL, NULL, NULL, '2026-06-17 07:39:25.019', '2026-06-17 18:14:38.272', NULL, '138f95c597eebc2db37c9e0c4bc49c91', 2) ON CONFLICT(record_id) DO UPDATE SET type=excluded.type, parent_record_id=excluded.parent_record_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at > tickets.updated_at OR (excluded.updated_at = tickets.updated_at AND excluded.hash > tickets.hash);
+4
View File
@@ -65,6 +65,10 @@ heading, and (b) bumping `pubspec.yaml` `version:` in the same commit.
permission mode — seed fresh sessions (effort via `--effort` at spawn;
model and permission applied right after start). (T-457)
- **Inter is the default UI font + a UI-font picker.** Bundled Inter (variable)
as the default interface typeface — Josefin Sans stays selectable — and
Settings → Appearance gains a UI-font picker that applies live. (T-460)
### Changed
- **Theme picker relabelled "Theme…".** The ⌘K theme picker's command title
Binary file not shown.
Binary file not shown.
+93
View File
@@ -0,0 +1,93 @@
Copyright 2020 The Inter Project Authors (https://github.com/rsms/inter)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
+13 -2
View File
@@ -58,6 +58,17 @@ dependencies:
any other monospace surface.
weights_bundled: [Regular, Italic, Bold, BoldItalic]
- name: Inter
kind: font
version: "variable"
homepage: https://github.com/rsms/inter
license: OFL-1.1
license_file: assets/fonts/inter/OFL.txt
purpose: >-
Default application UI face (T-460). Variable font with optical-size
and weight axes; Josefin Sans remains bundled as a selectable option.
weights_bundled: [VariableFont, Italic-VariableFont]
- name: Josefin Sans
kind: font
version: "variable"
@@ -65,8 +76,8 @@ dependencies:
license: OFL-1.1
license_file: assets/fonts/josefin_sans/OFL.txt
purpose: >-
Application UI face. Default weight Light (300); full 100-700
range available via the variable-font weight axis.
Selectable application UI face (was the default before T-460). Default
weight Light (300); full 100-700 range via the variable-font weight axis.
weights_bundled: [VariableFont, Italic-VariableFont]
- name: Phosphor Icons
@@ -4,6 +4,7 @@ import 'package:clide/builtin/theme_picker/src/settings_view.dart';
import 'package:clide/builtin/theme_picker/src/theme_status_item.dart';
import 'package:clide/extension/extension.dart';
import 'package:clide/kernel/kernel.dart';
import 'package:clide/widgets/widgets.dart' show kUiFontSettingKey;
class ThemePickerExtension extends ClideExtension {
@override
@@ -55,6 +56,22 @@ class ThemePickerExtension extends ClideExtension {
),
],
),
SettingsSection(
label: 'Typography',
fields: [
SettingsField(
key: kUiFontSettingKey,
kind: SettingsFieldKind.select,
label: 'UI font',
help: 'Typeface for the app interface; applies live.',
defaultValue: 'Inter',
options: [
SettingsOption(value: 'Inter', label: 'Inter'),
SettingsOption(value: 'JosefinSans', label: 'Josefin Sans'),
],
),
],
),
],
),
),
+6 -1
View File
@@ -48,6 +48,8 @@ class RootShellState extends State<RootShell> {
super.initState();
_keyFocus = FocusNode()..requestFocus();
widget.services.textZoom.addListener(_onZoom);
// Re-apply the UI font when its setting changes (T-460).
widget.services.settings.addListener(_onZoom);
_globalSeq = SequenceMatcher(
keymap: () => widget.services.keymap.keymap ?? Keymap(const []),
context: () => widget.services.keymap.scope,
@@ -61,6 +63,7 @@ class RootShellState extends State<RootShell> {
HardwareKeyboard.instance.removeHandler(_onRawKey);
_seqTimeout?.cancel();
widget.services.textZoom.removeListener(_onZoom);
widget.services.settings.removeListener(_onZoom);
_menuBar.dispose();
_keyFocus.dispose();
super.dispose();
@@ -77,7 +80,9 @@ class RootShellState extends State<RootShell> {
fontSize: 15,
height: clideLineHeight,
fontWeight: clideUiDefaultWeight,
fontFamily: clideUiFamily,
// User-selected UI font (Settings → Appearance, T-460), else the
// bundled default. The fallback chain still covers a missing asset.
fontFamily: widget.services.settings.get<String>(kUiFontSettingKey) ?? clideUiFamily,
fontFamilyFallback: clideUiFamilyFallback,
),
child: MediaQuery(
+19 -14
View File
@@ -2,9 +2,9 @@
///
/// Two bundled families:
///
/// - [clideUiFamily] — Josefin Sans, the application-wide UI face.
/// Shipped as a variable font (weights 100-700) + italic companion;
/// default weight is [clideUiDefaultWeight] (Light / `w300`).
/// - [clideUiFamily] — Inter, the application-wide UI face (T-460; was
/// Josefin Sans). Shipped as a variable font + italic companion. Users can
/// switch it from Settings → Appearance via the [kUiFontSettingKey] override.
/// - [clideMonoFamily] — JetBrains Mono, for terminal panes, diff
/// views, code editors, and any other monospace surface.
///
@@ -16,22 +16,22 @@ library;
import 'package:flutter/widgets.dart' show FontWeight;
// ---------------------------------------------------------------------------
// UI face — Josefin Sans
// UI face — Inter
// ---------------------------------------------------------------------------
/// The bundled application UI family. Always resolved first.
const String clideUiFamily = 'JosefinSans';
/// The bundled application UI family, resolved first (T-460). The settings
/// override ([kUiFontSettingKey]) takes precedence at the app root when set.
const String clideUiFamily = 'Inter';
/// Default weight for UI text. Josefin Sans reads well at Light; the
/// rest of the design adjusts contrast and size to stay legible.
const FontWeight clideUiDefaultWeight = FontWeight.w300;
/// Default weight for UI text.
const FontWeight clideUiDefaultWeight = FontWeight.w400;
/// System fallback chain for the UI face. Sans-serif humanist faces
/// that sit close to Josefin's proportions, ordered by platform.
/// System fallback chain for the UI face — the other bundled UI option plus
/// platform humanist sans defaults.
const List<String> clideUiFamilyFallback = [
// User system install of Josefin, if any.
'Josefin Sans',
// Platform humanist sans defaults.
// The other bundled UI family (selectable in Appearance).
'JosefinSans',
// User system install / platform humanist sans defaults.
'Inter',
'Helvetica Neue',
'Helvetica',
@@ -39,6 +39,11 @@ const List<String> clideUiFamilyFallback = [
'sans-serif',
];
/// Settings keys for the user-selectable UI / monospace font families
/// (Settings → Appearance, T-460). Unset → the bundled defaults above.
const String kUiFontSettingKey = 'app.ui.font';
const String kMonoFontSettingKey = 'app.mono.font';
// ---------------------------------------------------------------------------
// Monospace face — JetBrains Mono
// ---------------------------------------------------------------------------
+6
View File
@@ -95,6 +95,12 @@ flutter:
- assets/queries/
fonts:
- family: Inter
fonts:
- asset: assets/fonts/inter/Inter-VariableFont.ttf
- asset: assets/fonts/inter/Inter-Italic-VariableFont.ttf
style: italic
- family: JosefinSans
fonts:
- asset: assets/fonts/josefin_sans/JosefinSans-VariableFont.ttf
@@ -2,6 +2,7 @@ import 'package:clide/builtin/theme_picker/src/theme_status_item.dart';
import 'package:clide/builtin/theme_picker/theme_picker.dart';
import 'package:clide/extension/extension.dart';
import 'package:clide/kernel/kernel.dart';
import 'package:clide/widgets/widgets.dart' show kUiFontSettingKey;
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
@@ -195,6 +196,13 @@ void main() {
expect(ext.contributions.whereType<SettingsControlContribution>().any((c) => c.customId == 'theme.picker'), isTrue);
});
test('Appearance includes a UI font picker (T-460)', () {
final cat = ThemePickerExtension().contributions.whereType<SettingsCategoryContribution>().firstWhere((c) => c.id == 'appearance').category;
final font = cat.sections.expand((s) => s.fields).firstWhere((f) => f.key == kUiFontSettingKey);
expect(font.kind, SettingsFieldKind.select);
expect(font.options.map((o) => o.value), containsAll(['Inter', 'JosefinSans']));
});
testWidgets('AppearanceThemeControl lists base themes and applies a pick (T-452)', (tester) async {
await tester.pumpWidget(harness(f, const SizedBox(width: 420, child: AppearanceThemeControl())));
expect(find.text('summer-night'), findsOneWidget);