Skip to content

🔤 feat: Bundle Inconsolata for the ClickHouse Theme - #16376

Merged
berry-13 merged 2 commits into
canaryfrom
berry-13/clickhouse-inconsolata
Sep 25, 2026
Merged

berry-13 merged 2 commits into
canaryfrom
berry-13/clickhouse-inconsolata

Conversation

@berry-13

@berry-13 berry-13 commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Pull Request

Summary

The ClickHouse reference theme names Inconsolata as its mono family (Click UI's typography.font.families.mono), but the client never shipped the face, so with interface.theme: clickhouse every code block, inline code span and font-mono utility fell back to whatever monospace the OS provides. This self-hosts Inconsolata the way Roboto Mono already is: the latin 400 and 700 woff2 faces from Fontsource 5.3.0 under client/public/fonts, the SIL OFL 1.1 licence beside them, and @font-face rules with font-display: swap resolved through the existing $fonts alias.

The rules live in a new client/src/fonts.css, imported from main.jsx after style.css, because style.css is owned by the open theming stack (#16243 to #16248). A browser fetches a declared face only when text renders in it, and the PWA precache globs only js, css and html, so the default theme downloads nothing new.

Type of change

  • Feature

Testing

Tested environments/configuration:

  • Chromium via Playwright against the vite dev server, interface.theme: clickhouse in a worktree-local librechat.yaml, light and dark mode.
  • client/dist build: both faces are emitted under assets/fonts/, and sw.js precaches neither.

Automated tests:

  • Added two scenarios to e2e/specs/mock/scenarios/clickhouse-theme-shape.spec.ts: under the ClickHouse theme a code element loads the Inconsolata face over the network and document.fonts.check('16px Inconsolata') is true; under the default theme both declared faces stay unloaded and no Inconsolata request is made.
  • npx playwright test --config=e2e/playwright.config.mock.ts e2e/specs/mock/scenarios/clickhouse-theme-shape.spec.ts: 5 passed.
  • cd packages/client && npx jest src/theme: 8 suites, 273 tests passed; npx tsc --noEmit clean.
  • cd client && npm run typecheck: clean.
  • npx eslint, npx prettier --check and node scripts/sort-imports.mts --check on the touched files: clean. npm run lint reports no design-rule findings; it exits 1 on prettier drift in 259 files this change does not touch.

Screenshots / recordings

Code blocks under the ClickHouse theme, before (system mono fallback) and after (Inconsolata).

Mode Before After
Light Light before Light after
Dark Dark before Dark after

Risk / compatibility

Two woff2 files (about 35 KB together) join the build output and are only requested by a theme whose mono stack names Inconsolata. Deployments on the default theme see no new requests.

@berry-13
berry-13 force-pushed the berry-13/clickhouse-inconsolata branch from c6d6dc1 to 9847d13 Compare September 25, 2026 18:41
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T20:22:31.303576Z 2a9690f New commits
🔒 Security Review ✅ Completed 2026-09-25T18:45:15.146812Z c6d6dc1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c6d6dc180c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +56 to +60
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Ship the OFL with production font artifacts

In production builds this license file is never emitted: client/vite.config.ts disables publicDir and copyPublicAssets() copies only public/assets and robots.txt, while Dockerfile.multi copies only client/dist into the runtime image. The CSS references cause the WOFF2 files themselves to enter dist, so the multi-stage image redistributes Inconsolata without the notice and license required here. Emit the OFL as a bundle asset or explicitly copy it into the production artifact.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 2a9690f. Production builds disable publicDir, so only the woff2 faces reached dist; copyPublicAssets now copies the licence texts from public/fonts into assets/fonts beside them. The inconsolata-licence-ships-with-font scenario fetches both files from the served build and checks the copyright and OFL text (desktop light, dark, mobile).

The ClickHouse theme names Inconsolata as its mono family, but the app did
not ship the face, so code fell back to the system monospace. Self-host the
latin 400 and 700 woff2 faces from Fontsource 5.3.0 with their OFL licence,
declared with font-display: swap in a stylesheet of theme-opt-in faces. The
browser fetches a declared face only when text renders in it, so the default
theme never downloads them.
Production builds disable publicDir, so the woff2 faces reached dist through
the $fonts alias while the OFL text next to them in public/fonts did not. The
build now copies the licence texts from public/fonts into assets/fonts, beside
the faces they cover.
@berry-13
berry-13 force-pushed the berry-13/clickhouse-inconsolata branch from 9847d13 to 2a9690f Compare September 25, 2026 20:19
@berry-13
berry-13 merged commit 57da77c into canary Sep 25, 2026
39 checks passed
@berry-13
berry-13 deleted the berry-13/clickhouse-inconsolata branch September 25, 2026 20:54
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.

1 participant