frontend
Technical notes on web development, DevOps, and AI integration.
173 articles
- 08:54frontend
One Directive, One Whole Module: the Call That Cannot Exist
A helper imported from a client-marked file arrives as a reference, not a function. The runtime error and the neutral-module pattern that fixes it.
TL;DR: Error occurred on a Server Component page. The issue was caused by a client marker directive in a module file. Moving the helper function to a neutral module resolved the issue.
#nextjs#react#typescript - 18:56frontend
One Entity Route Template for Every Department in Next.js
Three duplicated route sets became one parameterized view layer: a pillar registry, thin routes per department, and canonicals that follow the module base.
TL;DR: Department links pointed to the wrong URL. A pillar registry and shared views were created to fix this. The refactor removed 800 lines of code.
#nextjs#routing#app-router - 19:18frontend
Moving a Section Between Pages in the Next.js App Router
A UI section never moves alone in the App Router: its data fetches, fallbacks, and the origin page's dead data path all have to move too.
TL;DR: The KotaPortal homepage had a legacy hero section. It was moved to the tourism page. The section's data fetches were also relocated.
#nextjs#react#app-router - 16:03frontend
Hero Media Grading: Three Overlay Layers Guarding Text Contrast
A white headline nearly vanished over a bright hero photo. One flat dim layer was not enough; three overlay layers plus text shadows fixed it.
TL;DR: Text disappears on bright images. A layered approach solves this. Contrast is improved with dimming, scrim, and glow.
#css#accessibility#wcag - 14:54frontend
YouTube Embeds in a Hero: Why the Black Bars Appear and the Fixes
A 1440x420 hero with a YouTube iframe grows two thick black bars. The cause sits in the player; three fixes: grid backdrop, cover-crop, ratio.
TL;DR: YouTube videos in iframes maintain their 16:9 ratio. Black bars appear when the container ratio differs. Filling or cropping the space is necessary.
#css#youtube#tailwind-css - 14:19frontend
The Filter Chip That Quietly Dropped Rows
A client-side filter over a paginated endpoint drops rows it never fetched. The fix: a 500-row fetch ceiling, aria-pressed, and a sort deliberately left out.
TL;DR: The chip filters submissions in the browser. It works with a limited set of rows. A 500-row limit was added with a comment naming the ceiling.
#javascript#ux#accessibility - 13:08frontend
The sidebar was organized by function, not by task
A nav group named after a permission layer means nothing to operators. The regroup follows tasks instead of module boundaries.
TL;DR: The sidebar was reorganized by task, not function. Links are now grouped by division or citizen services. A read-only icon marks unusable entries until backend permissions are updated.
#ux#information-architecture#navigation - 10:40frontend
Dead Links in the Admin Sidebar: Menus That Always 403 Must Go
An admin audit found two menu entries that always end in 403 and seven items still marked read-only. Both were removed, and the tests now assert the absence.
TL;DR: Audit found dead links in admin sidebar. Nav was not broken, just advertising inaccessible routes. Fix involved hiding links from department accounts.
#rbac#ux#nextjs - 03:56frontend
Four Groups: Navigation Follows Permission, Not Content
The admin sidebar splits into four groups that state permission: your own section for writing, other sections read-only, plus a temporary group.
TL;DR: The admin sidebar was split into four permission-based groups so users can see what they can write to before clicking. The layout is built from one RBAC capability map rather than static lists, keeping read-only sections clearly marked. Server-side authorization still enforces access, and tests confirm the change.
#rbac#nextjs#ux