summaryrefslogtreecommitdiff
path: root/modules/orgflow-ui/src/wasmJsMain/resources/phone-host.html
AgeCommit message (Collapse)Author
2026-09-26Phone layout: tab icons, short labels, and a working way to shoot at phone widthcharlie
The narrow layout was already implemented to 2.22's skeleton, but measuring it at a real phone width found two problems, and getting to that measurement took three failed approaches worth recording. Why a Galaxy S25 user agent changed nothing: Firefox will not make a window narrower than 500 CSS px. Requesting 380/400/412/450/500 returned 500 every time, while 600 and 700 were honoured exactly. An S25 is 384-412 px, so the real width is unreachable in a top-level window - the limit is the window, not the UA. Shrinking the Compose canvas element to 384 also failed: the canvas attribute became 384 but Compose kept laying out against 500, so the capture showed 500-wide content cut off at 384 and the tab bar lost Live and settings off the right edge. What works is an iframe of the exact size - it has its own viewport, so the app inside sees innerWidth 384 and Compose lays out against real dimensions. phone-host.html is now part of the web resources so it ships with the bundle, and shot-phone.py drives it. Recorded as 2.29 so this is not re-derived later. With a true 384px viewport, the tab bar did not fit. Laying labels out with SpaceEvenly got only Home, Timeline, Calendar and Note on screen; Live and settings were pushed off and never drawn. Six text labels do not fit 384px. So the tabs are now an icon over a short label, each weighted equally (2.28): - icons drawn on a Canvas, no image assets: house, list, calendar, page, camera, gear - short labels, chosen rather than truncated - cutting a word mid-way makes it unreadable, so separate short names are used: Home / Line / Cal / Note / Live / Settings - labels stay English. One tab reading 設定 among five English ones mixes languages inside a single row; in-page headings stay Japanese, but the tab row is a list of proper names. - icons are never shown alone, for the same reason 2.22 rejected an icon-only nav: NN/g's Icon Usability (2014) found icons on their own do not convey meaning reliably. Wide layout gets the same six glyphs on the left-column nav, as asked. The same frame now looks the same at both widths, so nothing has to be relearned when the window changes; wide has room for the full words, so it keeps "Timeline" and "Calendar". Calendar bar, per the same request: the centre pill on the month view is now 今月 rather than 今日 (the day view keeps 今日), and the pill is drawn with a fill so it reads as pressable rather than as a heading. Both bars were re-measured at 384px and fit. One capture trap worth knowing: the browser profile is reused so the wasm caches and startup is fast, which means a stale build can be served and the screenshot silently shows the previous version - it did, showing "Time" and "設定" after those strings had already changed. The URL now carries a cache-buster that the harness forwards to the inner iframe.