Field Notes
Architecture Decisions
| Decision | Rationale | Alternatives Considered |
|---|---|---|
Vendor JS loaded separately from bundled JS |
|
Bundle everything into site.js |
Cookie persistence for theme (not localStorage) |
Cookies are accessible in inline |
localStorage (requires |
CSS custom properties with |
Attribute selectors allow theme switching without reloading CSS.
Single |
SCSS variables (requires rebuild per theme); separate CSS files (multiple cache entries) |
Inline FOUC prevention script in |
Must execute before CSS |
External script with |
Single |
All themes load with a single HTTP request.
Only the active |
Per-theme files loaded on demand (complexity, FOUC risk, extra requests) |
cssnano rule merging disabled |
Theme selectors ( |
Custom cssnano plugin to exclude attribute selectors (over-engineered) |
Glassmorphism pill toggles (fixed position) |
Non-intrusive, visible on all pages, consistent with modern UI patterns. Fixed position means they don’t interfere with document flow. |
Settings page; keyboard-only; dropdown in navbar |
Lessons Learned
| Lesson | Context |
|---|---|
FOUC prevention requires script before CSS link tag |
Early attempts placed the theme detection script in |
|
Synchronous loading of the highlight bundle (43 lines, but parses many language grammars) added ~200ms to page load. Async loading defers it until after the page is interactive. |
cssnano version matters for theme preservation |
cssnano v4.1 with |
|
Attempted |
|
|
CF Access requires service token, not API token |
Cloudflare Access Applications use service tokens (Client ID + Client Secret pair). API tokens are for the Cloudflare API itself. Spent time debugging 403s before discovering the token type distinction. |
nav-explore grouping/sorting was reverted |
Attempted to add |
Known Quirks
| Quirk | Workaround |
|---|---|
stylelint v13 reports false positives on CSS custom properties |
Suppress with inline |
gulp 4 task registration differs from gulp 3 |
Use |
|
Only occurs with certain npm package combinations; current deps are clean |
Theme toggle z-index (1001) can overlap modals |
No modals currently in the UI; would need adjustment if added |
highlight.js 9.18.3 is legacy |
Pinned for compatibility with the Antora build pipeline; upgrading to v11+ requires build config changes |
Backlog
| Priority | Item | Notes |
|---|---|---|
P1 |
Responsive navbar breakpoint tuning |
Current breakpoint causes menu overflow on tablets |
P1 |
Print stylesheet per-theme adjustments |
Print currently uses base colors regardless of active theme |
P2 |
Accessibility audit for theme contrast ratios |
WCAG AA compliance check for all 7 themes |
P2 |
Theme preview thumbnails |
Show mini-preview of each theme in the toggle |
P2 |
Migrate from gulp to esbuild |
Reduce build time, modernize toolchain, smaller dependency tree |
P2 |
nav-explore component grouping (re-attempt) |
Group by category (Infrastructure, Security, etc.) — failed first attempt |
P3 |
Automated visual regression testing |
Screenshot comparison on PRs using Playwright |
P3 |
Keyboard shortcut help overlay |
Show available shortcuts (F for focus, Esc to exit) on |
Completed (2026-04-04)
| Item | Resolution |
|---|---|
Toggle buttons inaccessible ( |
Converted to |
Clipboard API missing error handler |
Added |
No |
JS now defaults to |
Inline styles in JS (87-char |
Extracted to |
Missing |
Added |
Burger button missing |
Added |
Cookie parsing used naive regex |
Replaced with |
Focus toggle active state used inline styles |
Extracted to |
Scope Creep Log
| Date | Item | Outcome |
|---|---|---|
2026-03-25 |
nav-explore redesign with groupBy/sortBy |
Reverted — Handlebars helpers caused CI failures. Documented in CR. |
2026-03-26 |
Aurora + Ocean themes |
Shipped. Originally planned only Royal as the next theme. |
2026-04-01 |
Ember theme |
Shipped. User requested a warm-toned option for late-night reading. |
2026-03-28 |
MathJax v3 integration |
Shipped. Added for Gabriel’s mathematics documentation (LaTeX support). |
2026-03-27 |
Expanded runbooks + tools navbar dropdowns |
Shipped. Grew from 8 links to 28 as runbook count increased. |
2026-04-04 |
Accessibility + robustness audit |
Shipped. 8 fixes: semantic buttons, ARIA, clipboard error handling, prefers-color-scheme, inline style extraction, main landmark, cookie hardening. |
Improvement Proposals
|
Proposals from full UI + ecosystem audit — 2026-04-04. For team review and prioritization. |
CSS & Theming
| Priority | Proposal | Rationale | Effort |
|---|---|---|---|
P1 |
Refactor 758 |
Specificity wars make cascade-based overrides impossible. Accounts for ~32% of all declarations in domus-theme.css. |
L |
P1 |
Responsive navbar breakpoint tuning |
Current breakpoint causes menu overflow on tablet-width viewports. Dropdowns clip off-screen. |
M |
P2 |
Extract 316 hardcoded hex colors to CSS variables |
35 instances of |
L |
P2 |
WCAG AA contrast audit across all 7 themes |
No documented contrast ratios. Some theme combinations (Ember muted text, Aurora low-saturation accents) may fall below 4.5:1. |
M |
P2 |
Responsive table styling for mobile |
Tables overflow horizontally on small screens with no scroll wrapper. Enterprise docs are table-heavy. |
M |
P2 |
Expand print stylesheet (table borders, page breaks) |
Current |
M |
P1 |
Document PDF theme ↔ web theme relationship |
Three |
S |
P1 |
PDF monospace font lacks Unicode box-drawing + Greek characters |
PDF renders ╱╲ as ¬ in ASCII art diagrams and δγφ as ¬ in body text. The default PDF theme monospace and body fonts need replacement with fonts that cover Unicode box-drawing (U+2571-2572), Greek (U+03B1-03C9), and mathematical symbols. Candidates: Noto Sans/Mono, DejaVu Sans/Mono. Affects all |
M |
Toolchain & Dependencies
| Priority | Proposal | Rationale | Effort |
|---|---|---|---|
P2 |
Upgrade highlight.js 9.18.3 to 11.x |
4 major versions behind (2019 vintage). Missing language support for Terraform, Go, Rust, Kotlin. Security patches unavailable. |
M |
P2 |
Migrate from gulp to esbuild |
Gulp 4 + Browserify + PostCSS chain is 6 years old. esbuild reduces build time from 1.6s to ~200ms with a fraction of the dependency tree. |
L |
UX Enhancements
| Priority | Proposal | Rationale | Effort |
|---|---|---|---|
P3 |
Image lightbox/zoom for screenshots and diagrams |
Documentation contains architecture diagrams and screenshots that are unreadable at inline size. Lightbox enables full-screen viewing. |
S |
P3 |
Back-to-top button for long pages |
Pages like thinkpad-t16g phases are 1000+ lines. A sticky "back to top" button reduces scroll fatigue. |
S |
P3 |
Dark mode image handling |
Images with light backgrounds are harsh in dark themes. CSS filter (opacity reduction or inversion) improves visual comfort. |
S |