refactor(web): remove the two Fonts-tab panels that reported invented data

"Element Font Overrides" let a user configure an override, showed a
success toast, and changed nothing. All three endpoints behind it were
stubs -- GET returned a hardcoded {}, POST and DELETE returned success
without calling anything -- each marked "This would integrate with the
actual font system".

Wiring them to FontManager would not have fixed it. The machinery there is
real (_load_overrides/_save_overrides persist config/font_overrides.json,
resolve_font applies them, and the countdown plugin genuinely consumes
it), but the panel's element dropdown offered eleven invented keys --
nfl.live.score, clock.time, weather.current -- that no plugin has ever
read. An override saved against one of those would have persisted
correctly and still done nothing.

"Detected Manager Fonts" goes for the same reason. It claimed to show
"fonts currently in use by managers (auto-detected)"; its own comment said
"we'll simulate this", and it listed every font in the catalog with a
hardcoded usage_count of 1 -- the panel beside it, with fabricated
numbers attached.

Per-element font choice now lives in each plugin's own config editor,
against the elements that plugin actually has, and covers size, colour,
offsets, visibility, alignment and scale rather than family and size.

Kept: the font library (upload, preview, delete), which works, and
/fonts/tokens, which is a stub but genuinely feeds the preview's size
dropdown. FontManager's override methods are untouched -- countdown uses
them.

Verified in a browser with the tab's JS running: no console errors, 35
fonts listed, upload and preview intact. Removing the panel meant unwiring
it from populateFontSelects too, which would otherwise have bailed out
early on the missing select and left the preview dropdown empty.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Chuck
2026-09-11 11:25:24 -04:00
co-authored by Claude Opus 5
parent e86dc9c27b
commit a46a908c79
3 changed files with 28 additions and 407 deletions
+15 -22
View File
@@ -789,28 +789,21 @@ class TestFontsAPI:
data = json.loads(response.data)
assert 'tokens' in data.get('data', {}) or 'data' in data
def test_get_fonts_overrides(self, client):
"""Test getting font overrides."""
response = client.get('/api/v3/fonts/overrides')
assert response.status_code == 200
data = json.loads(response.data)
assert 'overrides' in data.get('data', {}) or 'data' in data
def test_save_fonts_overrides(self, client):
"""Test saving font overrides."""
request_data = {
'weather': 'small',
'clock': 'regular'
}
response = client.post(
'/api/v3/fonts/overrides',
data=json.dumps(request_data),
content_type='application/json'
)
assert response.status_code == 200
def test_the_font_override_endpoints_are_gone(self, client):
"""They reported success without doing anything: GET returned a
hardcoded {}, POST and DELETE saved and deleted nothing. The panel
they served offered eleven element keys -- nfl.live.score,
clock.time -- that no plugin has ever read, so wiring them to the
real FontManager methods would still have changed nothing on the
panel. Per-element font choice lives in each plugin's own config
editor now, against the elements that plugin actually has."""
# 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.post('/api/v3/fonts/overrides',
data=json.dumps({}),
content_type='application/json').status_code != 200
class TestAPIErrorHandling: