app

Local-first trade for farms and co-ops
git clone https://radroots.dev/git/app.git
Log | Files | Refs | README | LICENSE

commit 7dd1057aa12927acfb355f035442f9fb165e8b51
parent f2af587e7281a6f70f496f4bb3fdeee6bd1ebe65
Author: triesap <tyson@radroots.org>
Date:   Thu, 13 Aug 2026 19:39:57 +0000

ui: stabilize shell tab selection layout

- keep selected and unselected tab labels on one text metric
- cover selection changes with an exact footprint regression
- refresh the governed macOS desktop golden images
- align the checked design-source hash inventory

Diffstat:
Mapp/design_system/src/commonMain/kotlin/org/harvestcircle/designsystem/shell/HarvestCircleShellControls.kt | 2+-
Mapp/shared/src/desktopTest/kotlin/org/harvestcircle/ui/shell/MainPanelHeaderTest.kt | 29+++++++++++++++++++++++++++++
Mapp/shared/src/desktopTest/resources/goldens/macos-aarch64/design-surface-dark.png | 0
Mapp/shared/src/desktopTest/resources/goldens/macos-aarch64/design-surface-light.png | 0
Mconfig/design/source_baseline_v1.toml | 4++--
Mtools/xtask/src/lib.rs | 4++--
6 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/app/design_system/src/commonMain/kotlin/org/harvestcircle/designsystem/shell/HarvestCircleShellControls.kt b/app/design_system/src/commonMain/kotlin/org/harvestcircle/designsystem/shell/HarvestCircleShellControls.kt @@ -265,7 +265,7 @@ public fun HarvestCircleShellTab( icon?.let { HarvestCircleIcon(it, null, Modifier.size(16.dp), tint = colors.contentSecondary) } HarvestCircleShellText( label, - role = if (selected) HarvestCircleShellTextRole.BodyStrong else HarvestCircleShellTextRole.Body, + role = HarvestCircleShellTextRole.Body, maxLines = 1, ) } diff --git a/app/shared/src/desktopTest/kotlin/org/harvestcircle/ui/shell/MainPanelHeaderTest.kt b/app/shared/src/desktopTest/kotlin/org/harvestcircle/ui/shell/MainPanelHeaderTest.kt @@ -1,5 +1,8 @@ package org.harvestcircle.ui.shell +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue import androidx.compose.ui.test.ExperimentalTestApi import androidx.compose.ui.test.assertCountEquals import androidx.compose.ui.test.assertIsDisplayed @@ -40,4 +43,30 @@ class MainPanelHeaderTest { onAllNodesWithTag("main-primary-action").assertCountEquals(1) assertEquals(listOf(identity.key), selections) } + + @Test + fun tabFootprintsRemainStableWhenSelectionChanges() = + runComposeUiTest { + val relays = TemplateTab(TemplateSelectionKey("public-relays"), "Public relays") + val diagnostics = TemplateTab(TemplateSelectionKey("runtime-diagnostics"), "Runtime diagnostics") + var selected by mutableStateOf(relays.key) + setHarvestCircleContent { + MainPanelHeader( + MainPanelHeaderModel( + title = "Network", + tabs = listOf(relays, diagnostics), + selectedTab = selected, + ), + onTabSelected = { selected = it }, + ) + } + + val relaysBefore = onNodeWithTag("main-tab-public-relays").fetchSemanticsNode().boundsInRoot + val diagnosticsBefore = onNodeWithTag("main-tab-runtime-diagnostics").fetchSemanticsNode().boundsInRoot + onNodeWithTag("main-tab-runtime-diagnostics").performClick() + waitForIdle() + + assertEquals(relaysBefore, onNodeWithTag("main-tab-public-relays").fetchSemanticsNode().boundsInRoot) + assertEquals(diagnosticsBefore, onNodeWithTag("main-tab-runtime-diagnostics").fetchSemanticsNode().boundsInRoot) + } } diff --git a/app/shared/src/desktopTest/resources/goldens/macos-aarch64/design-surface-dark.png b/app/shared/src/desktopTest/resources/goldens/macos-aarch64/design-surface-dark.png Binary files differ. diff --git a/app/shared/src/desktopTest/resources/goldens/macos-aarch64/design-surface-light.png b/app/shared/src/desktopTest/resources/goldens/macos-aarch64/design-surface-light.png Binary files differ. diff --git a/config/design/source_baseline_v1.toml b/config/design/source_baseline_v1.toml @@ -9,8 +9,8 @@ source_license = "GPL-3.0-only" golden_host = "macos-aarch64" golden_status = "verified" golden_source_snapshot_sha256 = "c2fe49f3c3ea43105cb2fff4a67c7cd9c21561c71825440a91654a0c1b12e3b8" -golden_light_sha256 = "7df7cbd0a69b62deba5f924586f19537f09d03afbb2176d9aa081acf5b88ea94" -golden_dark_sha256 = "f1e88380060c099ee3a2ba8e90f3a24bd1d4b0e2ce90614456fbd7f379c77ca8" +golden_light_sha256 = "f6c513064320e144ddc92dbd377f91dcbc275f17e6c0645c2ac3c94c0808ebb9" +golden_dark_sha256 = "49b9af1d391feb599ce4a3ce862d7dfc403cae973a8f0f6abf5c0a7ee66cfca4" [[mapping]] source = "core/designsystem/src/commonMain" diff --git a/tools/xtask/src/lib.rs b/tools/xtask/src/lib.rs @@ -942,12 +942,12 @@ fn design_source_audit(root: &Path, inventory: &Inventory, findings: &mut Vec<St ( "app/shared/src/desktopTest/resources/goldens/macos-aarch64/design-surface-light.png", "golden_light_sha256", - "7df7cbd0a69b62deba5f924586f19537f09d03afbb2176d9aa081acf5b88ea94", + "f6c513064320e144ddc92dbd377f91dcbc275f17e6c0645c2ac3c94c0808ebb9", ), ( "app/shared/src/desktopTest/resources/goldens/macos-aarch64/design-surface-dark.png", "golden_dark_sha256", - "f1e88380060c099ee3a2ba8e90f3a24bd1d4b0e2ce90614456fbd7f379c77ca8", + "49b9af1d391feb599ce4a3ce862d7dfc403cae973a8f0f6abf5c0a7ee66cfca4", ), ] { let authority = format!("{key} = \"{sha256}\"");