Repository navigation
fix: bundle fonts locally; show endpoint warnings in speech settings - #2
Conversation
There was a problem hiding this comment.
Review Summary
The changes are well-implemented and achieve both stated goals (bundled fonts and endpoint warnings in speech settings).
Fonts: Google Fonts <link> tags and CSP allowances are cleanly removed and replaced with @fontsource-variable/* imports. The updated CSP (font-src 'self') is correctly tightened.
Endpoint warnings: The endpointNotices function in src/shared/endpoints.ts is correct and the six new tests cover the full decision table from the PR description. The UI integration in main.tsx passes the right hasKey signal (speechKeyStatus.stored || speechKeyDraft.trim() !== '').
One minor observation (not a blocker): LOOPBACK_HOSTNAMES in endpoints.ts contains '[::1]' (with brackets), but URL.hostname for http://[::1]/ returns '::1' without brackets, so '[::1]' is a dead set entry that will never match. IPv6 loopback detection still works correctly because '::1' (without brackets) is also in the set. Worth cleaning up in a follow-on to avoid misleading future readers, but it does not affect correctness.
No blocking defects found — the PR is safe to merge after #1 lands and GitHub retargets this branch to main.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
|
Re the Removing 29287f9 adds a comment next to the set explaining this, and a test case with the expanded 🤖 Generated with Claude Code |
Fonts - Inter and JetBrains Mono now come from @fontsource-variable packages bundled by Vite instead of Google Fonts, so launching makes no network request and the UI renders correctly offline - CSP drops fonts.googleapis.com / fonts.gstatic.com (font-src 'self') - THIRD-PARTY-NOTICES.md carries the OFL text and ships in the package Endpoint warnings - endpointNotices(url, hasKey) in src/shared/endpoints.ts turns the existing isSupportedEndpoint / isLoopbackEndpoint / sendsKeyInClear helpers into settings-panel messages; they were never shown before - Speech settings show them under Server URL when the engine is Server: red for an invalid URL or a key over plain http off-machine, amber when speech leaves the machine - endpoints.ts header no longer mentions features this app doesn't have SECURITY.md updated to match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
URL.hostname keeps brackets on IPv6 literals, so '[::1]' is the entry that matches. A review bot suggested removing it as dead code; doing so would flag a local [::1] server as off-machine. Add a comment and a test case with the expanded [0:0:0:0:0:0:0:1] form; removing '[::1]' now fails the loopback test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29287f9 to
dd13547
Compare
|
❌ The last analysis has failed. |
Follow-up to #1 (merged). Rebased onto
main.Fonts are bundled, not loaded from Google
@fontsource-variable/*(OFL-1.1), bundled by Vite. Before this, every launch requestedfonts.googleapis.com, and the app showed fallback fonts when offline.style-src 'self' 'unsafe-inline'; font-src 'self').THIRD-PARTY-NOTICES.mdcarries the OFL text and is added to electron-builderfiles, so it ships with the app.Endpoint warnings are shown
isLoopbackEndpointandsendsKeyInClearexisted but the UI never used them. The newendpointNotices(url, hasKey)turns them into messages, shown under Server URL when the engine is Server ASR:127.0.0.1,localhost,::1,*.localhost)https://api.example.com/...http://10.0.0.5:8080/...with a key saved or typednot a url,file://,ws://Verification
npm run ci: typecheck, 125 tests (6 new intests/endpoints.test.ts), build.Inter VariableandJetBrains Mono Variableloaded from local files;🤖 Generated with Claude Code