Commit Graph
30 Commits
Author SHA1 Message Date
aiongg 5bf2d9cb4e font-store: the preview service's client moves here from font-manager as preview (no view code: subset keys, the disk cache, the fetch pool); the pool reads the store through PreviewStore, which font-manager's Installer builds on; Instance, Subset, PreviewError and Preview are non-exhaustive 2026-11-24 14:59:40 +00:00
aiongg 43c89a0b99 Docs links from main's sync: material-graph names Graph by its module path; font-store re-exports SERVICE_BACKOFF, which its public docs name 2026-11-24 13:59:33 +00:00
aiongg 2476d07bdd Merge remote-tracking branch 'upstream/main' into next-sync-1124
# Conflicts:
#	.github/workflows/workspace.yml
#	Cargo.lock
#	crates/font-manager/Cargo.toml
#	crates/font-manager/README.md
#	crates/font-manager/src/lib.rs
#	crates/font-manager/src/panel/app.rs
#	crates/font-manager/src/panel/browse.rs
#	crates/font-manager/src/panel/details.rs
#	crates/font-manager/src/panel/faces.rs
#	crates/font-manager/src/panel/mod.rs
#	crates/font-manager/src/store.rs
#	crates/font-manager/tests/flows.rs
#	crates/font-store/src/language_packs.rs
#	crates/font-store/src/lib.rs
#	crates/font-store/src/store.rs
#	crates/font-store/src/tests.rs
2026-11-24 05:26:41 +00:00
aiongg eeb5b26198 font-manager: previews from the font preview service; font-store downloads through it (#2782)
* font-store: index format 1.2 and the preview service as a download mirror

Reads index format 1.2 and pins craft-font-index 995ef20. An optional font
preview service (CRAFT_FONT_PREVIEW_URL, else the preview_service setting)
serves installs and licence texts by sha256 before the index's URLs; a
service that fails on the network is skipped for a minute, per origin, by
every clone of the client. Settings gain the previews switch.

* font-manager: previews from the font preview service

A preview client (remote.rs) fetches WOFF2 subsets of each face from the
service on its own worker threads, highest priority first, with a shared
disk cache. The Browse list shows each family in its own face; the detail
view shows variable faces with their axes and named instances, and the
family's licence and NOTICE texts. Without a service, or with previews
switched off, the panel works as before.

* font-store: a host default for the preview service

FontStore::with_default_preview_service (and SuiteStore's) names the
service used while neither CRAFT_FONT_PREVIEW_URL nor the user's setting
names one. It is never written to settings.json, so clearing the setting
brings it back and other apps sharing the store don't see it.
PreviewServiceSource gains Default.

* font-manager: box the installed face in a card's Face, so the enum stays small on Windows

* font-store: a host default for the network setting

FontStore::with_default_network (and SuiteStore's) gives the setting the
host uses while the user hasn't chosen. settings.json saves network only
once the user chooses, and never the host's default; an agent's store
ignores it. Files from before could hold "off" without a choice, and that
"off" still counts as the user's.

* font-store: per-source samples in merges, mirror only for curated families, an unreadable settings file fails closed

Index::merge keeps each source's own sample map, so a source left out as a
duplicate brings no samples, also from inside an index merged before.

Installs and legal_text ask the preview service only for curated families:
it holds only the built-in sources' files, and asking for a user source's
file would send it the file's hash.

A missing settings.json is no choice, so the host's defaults apply. One that
exists but can't be read, is too large or doesn't parse reads as network off
and no preview service, not even the host's default; a write over it starts
from those values.

* font-manager: review fixes for the preview service

- Preview is offered for a family whose subsets failed, in its card and its
  details sheet.
- Licence and NOTICE texts are kept by the file's sha256 too, so a refreshed
  index never shows the old text.
- Axis sliders keep only the user's edits; an untouched axis follows the
  subset's default. The readout shows up to two decimals.
- The detail view asks for the sample subset also when the typed text has
  too many characters for a request of its own.
- The typing pause is measured after the toolbar has handled input.
- A failed subset schedules a repaint for its retry.
- DiskCache::contains asks the folder, so a file another app cached later is
  found.
- Installer docs name the host's default preview service.
- The fake service in the flow tests drops a request cancelled while held.

* Fonts panel: notice when the preview server can't be reached; opt-in sans-serif and system-language default filters
2026-11-23 01:32:41 -05:00
aiongg 7371a5b05f Self-update helper imports the detect function on Windows; Index::mark_changed on every target 2026-11-17 14:09:16 +00:00
aiongg 424cf7fd98 panels-w11: written by an agent 2026-11-14 17:56:00 +00:00
aiongg e8663f6c72 Lints: replace wildcard imports of split-out modules with explicit imports 2026-11-14 00:15:29 +00:00
aiongg 577055bc34 Merge storytold main 3c59a2aa5 into craft-framework (sync 13 Nov)
202 upstream commits since 6cb00467a. Resolutions:
- craft-window, craft-platform: ours. Upstream's frame policy v2, restore
  store and GNOME light/wait_first are the versions carried on 28 Oct;
  ours moved place() to craft-behavior and kept LayoutWatch and the
  appearance/portal.rs split.
- craft-timeline: ours. craft-time (crates/time) lands as upstream wrote
  it and is not yet used by craft-timeline.
- Old crates/ui modules stay removed. Upstream's frosted backdrops, shape
  gallery, dialog tabs and the iconic flyout top-edge rendering are not
  carried. The #1094 model half is in craft-behavior's dock:
  Group::flyout_offset and Action::MoveFlyoutTop.
- craft-update: #586 Save and Update, the install probe on the check
  thread and quiet per-user MSI self-updates, carried into updater.rs,
  stack_dialogs.rs, install/windows.rs and self_update/helper.rs.
- craft-jpeg: progressive Huffman decoding, carried into huffman.rs,
  parse.rs and scan.rs.
- craft-print: the driver settings dialog's new tests and the bounded
  XML parse's tests, as trials.
- Test-only conflicts: upstream tests from before the base that our side
  cut stay cut; tests new upstream are kept.
2026-11-13 17:11:48 +00:00
.CooCoo 596694db4d font-store: name four Language pack tests by the behavior they check
Drop the residual_ prefix from four tests in language_packs/tests.rs.
The two cleanup tests become committed_cleanup_*, matching the
committed removal receipts they exercise. Test bodies are unchanged.

---------

Co-authored-by: dotCooCoo <RobertLeeLW@gmail.com>
2026-11-12 10:10:35 -05:00
aiongg e59460135e Base crates on the framework: theme, behaviour, keymap, platform, window, settings, i18n, fonts 2026-11-12 14:09:48 +00:00
dotCooCoo 43224b0492 font-store: create Language pack recovery stages through the retained folder
The recovery stage is now created, opened and, when opening fails, removed through
the retained recovery directory handle. A failed open no longer leaves an empty
stage under .removing, and the removal is not recursive. A rollback failure now
names the recovery stage ID next to the pack's last known path.
2026-11-07 01:58:39 -08:00
dotCooCoo 600734ef54 font-store: ignore malformed optional receipt values 2026-11-03 12:16:28 -08:00
dotCooCoo 8e6e369793 font-store: verify removal receipts through the recovery handle 2026-11-03 12:13:04 -08:00
dotCooCoo 5c9589c4c8 font-store: keep recovery moves and cleanup on the same handles 2026-11-03 12:09:19 -08:00
dotCooCoo f9ef3d4b17 font-store: anchor immediate recovery stage cleanup 2026-11-03 12:04:43 -08:00
dotCooCoo 40cd57930a font-store: confine recovery cleanup and preserve valid receipts 2026-11-03 11:59:16 -08:00
dotCooCoo 1b3a3ed661 font-store: clarify the lock acquisition cleanup sweep limit 2026-11-03 09:31:01 -08:00
dotCooCoo 7b8566b25c font-store: bound removal cleanup and cover portable failure retries 2026-11-03 09:11:49 -08:00
dotCooCoo 9c9fdda76c font-store: make rollback recovery fixture portable 2026-11-03 08:56:21 -08:00
dotCooCoo de727cb97e font-store: preserve Language packs when removal cannot commit 2026-11-03 08:12:39 -08:00
Dylan M. Taylor 55332dd301 font-store: index PostScript names shared by many files in linear time (#538)
Index::assemble searched every earlier position listed under a PostScript
name before adding the next, so an index that gives one name to many files
took time quadratic in their number. Files are visited in order, so a file
that lists a name twice can only be the last position pushed: comparing
with the end is enough.

find_postscript compared each hit's family name with every name collected
so far; it now keeps the lowercased names in a set.
2026-11-02 23:56:48 -05:00
Martin BallandClaude Opus 5.5 762a06a4c6 CP4.1: craft-libs#486 review — listing Language packs never writes the record without the store lock (an install or removal repairs it); the font-store workflow pins actions/checkout to v7.0.1's commit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FypgCX8LsYYE8fsj4byBm2
2026-11-02 00:30:58 +00:00
Martin BallandClaude Opus 5.5 83c2e7bf8c CP4.1: review — record rebuilt atomically in place (and when missing), staging never deletes another process's folder, zstd frames capped, neutral index errors, plain index text, optional source
- read_installed copies an unreadable record to .bad and writes the rebuilt one atomically over it; a missing record with pack folders is rebuilt too; install reads the record before moving the pack in.
- Stage::new uses create_dir and takes the next name on AlreadyExists (PID namespaces in Flatpak/containers); stale folders are left to sweep_staging.
- At most 4096 zstd frames per archive, empty ones included.
- IndexError and the sha256 mismatch say "the index", not "the font index".
- licence, release, version and class lose control and Cf characters like name.
- PackEntry.source: Option<String>, an https URL or the index is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FypgCX8LsYYE8fsj4byBm2
2026-11-01 19:22:52 +00:00
Martin BallandClaude Opus 5.5 d342a50635 CP4.1: review — packs hold only the contract's files and say which locale they are; every zstd frame is read; a corrupt record is rebuilt
- Every zstd frame is decoded; anything but tar padding after the archive is refused.
- pack.toml must name the index entry's locale; the files the index promises (spelling, hyphenation) must be in the archive.
- Allow-list: pack.toml, spelling.aff, spelling.dic, hyphenation.pat at the root, LICENCES/<[A-Za-z0-9._-]> without a leading or trailing dot; Windows device names (con, prn, aux, nul, com1-9, lpt1-9, any extension) refused in names and locales.
- Pack names lose control and bidi/format (Cf) characters before they are stored or listed.
- An unreadable language-packs.json is kept as .bad and rebuilt from the pack folders (each pack.toml); no pack drops out.
- A bad hand-made entry is Error::Index(IndexError::Invalid), not BadUrl; index parse errors are Index errors too.
- Dead file:// handling removed.
- language_pack_index_overridden() exposes the developer override; README says it bypasses the pin and works in release builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FypgCX8LsYYE8fsj4byBm2
2026-11-01 18:38:59 +00:00
Martin BallandClaude Opus 5.5 1704bef581 CP4.1: review — a staging folder left by an earlier process with the same id is cleared before use
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FypgCX8LsYYE8fsj4byBm2
2026-11-01 18:38:59 +00:00
Martin BallandClaude Opus 5.5 630e42f42c CP4.1: font store item kind language-pack (pinned index, verified .tar.zst install, remove, list)
Additive: new src/language_packs.rs (+ tests); store.rs only widens a few helpers to pub(crate).
Developer override CRAFT_LANGUAGE_PACK_INDEX for local end-to-end testing (no index pin; archives
still verified).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FypgCX8LsYYE8fsj4byBm2
2026-11-01 17:58:01 +00:00
Dylan M. Taylor 6a66b95cbc Enforce Rust coding standards via Clippy (#372)
* chore(lints): enforce workspace Clippy standards

Deny cognitive_complexity (threshold 30, rust:S3776), too_many_arguments and wildcard_imports workspace-wide. Existing violations are fixed in follow-up commits.

* refactor(keymap): isolate shortcut row rendering

* test(ui): cover dock command contract cases

* fix(keymap): remove unused shortcut layout state

* refactor(media): simplify container serialization tests

* docs: document workspace lint inheritance for new crates

* refactor(text): split Knuth-Plass line costing and path extraction

Brings knuth_plass under the workspace cognitive complexity limit.

* test(font-store): split lookup test by concern
2026-10-27 13:49:38 -04:00
aiongg fdecd50f47 font-store: removing a family's last style keeps files the store didn't install 2026-10-26 01:55:20 +00:00
aiongg 5120c0ce2d Font store and Font Manager: review fixes
- FontStore::remove_files only touches names the family's manifest entry
  lists and that are safe file names.
- A user source's folder carries a hash of its full ID, so sources whose
  IDs slug alike don't share a folder.
- The download dialog and the sidebar note name the family's own source,
  and the server for a source the user added.
- The face cache takes out only faces the last frame didn't draw.
- The catalog test lists missing translations instead of failing.
- ATTRIBUTION lists the three bundled craft-font-index files.
2026-10-25 19:41:46 +00:00
aiongg 06a4ec194a craft-font-catalog, craft-font-store and craft-font-manager: installed fonts, the font store and the Font Manager panel 2026-10-25 19:09:33 +00:00