fix: address CodeRabbit findings on the style-editor/font-selector PR

- Fix _load_font_sized double-wrapping the (font, size) tuple on the
  missing-font path, which handed callers a tuple instead of a font.
- Fix _set_nested_value skipping an explicit None when the key already
  existed, which silently kept stale overrides when a user cleared a
  nullable per-mode field or blanked all channels of an indexed color.
- Preserve BDF scalable/native_size metadata through fetchFontCatalog's
  catalog-format mapping so maxFixedSize filtering actually applies.
- Stop caching an empty array on a failed font-catalog fetch so a later
  call can retry instead of being stuck with the failed result.
- Keep a saved font selected in the style editor even when it no longer
  fits a newly declared maxFixedSize, instead of silently deselecting it.
- Don't drop in-progress user edits to fallback fields when a plugin
  widget finishes loading asynchronously and takes over the form.
- Tighten the removed font-override endpoint test to assert 405, not
  just != 200.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-09-13 05:34:27 +00:00
parent a5342939af
commit f9e9eeba00
8 changed files with 76 additions and 15 deletions
+2 -2
View File
@@ -825,10 +825,10 @@ class TestFontsAPI:
# 405, not 404: the path still matches DELETE /fonts/<font_family>,
# which now reads "overrides" as a font name. Nothing is routed to a
# handler for GET or POST, which is what matters here.
assert client.get('/api/v3/fonts/overrides').status_code != 200
assert client.get('/api/v3/fonts/overrides').status_code == 405
assert client.post('/api/v3/fonts/overrides',
data=json.dumps({}),
content_type='application/json').status_code != 200
content_type='application/json').status_code == 405
class TestAPIErrorHandling: