From 0d24b7fda23a4d809520bd10ae2e1c844a86d00f Mon Sep 17 00:00:00 2001 From: David Reinecke <6206278+dreinecke@users.noreply.github.com> Date: Tue, 10 Nov 2026 19:49:20 +0000 Subject: [PATCH 1/3] Keep search inline at one-third screen width (C-079) --- ui/App.qml | 2 +- ui/tests/qml/tst_app_navigation.qml | 52 +++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/ui/App.qml b/ui/App.qml index 6009e44d..bc12fb39 100644 --- a/ui/App.qml +++ b/ui/App.qml @@ -1387,7 +1387,7 @@ Item { objectName: "app-title-bar" readonly property bool searchVisible: !root.showPage && !root.composing readonly property bool searchStacked: searchVisible - && width - headerLeft.width - headerRight.width - MailStyle.space(52) < MailStyle.space(220) + && width - headerLeft.width - headerRight.width - MailStyle.space(52) < MailStyle.space(115) readonly property real topRowHeight: Math.max(MailStyle.space(48),headerLeft.height + MailStyle.space(12),headerRight.height + MailStyle.space(12)) anchors.top: parent.top anchors.left: parent.left diff --git a/ui/tests/qml/tst_app_navigation.qml b/ui/tests/qml/tst_app_navigation.qml index dd1d25d7..203879b6 100644 --- a/ui/tests/qml/tst_app_navigation.qml +++ b/ui/tests/qml/tst_app_navigation.qml @@ -696,6 +696,58 @@ Item { compare(mailService.count("calendar"), before + 1) } + function test_search_stays_between_the_buttons_at_one_third_screen_width() { + var host = null + for (var index = 0; index < app.data.length; index++) { + var candidate = app.data[index] + if (candidate.title === "✉️ Magpie Mail" && candidate.minimumSize !== undefined) host = candidate + } + verify(host, "the real Magpie window is in the fixture") + var oldWidth = host.width + var oldHeight = host.height + var oldMinimumWidth = host.minimumSize.width + var oldMinimumHeight = host.minimumSize.height + var oldBody = Style.font.body + try { + var header = named(app, "app-title-bar") + var search = named(app, "search-bar") + var folder = named(app, "folder-button") + var menu = named(app, "app-menu-button") + Style.font.body = 12 + Style.spacingScale = 2 + Style.spacingScale = 1 + waitForRendering(app) + host.width = 640 + host.height = 800 + waitForRendering(app) + compare(header.searchStacked, false, "search stays on the top row at 640 points") + var searchRight = search.mapToItem(header, search.width, 0).x + var folderLeft = folder.mapToItem(header, 0, 0).x + verify(searchRight <= folderLeft, "the inline field does not touch the folder button") + var searchLeft = search.mapToItem(header, 0, 0).x + var menuRight = menu.mapToItem(header, menu.width, 0).x + verify(searchLeft >= menuRight, "the inline field does not touch the menu button") + host.minimumSize = Qt.size(240, 480) + host.width = 300 + waitForRendering(app) + compare(host.width, 300, "the fixture resized the real window") + verify(header.width > 0 && header.width <= 300, "the header follows the real window") + compare(header.searchStacked, true, "search moves below only when the controls leave too little room") + } finally { + host.minimumSize = Qt.binding(function() { return Qt.size(Style.space(640), Style.space(480)) }) + Style.spacingScale = 2 + compare(host.minimumSize.width, oldMinimumWidth * 2, "the minimum-width binding follows the shell scale") + compare(host.minimumSize.height, oldMinimumHeight * 2, "the minimum-height binding follows the shell scale") + Style.spacingScale = 1 + compare(host.minimumSize.width, oldMinimumWidth, "the original minimum width is restored") + compare(host.minimumSize.height, oldMinimumHeight, "the original minimum height is restored") + host.width = oldWidth + host.height = oldHeight + Style.font.body = oldBody + waitForRendering(app) + } + } + function test_calendar_handoff_keeps_the_mail_header() { var compose = named(app, "compose-button") verify(compose && compose.visible) From d3c2ef79ec3eb1abd48ea519ba04e2c9041bdfe2 Mon Sep 17 00:00:00 2001 From: David Reinecke <6206278+dreinecke@users.noreply.github.com> Date: Fri, 13 Nov 2026 05:15:43 +0000 Subject: [PATCH 2/3] Keep unified search inline at 640 points (C-079) --- ui/App.qml | 2 +- ui/tests/qml/imports/qs/Commons/Style.qml | 8 ++++---- ui/tests/qml/tst_agent_interaction.qml | 2 +- ui/tests/qml/tst_app_navigation.qml | 17 ++++++++++------- ui/tests/qml/tst_inbox_bundles.qml | 1 + ui/tests/qml/tst_picker_keyboard.qml | 1 + 6 files changed, 18 insertions(+), 13 deletions(-) diff --git a/ui/App.qml b/ui/App.qml index bc12fb39..78904cf2 100644 --- a/ui/App.qml +++ b/ui/App.qml @@ -1387,7 +1387,7 @@ Item { objectName: "app-title-bar" readonly property bool searchVisible: !root.showPage && !root.composing readonly property bool searchStacked: searchVisible - && width - headerLeft.width - headerRight.width - MailStyle.space(52) < MailStyle.space(115) + && width - headerLeft.width - headerRight.width - MailStyle.space(52) < MailStyle.space(105) readonly property real topRowHeight: Math.max(MailStyle.space(48),headerLeft.height + MailStyle.space(12),headerRight.height + MailStyle.space(12)) anchors.top: parent.top anchors.left: parent.left diff --git a/ui/tests/qml/imports/qs/Commons/Style.qml b/ui/tests/qml/imports/qs/Commons/Style.qml index ded70ff3..2ff04683 100644 --- a/ui/tests/qml/imports/qs/Commons/Style.qml +++ b/ui/tests/qml/imports/qs/Commons/Style.qml @@ -8,14 +8,14 @@ QtObject { readonly property int focusBorderWidth: 1 readonly property color normalBorderColor: normalBorderFor(Commons.Color.foreground, Commons.Color.accent) readonly property var font: ({ - family: "monospace", iconFamily: "monospace", title: 22, heading: 18, body: 14, bodySmall: 13, caption: 11, - icon: 16, iconSmall: 14, iconLarge: 18 + family: "monospace", iconFamily: "monospace", title: 22, heading: 18, body: 12, bodySmall: 11, caption: 10, + icon: 14, iconSmall: 11, iconLarge: 18 }) // Invariant: popup rows need the shell's nonzero height so pointer events // reach the menu instead of the controls underneath it. readonly property var spacing: ({ - controlPaddingX: 8, controlPaddingY: 5, inputPaddingY: 5, tooltipPaddingX:8, tooltipPaddingY:5, huge:24, labelGap:6, dropdownWidth:240, lg:8, numberFieldWidth:96, - controlHeight: 30, controlGap: 6, sm: 3, md: 6, popupRowHeight: 28 + controlPaddingX: 10, controlPaddingY: 6, inputPaddingY: 7, tooltipPaddingX:8, tooltipPaddingY:5, huge:24, labelGap:4, dropdownWidth:240, lg:8, numberFieldWidth:120, + controlHeight: 28, controlGap: 8, sm: 3, md: 6, popupRowHeight: 28 }) // Invariant: match the shell's rounded scaling. At scale 7/6, space(4) is 5 diff --git a/ui/tests/qml/tst_agent_interaction.qml b/ui/tests/qml/tst_agent_interaction.qml index 4562a427..f3eccf52 100644 --- a/ui/tests/qml/tst_agent_interaction.qml +++ b/ui/tests/qml/tst_agent_interaction.qml @@ -342,7 +342,7 @@ Item { verify(waitForRendering(popup)) var field = findChild(popup, "agent-prompt-field") compare(findChild(popup, "agent-ask-button"), null) - verify(field.width > popup.width - 40) + compare(field.width, popup.width - 2 * MailStyle.space(12)) var bottom = popup.height - field.mapToItem(popup, 0, field.height).y verify(bottom >= MailStyle.space(10) && bottom <= MailStyle.space(14), "bottom gap " + bottom) compare(findChild(popup, "agent-more-button"), null) diff --git a/ui/tests/qml/tst_app_navigation.qml b/ui/tests/qml/tst_app_navigation.qml index 203879b6..479ddc7e 100644 --- a/ui/tests/qml/tst_app_navigation.qml +++ b/ui/tests/qml/tst_app_navigation.qml @@ -57,6 +57,7 @@ Item { property bool sidebarCollapsed: false property bool alwaysShowImages: false property bool unifiedCalendarView: false + property bool unified: false property bool selectedReaderEmpty: false property bool selectedReaderTooHeavy: false property bool selectedTooHeavy: false @@ -288,6 +289,7 @@ Item { mailService.lastSavedDraft = null mailService.refuseMove = false mailService.accountCount = 1 + mailService.unified = false mailService.providerId = "gmail" mailService.hasSavedAccounts = true mailService.anyAccountReady = true @@ -707,26 +709,27 @@ Item { var oldHeight = host.height var oldMinimumWidth = host.minimumSize.width var oldMinimumHeight = host.minimumSize.height - var oldBody = Style.font.body try { var header = named(app, "app-title-bar") var search = named(app, "search-bar") var folder = named(app, "folder-button") - var menu = named(app, "app-menu-button") - Style.font.body = 12 + var headerLeft = named(app, "header-account-button").parent + mailService.unified = true Style.spacingScale = 2 Style.spacingScale = 1 waitForRendering(app) host.width = 640 host.height = 800 waitForRendering(app) - compare(header.searchStacked, false, "search stays on the top row at 640 points") + compare(header.searchStacked, false, "search stays on the top row at 640 points with the unified All button") + verify(header.width - headerLeft.width - folder.parent.width - MailStyle.space(52) + - MailStyle.space(105) >= 10, "the real shell metrics leave genuine slack at 640 points") var searchRight = search.mapToItem(header, search.width, 0).x var folderLeft = folder.mapToItem(header, 0, 0).x verify(searchRight <= folderLeft, "the inline field does not touch the folder button") var searchLeft = search.mapToItem(header, 0, 0).x - var menuRight = menu.mapToItem(header, menu.width, 0).x - verify(searchLeft >= menuRight, "the inline field does not touch the menu button") + var leftRight = headerLeft.mapToItem(header, headerLeft.width, 0).x + verify(searchLeft >= leftRight, "the inline field does not touch the left controls") host.minimumSize = Qt.size(240, 480) host.width = 300 waitForRendering(app) @@ -743,7 +746,7 @@ Item { compare(host.minimumSize.height, oldMinimumHeight, "the original minimum height is restored") host.width = oldWidth host.height = oldHeight - Style.font.body = oldBody + mailService.unified = false waitForRendering(app) } } diff --git a/ui/tests/qml/tst_inbox_bundles.qml b/ui/tests/qml/tst_inbox_bundles.qml index ada631a5..9f466a72 100644 --- a/ui/tests/qml/tst_inbox_bundles.qml +++ b/ui/tests/qml/tst_inbox_bundles.qml @@ -708,6 +708,7 @@ Item { } function test_the_offer_can_be_refused_however_narrow_the_row() { + narrowRow.width = 400 narrowRow.summary = ({id:"front",from:{display:"A"},time:"09:14",bundleProposal:true,bundleQuestion:"Bundle these?"}) waitForRendering(narrowRow) var buttons = findChild(narrowRow, "bundle-buttons") diff --git a/ui/tests/qml/tst_picker_keyboard.qml b/ui/tests/qml/tst_picker_keyboard.qml index 5e6cd8f9..43566260 100644 --- a/ui/tests/qml/tst_picker_keyboard.qml +++ b/ui/tests/qml/tst_picker_keyboard.qml @@ -172,6 +172,7 @@ Rectangle { keyClick(Qt.Key_Tab) keyClick(Qt.Key_Tab) var ccButton = focused() + compare(ccButton.text, "+ Cc") mouseClick(ccButton, ccButton.width / 2, ccButton.height / 2) compare(host.selected, [host.contact, "cc"]) compare(host.contactSelections, 1) From ee89199924ff20a752aa7fafb388be0f824582ec Mon Sep 17 00:00:00 2001 From: David Reinecke <6206278+dreinecke@users.noreply.github.com> Date: Fri, 13 Nov 2026 07:04:59 +0000 Subject: [PATCH 3/3] Keep search layout test portable across Qt versions (C-079) --- ui/tests/qml/tst_app_navigation.qml | 2 -- 1 file changed, 2 deletions(-) diff --git a/ui/tests/qml/tst_app_navigation.qml b/ui/tests/qml/tst_app_navigation.qml index 479ddc7e..f80d3cf5 100644 --- a/ui/tests/qml/tst_app_navigation.qml +++ b/ui/tests/qml/tst_app_navigation.qml @@ -722,8 +722,6 @@ Item { host.height = 800 waitForRendering(app) compare(header.searchStacked, false, "search stays on the top row at 640 points with the unified All button") - verify(header.width - headerLeft.width - folder.parent.width - MailStyle.space(52) - - MailStyle.space(105) >= 10, "the real shell metrics leave genuine slack at 640 points") var searchRight = search.mapToItem(header, search.width, 0).x var folderLeft = folder.mapToItem(header, 0, 0).x verify(searchRight <= folderLeft, "the inline field does not touch the folder button")