feat: show recent files with font previews in the launcher - #468
Merged
Merged
Conversation
The launcher lists recently opened fonts as cards with a specimen drawn from each font, and File gains Open Recent with Clear Menu. Recents live in main, keyed by DocumentId with a path fallback, and are recorded on every open, Save As, and preview conversion. Specimens are chosen from the compiled font (symbol glyphs, a declared non-Latin design language, Ag, a script pair, then AG or ag), shaped with HarfRust at the default location, and cached per file. Documents and sources compile through the existing fontc exporter in the session's utility process, so the launcher never opens fonts itself.
Themes now choose an on-accent text colour, white or the palette's darkest colour, by contrast with their accent, so primary buttons stay legible on palettes such as Dracula whose accent is pale.
The launcher opens as a 4:3 window that appears only once its recent files have rendered, with the lockup and Recent header at a fixed position so switching between the new grid and list views never moves them. New Font becomes a primary header button beside Open Font and the view toggle, replacing the New font card. Opening a font no longer flashes a blank card in the launcher it replaces. Adds shared ToggleGroup and Toggle components and a strong Separator variant.
kostyafarber
commented
Sep 30, 2026
kostyafarber
commented
Sep 30, 2026
kostyafarber
commented
Sep 30, 2026
kostyafarber
commented
Sep 30, 2026
Specimens for documents and sources were compiled from the whole font. The specimen rules now plan from the character map which characters they could shape, and only those glyphs (with their components, .notdef, and the first drawn glyphs) are compiled, without features or kerning. Fonts whose specimen needs contextual forms (Arabic without Latin) still compile whole. On Fraunces (697 glyphs) the compile drops from 38 ms to 2 ms.
List rows now show just the filename; holding Alt (Option) prefixes it with its folder, home-shortened to ~, so the path reads inline without cluttering every row. The launcher also takes the theme's text colour, so unstyled text such as Open Font follows dark palettes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
recent-documents.jsonin userData, capped at 20), keyed by DocumentId with a canonical-path fallback, and are recorded on every open, Save As, and preview conversion. Updates are held back from the launcher while a font opens, so it never shows a half-ready card.shift-specimencrate: picks the specimen from the compiled font (symbol glyphs → declared non-Latindlnglanguages →Ag→ script pair →AG/ag→ first drawn glyphs), shapes it with HarfRust at the default location, and returns SVG path data fitted to the ink..shiftdocuments and sources compile through the existing fontc exporter (FontExporter::compile_ttf); binaries are read as they are.ToggleGroup/Toggle, astrongSeparator variant, Select options that align and don't wrap, and anon-accenttheme token so primary buttons stay readable on pale accents (e.g. Dracula).Issue
Closes #467
Testing
pnpm check(lint, typecheck, desktop unit tests)cargo test -p shift-specimen— rule selection,dlngparsing, viewport fittinge2e/recent-files.spec.ts(platform project) covers reopen-from-card after relaunch, specimen text, remove + undo, and Open Recent + Clear Menu; existing specs and fixtures now use the "New Font" and "Open Font…" buttonslanding-default.pngwill fail until regenerated withci: update visual snapshotsFollow-up
metadlng, so compiled documents and sources always take the Ag-first path.🤖 Generated with Claude Code