<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Frontend on PHP Boy Scout</title><link>https://phpboyscout.uk/tags/frontend/</link><description>Recent content in Frontend on PHP Boy Scout</description><generator>Hugo -- gohugo.io</generator><language>en-gb</language><copyright>Matt Cockayne</copyright><lastBuildDate>Tue, 21 Jul 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://phpboyscout.uk/tags/frontend/index.xml" rel="self" type="application/rss+xml"/><item><title>The grid that would not behave</title><link>https://phpboyscout.uk/the-grid-that-would-not-behave/</link><pubDate>Tue, 21 Jul 2026 00:00:00 +0000</pubDate><guid>https://phpboyscout.uk/the-grid-that-would-not-behave/</guid><description>&lt;img src="https://phpboyscout.uk/the-grid-that-would-not-behave/cover-the-grid-that-would-not-behave.png" alt="Featured image of post The grid that would not behave" /&gt;&lt;p&gt;I do a surprising amount of my development from a phone. Not the typing, I&amp;rsquo;m not a masochist, but the reviewing&amp;hellip; the &amp;ldquo;does this actually look right&amp;rdquo; poking at a running build in the gaps between the rest of life. The setup is simple enough: Tailscale to reach my homelab, Termux for a terminal, and Claude Code&amp;rsquo;s remote session so my actual dev machine does the heavy lifting while I just hold the small screen. It means I can pick a project back up in a supermarket car park while my wife nips in for the milk. Which is more or less where this story starts.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;d been pushing the layout around in &lt;a class="link" href="https://phpboyscout.uk/no-ai-in-my-photo-culler/" &gt;krites&lt;/a&gt;, the photo-culler I built for my wife. It&amp;rsquo;s a command-line tool first and foremost, but there&amp;rsquo;s a small studio on top for the bit where you actually want to look at the photos. And looking at photos is a big-screen job. You cull a wedding on a 27-inch monitor, not a phone. So the studio is, unapologetically, a desktop thing.&lt;/p&gt;
&lt;p&gt;The trouble is, I wasn&amp;rsquo;t at a desk. I was on my Pixel 9, in the car, reviewing the morning&amp;rsquo;s work. And the grid&amp;hellip; would not behave.&lt;/p&gt;
&lt;p&gt;The cull grid is the heart of the studio: a wall of thumbnails you skim, flag and bin. On the desktop it&amp;rsquo;s lovely. On a phone it had collapsed into something between a ransom note and a game of Tetris nobody was winning. Thumbnails overlapping their captions, a column count that made no sense for the width, controls shoved somewhere south of useful. The kind of thing you&amp;rsquo;d never ship if you&amp;rsquo;d looked at it&amp;hellip; and I&amp;rsquo;d never looked at it, because why would I review a desktop tool on a phone?&lt;/p&gt;
&lt;p&gt;Except that&amp;rsquo;s exactly what I do. So I did.&lt;/p&gt;
&lt;p&gt;I build krites for a big monitor. I review it from whatever&amp;rsquo;s in my pocket. Those are never the same place, and this bug had been sitting in the gap between them the whole time, perfectly happy, on a layout I&amp;rsquo;d simply never looked at.&lt;/p&gt;
&lt;p&gt;I wanted to be sure it really was just the narrow breakpoint and not something I&amp;rsquo;d broken everywhere, so I reached for the other end of my travelling kit: a Galaxy Tab S10 Ultra, which at fourteen inches is less a tablet than a small desk you can hold. The desktop layout on that was fine. Properly fine. So this was purely a responsive problem, the grid simply never having been told what to do when it ran out of room.&lt;/p&gt;
&lt;p&gt;The fix took several goes, all of them snapped from the phone between other errands, and the goes are the better story than any tidy &amp;ldquo;and then I fixed the CSS.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;First I tried shoving the grid into a narrow rail down the left, with the review pane beside it.&lt;/p&gt;
&lt;p&gt;&lt;img alt="krites cull grid crammed into a thin left rail on a phone" class="gallery-image portrait-shot" data-flex-basis="106px" data-flex-grow="44" data-title-escaped="Attempt one: the grid as a thin left rail, review pane alongside. Tolerable on the fourteen-inch tablet, still cramped on a phone." height="2424" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://phpboyscout.uk/the-grid-that-would-not-behave/grid-left-rail_hu_e36036ba97801a8e.webp" srcset="https://phpboyscout.uk/the-grid-that-would-not-behave/grid-left-rail_hu_de704a4ba014d88b.webp 480w, https://phpboyscout.uk/the-grid-that-would-not-behave/grid-left-rail_hu_dadf7a9f811fb123.webp 720w, https://phpboyscout.uk/the-grid-that-would-not-behave/grid-left-rail_hu_e36036ba97801a8e.webp 1080w" title="Attempt one: the grid as a thin left rail, review pane alongside. Tolerable on the fourteen-inch tablet, still cramped on a phone." width="1080"&gt;

&lt;/p&gt;
&lt;p&gt;Then a proper grid up top with the preview below it, which was closer.&lt;/p&gt;
&lt;p&gt;&lt;img alt="krites cull grid as a three-column grid above the preview pane" class="gallery-image portrait-shot" data-flex-basis="106px" data-flex-grow="44" data-title-escaped="Attempt two: a three-column grid up top, preview below. Closer, but the preview pane was not earning the space it took." height="2424" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://phpboyscout.uk/the-grid-that-would-not-behave/grid-three-column_hu_2e31f04a3db78b3b.webp" srcset="https://phpboyscout.uk/the-grid-that-would-not-behave/grid-three-column_hu_a54f79817242b8da.webp 480w, https://phpboyscout.uk/the-grid-that-would-not-behave/grid-three-column_hu_2b46081de163ce33.webp 720w, https://phpboyscout.uk/the-grid-that-would-not-behave/grid-three-column_hu_2e31f04a3db78b3b.webp 1080w" title="Attempt two: a three-column grid up top, preview below. Closer, but the preview pane was not earning the space it took." width="1080"&gt;

&lt;/p&gt;
&lt;p&gt;And then, because there is always one, a fix for the tile sizing backfired and collapsed every thumbnail into a coloured sliver.&lt;/p&gt;
&lt;p&gt;&lt;img alt="krites cull grid collapsed into thin coloured slivers along the bottom of the screen" class="gallery-image portrait-shot" data-flex-basis="106px" data-flex-grow="44" data-title-escaped="The one I will be showing people for years: a fix for the tile height collapsed the whole grid into slivers, mid-cull on a real 250-photo ceremony shoot." height="2424" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://phpboyscout.uk/the-grid-that-would-not-behave/grid-collapsed_hu_1a972726c1f02650.webp" srcset="https://phpboyscout.uk/the-grid-that-would-not-behave/grid-collapsed_hu_430a0c5855050afd.webp 480w, https://phpboyscout.uk/the-grid-that-would-not-behave/grid-collapsed_hu_148a2e45a680ab05.webp 720w, https://phpboyscout.uk/the-grid-that-would-not-behave/grid-collapsed_hu_1a972726c1f02650.webp 1080w" title="The one I will be showing people for years: a fix for the tile height collapsed the whole grid into slivers, mid-cull on a real 250-photo ceremony shoot." width="1080"&gt;

&lt;/p&gt;
&lt;p&gt;The version that finally held was the boring one. Put an explicit row height and an aspect ratio on the tiles so they can&amp;rsquo;t collapse, let the columns drop away as the viewport narrows, fall back to a single column when there&amp;rsquo;s genuinely no room for more, and keep the controls reachable with a thumb instead of assuming a mouse. Nothing clever. Just actually accounting for the small screen instead of pretending it wouldn&amp;rsquo;t happen.&lt;/p&gt;
&lt;p&gt;The lesson I took away wasn&amp;rsquo;t really about CSS, though. It was about &lt;em&gt;where I work&lt;/em&gt;. The homelab-in-your-pocket setup started as a convenience, a way to not lose an hour just because I was away from the desk. But it turns out it&amp;rsquo;s also a permanent, accidental test rig for exactly the conditions I&amp;rsquo;d never sit down and recreate on purpose. I am, most days, my own worst-case user: wrong screen, one hand, half my attention on the milk.&lt;/p&gt;
&lt;p&gt;krites is a tool you&amp;rsquo;re meant to use at a desk. As it happens, the best way I&amp;rsquo;ve found to catch its away-from-the-desk bugs is to almost never be at one.&lt;/p&gt;</description></item></channel></rss>