Skip to content

fix: the debug page in the brass 1.5.0 fonts (2.29.1) - #305

Merged
compot-dev merged 2 commits into
v2from
fix/brass-fonts-304
Nov 23, 2026
Merged

compot-dev merged 2 commits into
v2from
fix/brass-fonts-304

Conversation

@compot-dev

Copy link
Copy Markdown
Collaborator

Closes #304.

The brand's brass 1.5.0 fonts on the debug page, as in the camex 6.2.1 pilot (OpenIPC/camex#221):

  • android/app/src/main/assets/fonts/: BrassSerif-Bold.woff2, BrassMono-Regular.woff2, BrassMono-Bold.woff2 and OFL.txt, byte for byte as the brand ships them (checked against its SHA256SUMS).
  • DebugServer: /fonts/<file>.woff2 answers only these three files, from the assets (read once), with font/woff2 and Cache-Control: max-age=31536000, immutable; anything else is 404. The other paths keep no-store.
  • Page CSS: tokens --serif and --mono, three @font-face rules with url(fonts/<file>.woff2?v=<version>); h1–h3 and buttons in var(--serif), everything else in var(--mono). Georgia, Courier New and system-ui are left only inside the tokens.
  • Unit tests: the fonts are served byte for byte with the year cache and other names get 404; the page uses the fonts only through the tokens.
  • tests/e2e.sh: optional PAGE_SHOTS=1 opens the page in a headless Chromium next to the emulator (tests/page-fonts.mjs over DevTools, no host port) and checks document.fonts.
  • The Android menus and dialogs are unchanged. Version 2.29.1 (versionCode 71), CHANGELOG, docs/debug.md.

Checked locally in Docker: unit tests, lint (13 warnings, as the baseline), assembleDebug, check-version.sh; e2e on API 21 and 34: UDP 19/19, TCP 20/20; with PAGE_SHOTS=1 (TCP, API 34) 21/21: Brass Serif and Brass Mono loaded at 1280 and 400 px, h1 computed "Brass Serif", Georgia, …, the board "Brass Mono", "Courier New", monospace (Brass Mono Bold stays unloaded: no bold mono text on the page).

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Serve Brass fonts on the debug page

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Bundle Brass Serif and Mono so the debug page uses the brand fonts without external hosting.
• Serve only the three font files with versioned URLs and year-long browser caching.
• Add font-serving and browser checks; document the change and release version 2.29.1.
Merge Risk 🟢 Low

Blast radius 🟢 Low 💥 1 capability

  • 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
  • The HTML page, its CSS font mapping, and the font asset endpoint form one bounded debug-page presentation capability.
  • The version query in the page and the Android asset files are propagation steps of that same browser-facing outcome, not independent capabilities.
  • No separate application or external consumer is reached by the font bytes.
Behavioral complexity 🟡 Medium 🧩 Straightforward, Compatibility cases

  • Before: the page used system/font-family fallbacks and the debug server returned 404 for unknown paths.
  • After: three fixed asset names are mapped to CSS font faces, served from the app asset bundle, cached in memory, and requested with the application version as a query token.
  • The new correctness conditions are that the allowlist, asset names, CSS family/weight mappings, and versioned URLs remain aligned, and that browser cache transitions fetch the new asset after an APK version change.
  • The asset read/cache path is a direct transformation with a simple allowlist and fallback, not a new algorithm or coordinated state protocol.
  • Compatibility_cases applies only to the materially changed browser-cache and fallback-font transition; no concurrent or persistent-state invariant was introduced.
Potential damage 🟢 Low 🩹 Cosmetic

  • Conditionally, if the new asset lookup, CSS mapping, or cache/version association fails, headings, buttons, or body text can render in fallback fonts or the page can retain an older cached font.
  • The supported impact is visual presentation of the debug page; the page's data, snapshots, logs, controls, and decoder state are not changed by this feature.
  • Recovery is normally a refresh or installation of the corrected APK; already cached assets expire after the declared cache lifetime or are bypassed by a new version query.
  • No persistent application state or external effect requires repair.
  • Revert or install a corrected APK to restore the route/CSS.
  • A browser may retain an immutable cached response until the versioned URL changes or the cache is cleared, so code rollback alone does not immediately replace every previously cached font.
  • There is no application-state repair or external compensation prerequisite.
Assessed commit 85e8bae
Diagram

graph TD
  Page["Versioned font URLs"] --> Browser["Debug browser"] --> Server["DebugServer"] --> Fonts["Bundled WOFF2"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Inline fonts in the page
  • ➕ Avoids adding font-serving routes.
  • ➖ Inflates the no-store HTML response and prevents fonts from being cached separately.

Recommendation: Keep the bundled assets and restricted font routes. They support offline LAN access while allowing the browser to cache font bytes independently of the changing debug page.

Files changed (11) +361 / -64 · 3 not counted

Bug fix (4) +116 / -60
BrassSerif-Bold.woff2Bundle the Brass Serif bold font not counted

Bundle the Brass Serif bold font

• Adds the WOFF2 asset used for debug-page headings and buttons.

android/app/src/main/assets/fonts/BrassSerif-Bold.woff2

BrassMono-Regular.woff2Bundle the Brass Mono regular font not counted

Bundle the Brass Mono regular font

• Adds the WOFF2 asset used for the debug page’s general text.

android/app/src/main/assets/fonts/BrassMono-Regular.woff2

BrassMono-Bold.woff2Bundle the Brass Mono bold font not counted

Bundle the Brass Mono bold font

• Adds the bold WOFF2 face referenced by the debug page’s font rules.

android/app/src/main/assets/fonts/BrassMono-Bold.woff2

DebugServer.javaServe allowlisted fonts and apply Brass typography +116/-60

Serve allowlisted fonts and apply Brass typography

• Serves three WOFF2 assets through '/fonts/', with year-long immutable caching while other responses retain no-store. Adds versioned font-face URLs and serif/mono CSS tokens to the debug page.

android/app/src/main/java/com/openipc/decoder/DebugServer.java

Tests (3) +141 / -1
DebugServerTest.javaTest font responses and page font rules +54/-0

Test font responses and page font rules

• Checks font response headers and byte-for-byte asset delivery, rejects other font paths, and verifies the page’s versioned URLs and typography tokens.

android/app/src/test/java/com/openipc/decoder/DebugServerTest.java

e2e.shAdd optional browser font checks to e2e +23/-1

Add optional browser font checks to e2e

• When PAGE_SHOTS is set, runs headless Chromium and a Node DevTools client beside the emulator, records the result, and cleans up the browser container.

tests/e2e.sh

page-fonts.mjsCheck loaded fonts and capture page screenshots +64/-0

Check loaded fonts and capture page screenshots

• Uses DevTools to open the debug page at desktop and narrow widths, inspect loaded font faces and computed families, and save full-page screenshots. Exits unsuccessfully if either Brass family is not loaded at either width.

tests/page-fonts.mjs

Documentation (3) +102 / -1
CHANGELOG.mdRecord the 2.29.1 font fix +7/-0

Record the 2.29.1 font fix

• Documents the new debug-page typography, bundled font delivery, caching, and unchanged Android menus and dialogs.

CHANGELOG.md

OFL.txtInclude the bundled fonts’ license +93/-0

Include the bundled fonts’ license

• Adds the SIL Open Font License and IBM copyright notice alongside the font assets.

android/app/src/main/assets/fonts/OFL.txt

debug.mdDocument debug-page font delivery +2/-1

Document debug-page font delivery

• Adds the font route to the endpoint list and describes which Brass faces the page uses.

docs/debug.md

Other (1) +2 / -2
build.gradleBump the app to 2.29.1 +2/-2

Bump the app to 2.29.1

• Changes versionCode from 70 to 71 and versionName from 2.29.0 to 2.29.1.

android/app/build.gradle

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Browser startup skips later checks ✓ Resolved
Description
e2e.sh starts the optional Chromium container with an unguarded docker run under set -eu,
rather than recording a failed page check. If the image is unavailable or Docker rejects the start,
the script exits before the subsequent tunnel-restart checks.

2. Browser disconnects can stall test runs ✓ Resolved
Description
page-fonts.mjs resolves each DevTools command only when a matching WebSocket message arrives,
without rejecting pending commands on socket closure or enforcing a timeout. If Chromium disconnects
or stops answering after connection, an awaited command remains pending and e2e.sh cannot reach
its cleanup or later checks.

Grey Divider

Tip of the day
💡 Did you know, you can keep summaries lean with Findings visible per group, which tucks the rest behind a View link

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@compot-dev

Copy link
Copy Markdown
Collaborator Author

Qodo, both fixed in 85e8bae:

  1. Browser startup skips later checks: the adb forward, the Chromium start and the DevTools client are one guarded condition now, so a failure is a failed page check and the run goes on; the container and the forward are removed either way. Checked with CHROME_IMAGE=decoder-no-such-image: the page check fails, the other 20 checks pass (the tunnel restart among them).
  2. Browser disconnects can stall test runs: every DevTools command has a 30 s timeout, a closed socket rejects the waiting commands, and the client container runs under timeout 120.
    With PAGE_SHOTS=1 (TCP, API 34): 21/21.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Qodo, both fixed in 85e8bae:

  1. Browser startup skips later checks: the adb forward, the Chromium start and the DevTools client are one guarded condition now, so a failure is a failed page check and the run goes on; the container and the forward are removed either way. Checked with CHROME_IMAGE=decoder-no-such-image: the page check fails, the other 20 checks pass (the tunnel restart among them).
  2. Browser disconnects can stall test runs: every DevTools command has a 30 s timeout, a closed socket rejects the waiting commands, and the client container runs under timeout 120.
    With PAGE_SHOTS=1 (TCP, API 34): 21/21.

Thanks for the update. I've noted that finding 1 (browser startup skips later checks) and finding 2 (browser disconnects can stall test runs) are both addressed in 85e8bae.

I haven't verified the new code, and I haven't changed either finding's status. If you want the review to re-check the commit, ask me to rerun the review. You can also dismiss the findings yourself if you consider them resolved.

@compot-dev
compot-dev merged commit 3359d5b into v2 Nov 23, 2026
7 checks passed
@compot-dev
compot-dev deleted the fix/brass-fonts-304 branch November 23, 2026 21:06
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.

Debug page: brass 1.5.0 fonts

1 participant