Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,9 @@
content="width=device-width, initial-scale=1.0, maximum-scale=1"
/>
<link rel="icon" href="/favicon.ico" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Architects+Daughter&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Fira+Code:wght@300..700&family=Geist+Mono:wght@100..900&family=Geist:wght@100..900&family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=IBM+Plex+Sans:ital,wght@0,100..700;1,100..700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Lora:ital,wght@0,400..700;1,400..700&family=Merriweather:ital,opsz,wght@0,18..144,300..900;1,18..144,300..900&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Outfit:wght@100..900&family=Oxanium:wght@200..800&family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Roboto:ital,wght@0,100..900;1,100..900&family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&family=Source+Serif+4:ital,opsz,wght@0,8..60,200..900;1,8..60,200..900&family=Space+Grotesk:wght@300..700&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap"
rel="stylesheet"
/>
</head>
<body style="overflow-y: hidden;">
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<!-- This is a replit script which adds a banner on the top of the page when opened in development mode outside the replit environment -->
<script
type="text/javascript"
src="https://replit.com/public/js/replit-dev-banner.js"
></script>
</body>
</html>
2 changes: 1 addition & 1 deletion client/src/components/features/code-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ export function CodeEditor({
},
fontSize: Math.round(initial.fs),
lineHeight: Math.round(initial.lh),
fontFamily: "JetBrains Mono, Consolas, Monaco, monospace",
fontFamily: '"JetBrains Mono Variable", "JetBrains Mono", Consolas, Monaco, monospace',
wordWrap: "on",
scrollBeyondLastLine: false,
automaticLayout: true,
Expand Down
5 changes: 2 additions & 3 deletions client/src/index.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");
@import "./styles/theme-tokens.css";
@import "tailwindcss" source(none);
@source "../index.html";
Expand Down Expand Up @@ -214,9 +213,9 @@ html, body {
--sidebar-accent-foreground: hsl(142 86% 28%);
--sidebar-border: hsl(0 0% 15%);
--sidebar-ring: hsl(142 86% 28%);
--font-sans: Inter, system-ui, sans-serif;
--font-sans: "Inter Variable", Inter, system-ui, sans-serif;
--font-serif: Georgia, serif;
--font-mono: JetBrains Mono, Consolas, Monaco, monospace;
--font-mono: "JetBrains Mono Variable", "JetBrains Mono", Consolas, Monaco, monospace;
--radius: 0.5rem;
/* Unified font-size scale — all sizes now scale with --ui-font-scale */
--fs-sm: calc(14px * var(--ui-font-scale));
Expand Down
3 changes: 3 additions & 0 deletions client/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import "./lib/monaco-error-suppressor"; // Geändert von @/lib/...
import editorWorker from "monaco-editor/esm/vs/editor/editor.worker?worker";
import { createRoot } from "react-dom/client";
import App from "./App";
// Self-hosted fonts: the page must not depend on third-party hosts to load.
import "@fontsource-variable/inter";
import "@fontsource-variable/jetbrains-mono";
import "./index.css";
import { getCurrentFontScale, increaseFontScale, decreaseFontScale } from "./lib/font-scale-utils";
import { isMac } from "./lib/platform";
Expand Down
4 changes: 2 additions & 2 deletions client/src/styles/theme-tokens.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@
/* ═══════════════════════════════════════════════════════════
FONT FAMILIES (constant, no scaling)
═══════════════════════════════════════════════════════════ */
--font-code: "JetBrains Mono", Consolas, Monaco, monospace;
--font-sans: var(--font-sans, Inter, system-ui, sans-serif);
--font-code: "JetBrains Mono Variable", "JetBrains Mono", Consolas, Monaco, monospace;
--font-sans: var(--font-sans, "Inter Variable", Inter, system-ui, sans-serif);
}

/* ═══════════════════════════════════════════════════════════
Expand Down
24 changes: 24 additions & 0 deletions e2e/self-contained-page-load.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { test, expect } from '@playwright/test';

// The page must load from the UnoSim origin alone. A blocking third-party
// stylesheet or script (formerly Google Fonts and a Replit banner) left the page
// blank until its host answered, which made E2E runs flaky and breaks filtered
// school networks.

test('the start page loads without any third-party request', async ({ page, baseURL }) => {
const ownHost = new URL(baseURL ?? 'http://localhost:3000').host;
const thirdParty: string[] = [];
page.on('request', (request) => {
const url = new URL(request.url());
// HTTP and WebSocket requests to the UnoSim host are first-party; blob:/data: never leave the page.
if (['http:', 'https:', 'ws:', 'wss:'].includes(url.protocol) && url.host !== ownHost) {
thirdParty.push(request.url());
}
});

await page.goto('/');
await expect(page.getByRole('button', { name: /start simulation/i })).toBeVisible({ timeout: 15000 });
await page.evaluate(() => document.fonts.ready);

expect(thirdParty).toEqual([]);
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
"prepare": "husky"
},
"dependencies": {
"@fontsource-variable/inter": "5.3.0",
"@fontsource-variable/jetbrains-mono": "5.3.0",
"@radix-ui/react-alert-dialog": "^1.1.7",
"@radix-ui/react-checkbox": "^1.1.5",
"@radix-ui/react-dialog": "^1.1.7",
Expand Down
Loading