Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 3, 2025

The frontend was loading Inter font from Google Fonts CDN, violating CSP style-src 'self' and breaking CSS rendering on admin pages.

Changes

  • Removed Google Fonts CDN import from frontend/src/index.css
  • Added self-hosted Inter font files (woff2 format, weights 400/500/600/700) to frontend/public/fonts/
  • Replaced with @font-face declarations referencing local files

Before

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

After

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Inter-Regular.woff2') format('woff2');
}
/* ... additional weights: 500, 600, 700 */

Screenshot

Frontend rendering with self-hosted fonts

Fonts now load from same origin, eliminating CSP violations and restoring proper text rendering.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • astral.sh
    • Triggering command: curl -LsSf REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>frontend build still trying use a google font</issue_title>
<issue_description>In the js console it says,


/:1 
 Refused to load the stylesheet 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap' because it violates the following Content Security Policy directive: "style-src 'self' 'unsafe-inline'". Note that 'style-src-elem' was not explicitly set, so 'style-src' is used as a fallback.

Some css is failing to render properly on the admin page making it hard to read. In particular on the admin log viewer, some of the rendering is not working correctly.

The correct behavior is to only use data from the server itself. Reaching out to a CDN is not permitted. </issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix frontend build to comply with Content Security Policy Replace Google Fonts CDN with self-hosted Inter font files Nov 3, 2025
Copilot finished work on behalf of garland3 November 3, 2025 17:20
Copilot AI requested a review from garland3 November 3, 2025 17:20
@garland3 garland3 requested a review from Copilot November 3, 2025 17:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request replaces the external Google Fonts import with self-hosted Inter font files to improve performance, privacy, and reliability by eliminating external dependencies.

Key changes:

  • Removed Google Fonts CDN dependency for Inter font family
  • Added self-hosted Inter font files in woff2 format (Regular, Medium, SemiBold, Bold)
  • Updated CSS to reference local font files using @font-face declarations

Reviewed Changes

Copilot reviewed 1 out of 5 changed files in this pull request and generated no comments.

File Description
frontend/src/index.css Replaced Google Fonts import with @font-face declarations for self-hosted fonts
frontend/public/fonts/Inter-SemiBold.woff2 Added SemiBold weight variant of Inter font (binary file)

@garland3 garland3 marked this pull request as ready for review November 3, 2025 17:45
…ile processing

- Remove large block of commented-out system status and MCP health endpoints from admin_routes.py
- Disable file processing in websocket_update_callback for canvas_files and files_update types in main.py, replacing with pass statements

This commit streamlines the codebase by eliminating unused commented code and temporarily disabling non-essential file update handling in websocket callbacks.
@garland3 garland3 requested a review from Copilot November 3, 2025 23:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 5 out of 10 changed files in this pull request and generated 2 comments.

backend/main.py Outdated
Comment on lines 53 to 54
pass
# files = (message.get("data") or {}).get("files") or []
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty pass statements with commented code create ambiguity. Either remove the commented code entirely or document why it's being preserved for future use with a TODO/NOTE comment explaining the intent.

Copilot uses AI. Check for mistakes.
backend/main.py Outdated
Comment on lines 62 to 63
pass
# files = (message.get("data") or {}).get("files") or []
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation on the commented line. The comment starts at column 0 but should align with the surrounding code block indentation for readability.

Copilot uses AI. Check for mistakes.
…g commented logging

- Consolidated handling for 'canvas_files' and 'files_update' types
- Removed disabled logging code to reduce noise and improve readability
- Preserves functionality while cleaning up the websocket callback logic
@garland3 garland3 merged commit 00386c6 into main Nov 3, 2025
4 of 5 checks passed
@garland3 garland3 deleted the copilot/fix-font-loading-issue branch November 3, 2025 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

frontend build still trying use a google font

2 participants