Problem#
Opening Settings > Appearance automatically enumerated every installed font when local-font access was already granted. The monospace picker then started classifying every family with synchronous canvas measurements in the renderer.
This is especially disruptive in the Electron desktop client. On the affected installation, the Electron renderer became unresponsive while the T3 server remained available through the remote feature. The web client appears less affected by the same workload.
Scope of this PR#
This PR prevents the monospace check from starting merely because the Appearance page opened:
- Start installed-font discovery only after the user focuses a font-family field.
- Split monospace classification into time-bounded batches that yield between batches.
- Cache the classification so multiple font pickers share one scan.
- Show progress while the monospace list is being prepared.
- Add focused regression coverage for deferred discovery, yielding, and result ordering.
The affected installation can now open Appearance without freezing because page navigation performs no installed-font query or monospace classification.
Known limitation#
This PR does not eliminate the catalog-wide monospace check. Interacting with the monospace picker still classifies every installed family. In a real Electron test with 710 unique families, the renderer UI remained unresponsive for more than five minutes even with batching, while requests sent from a phone through the remote feature continued to work.
The underlying work is up to 32 synchronous canvas measurements per family—22,720 measurements for that catalog—plus Chromium's font-resolution cost. Electron appears substantially more affected than the web client.
Follow-up issue #5656 documents the check, the affected-system evidence, possible replacements, optimization leads, and cross-surface acceptance criteria.
Validation#
vp test run --passWithNoTests --project unit src/appearanceFonts.test.ts — 14 tests passed.
vp run typecheck in apps/web.
- Targeted lint and formatting checks for the three changed files.
- Manual test on the affected Electron installation: Appearance opens without starting font enumeration. Interacting with the monospace picker still reproduces the remaining renderer freeze documented in #5656.
Model: GPT-5.6 Sol. Harness: Codex in T3 Code.
Note
Fix freezing UI during monospace font classification in FontFamilyPicker#
- Replaces synchronous
isMonospaceFamily filtering with a new async filterFontFamiliesWithoutBlocking function that periodically yields to the main thread based on a configurable time budget, preventing UI freezes when iterating large font lists.
- The
FontFamilyPicker component now shows a "Checking installed fonts…" status while async classification runs, and only renders the filtered list once classification completes.
- Adds a
WeakMap-backed cache in FontFamilyPicker.tsx so repeated renders with the same families array skip reclassification.
- Removes the proactive
local-fonts permission probe that previously ran on mount in useFontEnumeration.
Macroscope summarized 726671d.
Note
Low Risk
Settings UI and font enumeration timing only; no auth, data, or API changes.
Overview
Stops Appearance from kicking off installed-font work on page load by removing the mount-time local-fonts permission probe; enumeration still starts only when a font field is focused.
For monospace pickers, synchronous isMonospaceFamily filtering over the full catalog is replaced with filterFontFamiliesWithoutBlocking, which batches canvas probes under a time budget and yields to the main thread between batches. Results are cached per families array (shared across pickers), and the UI shows “Checking installed fonts…” until classification finishes.
Adds unit coverage for yield timing and preserved filter order.
Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 726671d41cde30b41edf90ce54a6d4bf7d3059c0. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
be50e1af-519f-4f49-a8a9-6a93ff23558eYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share