frontend
Technical notes on web development, DevOps, and AI integration.
173 articles
- 12:01frontend
KotaPortal's Palette Was Empty and Nothing Ever Complained
backgroundColor in the file, background-color in the reader: both legal, never meeting. An empty palette with zero errors anywhere.
TL;DR: MockForge's capture emitted camelCase JSON keys, but the derivation step looked up kebab-case names, yielding an empty palette and fonts with zero errors. Every layer was individually correct: getComputedStyle supports both spellings, JSON allows any keys, and getPropertyValue returns empty strings on misses. Fix: producer now emits kebab-case keys, plus a guard script validating shape at the boundary.
#css#json#javascript - 00:40frontend
Deep-Link Video in Mega Menu: URL, State, Preload Done Right
Three URL layers for mega menu video deep-links: path for identity, query for panel state, hash for timestamp. Manual sync of video.currentTime to hash. Preload metadata + poster, not auto. Prefetch route on hover, not auto.
TL;DR: Use path segments for video identity, query strings for panel state, and hash fragments for timestamps to create bookmarkable URLs. React Activity preserves component state but not video playback, so manually sync currentTime with the hash on mount and timeupdate. For mega panels, set preload="metadata" with posters and manually prefetch on hover since hidden elements skip automatic prefetching.
#frontend#performance#nextjs - 00:44frontend
Why Popular Video Cards Have No Thumbnails
Popular marquee cards checked explicit thumbnails, leaving video items on gradients. Fix: explicit thumbnail → i.ytimg hqdefault → gradient. hqdefault always exists for public videos.
TL;DR: Video items showed a gradient placeholder. A fallback chain was added to display thumbnails. It uses YouTube's image CDN for video thumbnails.
#frontend#performance#nextjs - 00:36frontend
Why the "Popular" Marquee Across Three Pillars Looks Empty — and How to Fill It
Marquee populer 3 pilar (olahraga/kebudayaan/kepemudaan) kosong di pilar muda. Fix: parallel fetch popular + random, mergePopularWithRandom dedupe by id, popular priority, slice 9.
TL;DR: KotaPortal's marquee looked half-empty. Server-side parallel fetch and merge dedupe fixed this. Young pillars now display 9 items.
#frontend#performance#nextjs - 22:44frontend
Hover-Only Affordance: Why Buttons Disappear on Touch Screens
An opacity-0 hover arrow hides the fact that a category row is clickable. Affordance lessons from replacing it with an always-visible View pill.
TL;DR: The portal's statistics category row was not interactive on desktop without a hover effect. A visible "View" pill was added to make the row's interactivity clear. This change improved usability across devices.
#css#ux#accessibility - 21:55frontend
Splitting the Grid: a Server-Rendered First Page, a Client Tail
The pillar grid held the whole page render hostage to one API call. Page one stays server-rendered, the rest moved into a client island.
TL;DR: The pillar profile page had a grid with twelve cards. Raising the limit did not speed up the page. The grid was split into server and client components.
#nextjs#react#pagination - 21:12frontend
YouTube Dead in Production: The Referer the Player Needed
The YouTube iframe worked locally and died on deploy: a same-origin Referrer-Policy stripped the referer the player needs, fixed per element.
TL;DR: YouTube iframes were broken. The issue was caused by a Referrer-Policy header. Adding a referrerPolicy attribute to each iframe fixed it.
#youtube#iframe#http - 20:23frontend
Name the Entity Before You Take the Photo
Pulling photos from Google Maps is easy; standing behind them is not. Matching the page title to the entity caught three wrong photos in one backfill.
TL;DR: Images were missing from a culture grid. Entity data was healthy, but image supply was the issue. A solution was found by verifying images from Google Maps.
#google-maps#images#data-quality - 10:43frontend
The Validation Gate Before Third-Party Photos Enter a Grid
Name matching first, image checked after load, revert when in doubt: the validation gate that keeps third-party photos from poisoning a public grid.
TL;DR: Images were missing from a culture grid. Entity data was healthy, but image supply was the issue. A solution was found, but with limitations and a need for further verification.
#data-quality#api#frontend