Skip to content

Removes all third-party CDN dependencies#181

Merged
hoangsonww merged 5 commits into
hoangsonww:masterfrom
nodeGarden:feature/remove-external-assets
Jun 25, 2026
Merged

Removes all third-party CDN dependencies#181
hoangsonww merged 5 commits into
hoangsonww:masterfrom
nodeGarden:feature/remove-external-assets

Conversation

@nodeGarden

@nodeGarden nodeGarden commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes all third-party CDN dependencies that caused network calls on every page load. After this change, no external requests are made for fonts or scripts.

Changes

  • React app: installed @fontsource/inter + @fontsource/jetbrains-mono; imported per-weight CSS in main.tsx so Vite bundles the WOFF2 files into dist/assets/ at build time with content hashes. Removed Google Fonts <link> tags from client/index.html.
  • Static pages (index.html, wiki/index.html): added fonts/ directory at the project root with self-hosted WOFF2 files and a fonts.css @font-face stylesheet. Relative paths resolve correctly under GitHub Pages. Also fixed a pre-existing gap: JetBrains Mono weight 700 was not included in the original Google Fonts request (font-synthesis was silently used for the API method badges in the wiki); the real glyph file is now served.
  • Wiki: downloaded mermaid@10 bundle to wiki/mermaid.min.js; updated <script src> to point locally.
  • VS Code extension error page: removed Google Fonts loader from the inline getErrorHtml() template; falls back to system font stack.
  • .prettierignore: excluded wiki/mermaid.min.js (vendored minified bundle) and fonts/*.woff2 (binary) from Prettier.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (no functional changes)
  • Documentation update
  • Infrastructure / CI / DevOps
  • Dependency update

How to Test

  1. npm run setup && npm run build — confirm build succeeds and client/dist/assets/ contains inter-latin-*.woff2 and jetbrains-mono-latin-*.woff2 files
  2. npm start and open http://localhost:4820 — open DevTools → Network → filter by fonts.googleapis.com or fonts.gstatic.com; confirm zero requests
  3. Open index.html and wiki/index.html directly in a browser with network throttling / offline mode — fonts render correctly from local files
  4. npm run format:check — passes with no warnings

Checklist

  • I have read the contributing guidelines
  • I have signed the CLA (the 🖋️ CLA Assistant bot will prompt me on my first PR)
  • My code follows the project's coding standards
  • I have added/updated tests that prove my fix or feature works — N/A: this PR makes no changes to server or client logic; it is a build-time dependency swap with no testable runtime behaviour
  • All new and existing tests pass (npm test) — both the server (better-sqlite3 native binding / NODE_MODULE_VERSION mismatch) and client (Tabby localStorage / jsdom issue, one obsolete snapshot) suites have pre-existing failures on master that are unrelated to this change; npm run build completes cleanly
  • Code is formatted (npm run format:check)
  • I have updated documentation where necessary

Screenshots

Dashboard running with locally-served Inter font (no requests to fonts.googleapis.com):

Dashboard with local fonts

- React app: install @fontsource/inter + @fontsource/jetbrains-mono;
  import weights 400-700 (Inter) and 400-500 (JetBrains Mono) in
  main.tsx — Vite bundles the WOFF2 files at build time
- client/index.html: remove Google Fonts preconnect + stylesheet links
- fonts/: add self-hosted WOFF2 files (Inter 400-900, JetBrains Mono
  400-700) and fonts.css with @font-face declarations for static pages
- index.html (landing page): swap Google Fonts link for fonts/fonts.css
- wiki/index.html: swap Google Fonts link for ../fonts/fonts.css;
  replace CDN mermaid script with local wiki/mermaid.min.js
- vscode-extension/extension.js: remove Google Fonts loader from the
  'Dashboard Offline' error page; fall back to system font stack

No external network calls are made on page load after this change.
@nodeGarden nodeGarden requested a review from hoangsonww as a code owner June 22, 2026 17:30
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown

✅ All contributors have signed the CLA. Thank you!
Posted by the CLA Assistant Lite bot.

@nodeGarden

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request replaces external Google Fonts and CDN dependencies with self-hosted alternatives across the client, wiki, and VS Code extension. Specifically, it introduces @fontsource packages for Inter and JetBrains Mono in the client, adds a local fonts.css stylesheet with @font-face definitions, and switches the wiki's Mermaid JS script to a local file. I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

github-actions Bot added a commit that referenced this pull request Jun 22, 2026
@nodeGarden nodeGarden changed the title test Removes all third-party CDN dependencies Jun 22, 2026
@hoangsonww hoangsonww added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers question Further information is requested labels Jun 22, 2026
@hoangsonww hoangsonww moved this from Backlog to In review in Claude Code AI Agents Monitor Project Board Jun 22, 2026
hoangsonww and others added 4 commits June 25, 2026 07:30
…redesign + tooltips; PR hoangsonww#181 CDN fixes

Branding splash:
- New SplashScreen overlay shown once per session on load: time-aware greeting,
  localized tagline + subtexts, animated node-graph mark. Opaque from the first
  paint (no app flash-through), ~2.5s hold then fade-out, click-to-skip,
  prefers-reduced-motion aware. New `splash` i18n namespace (en/zh/vi).

Analytics:
- The chart region now shows pulsing skeletons while loading (it previously
  rendered empty/zero charts); the shared <Skeleton> already pulses, this fills
  the Analytics gap.

Compaction Impact (Workflows):
- Redesigned the confusing chart into a "sessions by compaction count" histogram
  with real axis titles, meaningful stat tiles (total / sessions affected / avg /
  peak), an explanatory help line, and a plain-English summary. Removed the
  broken `sortedByCompaction` key and the misleading "0 tokens recovered"
  headline (now a footnote shown only when > 0).
- Added rich hover tooltips matching the app's other charts, with a full-height
  hit-area per column and a hover highlight.

Workflows section headers:
- Clamp the right-aligned subtitle to a single line (ellipsis + hover title) so a
  long translation no longer wraps and unbalances the header row.

Tabby companion:
- Remove em dashes from Tabby's spoken quips / intents (e.g. "your turn - a
  session's waiting") and the remaining Tabby files.

PR hoangsonww#181 (remove external CDNs) fixes:
- Re-vendored the genuine minified mermaid@10.9.6 (3.2 MB, was a 7.3 MB
  pretty-printed blob) with a provenance banner.
- Trimmed @fontsource imports to the latin subset (6 bundled woff2, not 36).

Co-Authored-By: jr692 <204519893+jr692@users.noreply.github.com>
Document the external-CDN removal across the README trio (en/zh/vi), ARCHITECTURE,
and the landing page: fonts (Inter + JetBrains Mono) bundled via @fontsource for the
React app and self-hosted via fonts/fonts.css for the static pages + wiki; Mermaid
vendored locally (wiki/mermaid.min.js, mermaid@10.9.6); VS Code extension error page
on a system font stack. No fonts.googleapis.com / gstatic / jsDelivr calls remain.

Co-Authored-By: jr692 <204519893+jr692@users.noreply.github.com>
…+ tooltips

Document the UI features added in this PR across the README trio (en/zh/vi),
ARCHITECTURE, and the landing page:
- Session splash screen on app load (time-aware greeting, localized tagline,
  animated node-graph mark, opaque-from-first-paint, ~2.5s, click-to-skip).
- Analytics now shows pulsing skeleton placeholders for the chart region while
  loading, not just the stat tiles.
- Compaction Impact redesigned into a 'sessions by compaction count' histogram
  with axis titles, stat tiles, a help line, and per-bar hover tooltips.
- Workflows section subtitles clamp to a single line so long translations
  no longer wrap the header.

Co-Authored-By: jr692 <204519893+jr692@users.noreply.github.com>
…rnal-assets

# Conflicts:
#	README-CN.md
#	client/src/components/workflows/CompactionImpact.tsx
@hoangsonww hoangsonww merged commit 519e023 into hoangsonww:master Jun 25, 2026
10 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested

Projects

Development

Successfully merging this pull request may close these issues.

2 participants