frontend
Technical notes on web development, DevOps, and AI integration.
173 articles
- 02:48frontend
A 760-Pixel SVG Diagram Against a 182mm Print Column
A generated 760px SVG works out to about 201mm, while the A4 text column is 182mm. One template rule and an ink-bounds probe closed the gap.
TL;DR: Generated SVG diagrams were authored at 760px, which overflows the 182mm A4 print column by about 19mm. The fix adds a shared stylesheet rule sizing figures at 100% width with auto height, so every report in the family inherits correct print sizing. An ink-bounds probe confirmed zero violations across reprinted PDFs.
#css#svg#pdf - 23:05frontend
The Role Choice That Did Not Survive a Page Change
Role state in a static manual reset on every navigation; sessionStorage turned out to be the right storage tier, not localStorage.
TL;DR: Role selections reset on every sidebar click because the generator ships 26 standalone HTML pages, so DOM state dies with each page load. localStorage and URL parameters were rejected as overkill, since they persist across visits or leak filters into shared links. sessionStorage fits perfectly, partitioned per tab, with a template guard and aria-pressed resync.
#javascript#localstorage#ux - 22:18frontend
The Sidebar Preview That Filtered the Wrong Thing
A role preview that filtered the full sidebar showed a view no account ever saw. The fix: derive the simulation from the production nav builder itself.
TL;DR: The manual sidebar initially exposed all navigation at once, so a role preview bar was added using a hand-written map that quickly drifted from what accounts actually see at login. A follow-up commit replaced filtering with pre-rendered per-role templates mirroring the production nav builder at build time. The takeaway: simulations must derive from the same rule source as the systems they simulate.
#javascript#rbac#accessibility - 21:12frontend
Manual Sidebar by Domain: One Block, Five Owners, Five Sections
A generated admin manual mixed eight modules from five domains into one sidebar block. The fix: split along the ownership map and bound each group visually.
TL;DR: The admin manual sidebar lumped modules from five different domains into one block, so staff couldn't find their section. Splitting navigation by domain using the admin panel's existing ownership map as the source of truth made grouping match how readers think. Adding labels and borders follows common-region and accessibility principles so each group is visually clear.
#documentation#generator#information-architecture - 20:13frontend
Sidebar Icons from lucide-react Geometry, Extracted at Build Time
Twenty-seven manual sidebar icons drawn from real lucide-react geometry extracted at build time: inline SVG, zero runtime, theme-aware color.
TL;DR: The article explains how Lucide icons are geometry data tuples rather than images, letting a static manual generator extract and inline them as SVGs without React dependencies. By reading directly from lucide-react at build time and wrapping tuples in a standard SVG shell, the manual gets identical icons with currentColor theming and zero runtime overhead. A fallback bucket ensures no navigation links disappear silently when the source layout changes.
#lucide#svg#javascript - 19:30frontend
The Per-Division Menu Access Map: One Nav Contract, Two Sources
The generated manual index now answers which menus each account can open, with a two-source contract keeping the map in step with the live nav.
TL;DR: A generated manual index was missing access mappings showing which menus each account type could open. The team built filterable access cards into the generator, synchronized with navigation changes through a documented contract. Toggle chips with proper ARIA states keep six division cards scannable while meeting WCAG accessibility requirements.
#css#accessibility#javascript - 17:54frontend
Menu Toggle Did Nothing: The One-Attribute defer Fix
Tap the hamburger, nothing happens, console clean: the click bindings ran before the DOM existed. The fix is one attribute on the script tag.
TL;DR: On first deploy, the mobile drawer's hamburger button was dead, with no console errors to hint why. The culprit: app.js ran from head before body elements existed, so null guards silently skipped the bindings. Adding defer to the script tag in the generator template fixed every page after one rebuild.
#javascript#css#documentation - 03:58frontend
Topbar, Step Cards, Chips: Polishing Generator Docs Pages
A manual full of screenshots with no wayfinding gets admins lost. The fix is generator-level chrome: sticky topbar, step cards, chips, and exit links.
TL;DR: The generated manual pages lacked navigation, so I moved page chrome into the generator with a single stylesheet and template covering topbar, sticky headers, and exit links. Step cards, capacity chips, and tables now render from data using CSS grid and color-mix tokens. Video frames use aspect-ratio to prevent layout shift, all applied automatically at regeneration.
#css#documentation#layout - 03:13frontend
Static Manual Generator Recipe: Token Ranking, Theme, and Media
Building a static manual that can be searched from an ordinary folder: media paths that never 404, token ranking, a dark theme, and a caption contract.
TL;DR: Images broke on deeper pages because file:// reads slash paths as filesystem paths, so compute relative paths at build time with path.relative(). Search ships as a plain script into IndexedDB with weighted scoring, versioned via the manifest's capturedAt. Theme lives harmlessly in localStorage, captions enforce per group, and output is a plain folder with index and PDF.
#indexeddb#javascript#documentation