frontend
Technical notes on web development, DevOps, and AI integration.
173 articles
- 08:16backend
The One Forgotten Line: How a DTO Mapper Crashed the Frontend
A field existed on the entity but never made it into the response mapper: the API answered with an empty string and the edit page crashed. One line plus a regression test closed it.
TL;DR: Saving announcements crashed because the backend mapper forgot to copy Status, sending an empty string that broke the frontend badge lookup. The fix added the missing field, added a regression test, and made the UI whitelist statuses to default to draft. Navigation was also switched to router push and refresh to keep toast feedback without a full reload.
#golang#react#typescript - 07:29frontend
When PARIWISATA Screams Inside a Dropdown That Should Look Tidy
Raw UPPERCASE enum values leaked into four admin render spots; one formatter became the single display door, the ?? fallback stays double-edged.
TL;DR: The database correctly stored bidang values in uppercase, but four UI spots were displaying the raw values instead of the formatted labels. An existing formatBidang helper was already available but hadn't been wired into those components. The fix routes all display through that single formatter while keeping raw values for backend validation, touching just six lines across two files.
#typescript#react - 05:37backend
COALESCE at the API Door: Keep the ALL Sentinel in the Query
A super-admin without a bidang returns NULL from the database. One COALESCE in the login query keeps the API contract total and the admin badge correct.
TL;DR: The badge broke for super-admins because their bidang is NULL and old tokens don't even have the field. Rather than patching each Go handler, the team used COALESCE(bidang, 'ALL') in SQL to guarantee a valid string everywhere. TypeScript keeps bidang optional for legacy sessions, and React only renders the badge when the value isn't ALL.
#mysql#golang#typescript - 04:23backend
XLSX Export from Go, and the Binary Guess That Missed
openapi-fetch does have parseAs blob. The friction is binary-format typing and the DOM download flow.
TL;DR: I assumed openapi-fetch couldn't handle binary downloads, but checking the source showed it supports blobs just fine. The real hurdles were typing that masks blobs as strings and the manual DOM work to trigger downloads. On the backend, the Go export validates module filters and always returns a valid file via excelize, even when empty.
#go#excelize#openapi-fetch - 17:46frontend
Taking 242 Client Names Out of an Image
242 client names used to live inside one image. Now they are indexed text, readable by screen readers, with a total computed from the data.
TL;DR: Client names were locked in a JPEG, invisible to screen readers and Google. The fix moved 242 names into a typed TypeScript module grouped by sector and rendered them as real searchable HTML with Next.js. The image stays for visual proof under WCAG's logo exception, while live text keeps the list accessible, indexed, and always in sync.
#nextjs#seo#accessibility - 13:59frontend
One Design Language for Every Page
The homepage redesign left five subpages looking like a different website. The fix was not restyling each page by hand but extracting shared components.
TL;DR: Shipping a polished homepage exposed inconsistent spacing, heroes and buttons across other pages. Instead of patching each page, the fix extended two components, page-hero.tsx and page-cta.tsx, plus a borderless card pattern using layered gradients, CSS variable tokens and consistent pill buttons. Pages now share the same visual language through props while keeping unique content, so updates happen in one place.
#css#design#frontend - 11:38frontend
12 Commits Just to Stick a Badge on a Mascot's Chest
The technical challenge of placing an ISO badge on a mascot: positioning, border-radius, and CSS animations that don't collide.
TL;DR: Overlaying an ISO certification stamp on a mascot broke on mobile because fixed pixel sizing covered the character's face. Switching to a relative container with aspect-ratio and percentage positioning, or grouping elements in SVG, keeps the badge proportional at any size. Separate badge files per language and aria-labels keep things accessible and localized.
#css#tailwind#nextjs - 10:26frontend
Four Commits, One Flag: When the Image Optimizer Is the Bug
Flat-color artwork turned muddy by the default WebP quality-75 pipeline: a single unoptimized flag served the original file untouched.
TL;DR: The Next.js Image component's default lossy WebP pipeline at quality 75 wrecked flat-color mascot artwork, adding fat edges and banding the pristine PNG never had. Instead of touching global config, the fix was one unoptimized prop on that single hero slot; the 170 KB file is small enough that skipping optimization costs little. Photos stay optimized.
#nextjs#next-image#webp - 10:18frontend
A Sticker on the Wrong Wall: One Brand Mark, Two Files
A dark pill was a patch, not a fix: a brand mark needs two assets the moment a site ships a real, user-controlled dark mode.
TL;DR: A brand wordmark can't work on both themes as one asset, so two Next.js Image components share one slot, toggled with dark:hidden and dark:block—zero JavaScript. The Tailwind v4 gotcha: dark defaults to prefers-color-scheme, not a class, so the override must respect the manual toggle. Filters and single-file hacks fail; two files keep theme state in one place.
#css#tailwind#dark-mode