-
-
Notifications
You must be signed in to change notification settings - Fork 357
fix(ui): replace custom fonts with system fonts and cleanup static assets #1016
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(ui): replace custom fonts with system fonts and cleanup static assets #1016
Conversation
…sets - Updated CSS to use system font stacks for sans, mono, and titles - Removed custom font-face declarations and ~125KB of font assets - Updated Go embed directive to exclude empty static dir - Fixed malformed Web Worker URL construction when basePrefix is empty Closes TecharoHQ#142
c823d7c
to
be67edc
Compare
This seems AI generated... |
let webWorkerURL = `${basePrefix}/.within.website/x/cmd/anubis/static/js/worker/sha256-${workerMethod}.mjs?cacheBuster=${version}`; | ||
// Build the worker URL properly using URL constructor to avoid parsing issues | ||
const workerPath = `/.within.website/x/cmd/anubis/static/js/worker/sha256-${workerMethod}.mjs`; | ||
const searchParams = new URLSearchParams({ cacheBuster: version }); | ||
|
||
// Use URL constructor to ensure proper URL formation | ||
const webWorkerURL = new URL(workerPath + '?' + searchParams.toString(), window.location.origin).toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I was at it , I encountered an issue in the Web Worker URL construction that was causing SecurityErrors :
SecurityError: Failed to construct 'Worker': Script at 'http://.within.website/x/cmd/anubis/static/js/worker/sha256-webcrypto.mjs?cacheBuster=devel' cannot be accessed from origin 'http://localhost:3000'.
The malformed URL http://.within.website/...
indicated improper URL construction when basePrefix
is empty.
Root Cause Analysis
- The application uses
anubis.BasePrefix
which can be empty (""
) - JavaScript string interpolation:
${basePrefix}/.within.website/...
- When
basePrefix = ""
, this creates/.within.website/...
- The Worker constructor was misinterpreting this as
http://.within.website/...
File Modified:
web/js/algorithms/fast.mjs
Solution Implemented:
Before:
return new Promise((resolve, reject) => {
let webWorkerURL = `${basePrefix}/.within.website/x/cmd/anubis/static/js/worker/sha256-${workerMethod}.mjs?cacheBuster=${version}`;
console.log(webWorkerURL);
After:
return new Promise((resolve, reject) => {
// Build the worker URL properly using URL constructor to avoid parsing issues
const workerPath = `/.within.website/x/cmd/anubis/static/js/worker/sha256-${workerMethod}.mjs`;
const searchParams = new URLSearchParams({ cacheBuster: version });
// Use URL constructor to ensure proper URL formation
const webWorkerURL = new URL(workerPath + '?' + searchParams.toString(), window.location.origin).toString();
console.log('Worker URL:', webWorkerURL);
Now there is no longer such error , Please let me know if you need additional info or want me to do further testing. Also if you still want me to undo these webworker URL changes then please let me know , I'd be happy to do so.
Yeah I used copilot to write down the summary of the changes , any issues with that? |
As a professional writer, I'd love to read something you wrote, not something that a machine wrote. |
right makes sense , I will be careful about that next time. This was my first PR as I am still a student , I hope you'll excuse it this time. Thanks. |
also do you need me to change anything specific like undo the webworker url changes? |
how about as a professional writer you try to reply atleast , I get it if you didnt want to approve this PR but you could have just said so instead of wasting my time. Unprofessional, and yeah I wrote this not an AI. |
Summary
This PR removes bundled custom fonts and replaces them with system font stacks for better performance and consistency across platforms.
Changes
CSS Updates
xess/xess.css
to use system font stacks:-apple-system, Segoe UI, system-ui, Helvetica, Arial, sans-serif
ui-monospace, Consolas, Source Code Pro, monospace
Removed Custom Fonts
geist.woff2
,podkova.woff2
,iosevka-curly.woff2
, andpodkova.css
@font-face
declarationsGo Embed Update
static
from embed since directory is now emptyBugfix: Web Worker URL
basePrefix = ""
URL
constructor to safely build worker pathBenefits
SecurityError: Failed to construct 'Worker'
in dev modeRelated Issue
Closes #142
This is my first OSS contribution 🎉 — feedback is very welcome!