From 5e5301b17453d32db4c4969aa9aa63f8ea0e3900 Mon Sep 17 00:00:00 2001 From: Pascal Garber Date: Mon, 23 Nov 2026 20:07:13 +0100 Subject: [PATCH] fix(ui): keep phone controls inside the window The phone bar's row B was a homogeneous stack, so the hidden selection page (Edit/Copy/Move/Delete, 397 px in German) set the bar minimum. Adw.BreakpointBin ignores child minimums and allocated the editor wider than 360 px, clipping header, Play row and map. The probe now asserts row B adds nothing to the minimum. --- .../gjs/src/widgets/editor/phone-chrome.probe.spec.ts | 10 ++++++++++ packages/gjs/src/widgets/editor/phone-chrome.probe.ts | 1 + packages/gjs/src/widgets/editor/scene-editor.blp | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/packages/gjs/src/widgets/editor/phone-chrome.probe.spec.ts b/packages/gjs/src/widgets/editor/phone-chrome.probe.spec.ts index b6734ba6..57c005b5 100644 --- a/packages/gjs/src/widgets/editor/phone-chrome.probe.spec.ts +++ b/packages/gjs/src/widgets/editor/phone-chrome.probe.spec.ts @@ -67,6 +67,16 @@ export default async () => { for (const part of report.parts) expect(part.min).toBeLessThanOrEqual(report.floorPx) }) + await it('lets the hidden selection verbs stay out of the bar minimum', async () => { + // A homogeneous stack made the unseen Edit/Copy/Move/Delete page + // (397 px in German) the bar's minimum, so the whole editor was + // allocated wider than a 360 px window and clipped on the right. + const rowB = report.parts.find((p) => p.name.trim() === 'row B') + const recent = report.parts.find((p) => p.name.trim() === 'recent tiles') + expect(rowB).toBeDefined() + expect(rowB?.min).toBe(recent?.min) + }) + await it('keeps the Ground chip row inside its height budget', async () => { // TERRAIN.md § 10.6 budgeted 76 px for the row — a 56 px chip and // its name. The slack is for theme padding, not for a second line: diff --git a/packages/gjs/src/widgets/editor/phone-chrome.probe.ts b/packages/gjs/src/widgets/editor/phone-chrome.probe.ts index 94b5184f..d4ac4b34 100644 --- a/packages/gjs/src/widgets/editor/phone-chrome.probe.ts +++ b/packages/gjs/src/widgets/editor/phone-chrome.probe.ts @@ -186,6 +186,7 @@ export function probePhoneChrome(): PhoneChromeReport { report(' tool group', editor.toolGroup), ...(badgeButton ? [report(' badge button', badgeButton)] : []), report(' recent tiles', editor.recentTiles), + report(' row B', editor._bar_row_b), report('brush page', page), report(' plane chips', page._plane_chips), report(' layer row', page._layers_button.get_parent() ?? page._layers_button), diff --git a/packages/gjs/src/widgets/editor/scene-editor.blp b/packages/gjs/src/widgets/editor/scene-editor.blp index 1311ce61..9f52f1ee 100644 --- a/packages/gjs/src/widgets/editor/scene-editor.blp +++ b/packages/gjs/src/widgets/editor/scene-editor.blp @@ -531,6 +531,11 @@ template $PixelRpgSceneEditor : Adw.Bin { // A stack rather than two `visible` flags so the row keeps one // height and the bar above the canvas never jumps. Gtk.Stack bar_row_b { + // Not horizontally homogeneous: the HIDDEN selection page (four + // verbs, wider in German) would otherwise set the bar's minimum + // to 397 px, and `Adw.BreakpointBin` then allocates the whole + // editor that wide - header, play row and map clip at 360 px. + hhomogeneous: false; transition-type: crossfade; transition-duration: 120;