diff --git a/android/README.md b/android/README.md index 464bd700..1daf0a2c 100644 --- a/android/README.md +++ b/android/README.md @@ -6009,3 +6009,53 @@ surface" named in the brief is not present in this tree, so the decision is reachable from the run detail and its stage and the shared component is ready for it. No packaged skill reference was touched: the decide protocol is unchanged and already documented, and this is an app-UI change. + +## Run title readability: whole in the run view, two lines in the list (17 Oct 2026) + +A run's title is derived from its prompt, so it is often long. The run view now +guarantees the operator can read it whole, while the places that are one of many +clamp deliberately. `android/` only; no new dependency, no Pipelines +server/Go/installer/Docker file touched and no run started from the app; the build +and unit tests only, no device command run. + +- **Run view shows the whole title.** The run-summary title line rendered + `runLabel(run.title, run.name)` with the Compose default; it now states the + intent with `RUN_VIEW_TITLE_LINES` (`Int.MAX_VALUE`) and `TextOverflow.Clip`, so + it wraps over as many lines as it needs and is never ellipsised. The fixed-height + M3 app-bar copy stays a compact one-line label; the summary's scrollable title is + the complete one. +- **Runs-list rows grow, then clamp.** `RunHistoryScreen.RunRow`'s title went from + `maxLines = 1` to `RUN_ROW_TITLE_LINES` (2), so a longer title takes a second + line before it ellipsises; the row's glyph, status chip and meta line keep their + alignment and the selection highlight and tap target are unchanged. +- **Stage-pane context line.** `StageDetailPane`'s run-label line went from + `maxLines = 1` to `STAGE_RUN_LABEL_LINES` (2) — the pane is compact context, not + the place the whole title lives. +- **One named budget.** `ui/RunIdentity.kt` holds the three named line budgets so + the choice is deliberate at each call site. `RunTitlesTest` (4 cases) pins them + and asserts a clamping place is never more generous than the run view; + `RunIdentityTest` gained a case that `runLabel`/`runIdentity` never shorten a + long title, so re-introducing a truncating helper here fails. + +Tests: the 57 result XMLs aggregate to **513 tests, 0 failures, 0 errors, 0 +skipped** (`RunTitlesTest` 4/0, `RunIdentityTest` 6/0). + +Evidence (macOS, JDK 17 from Homebrew `openjdk@17`, Gradle 9.7.1 `--offline`, +`--no-daemon`, `ANDROID_HOME=/Users/alan/Library/Android/sdk`): + +- `gradle :app:testDebugUnitTest --no-daemon --offline --rerun` → `BUILD + SUCCESSFUL`. +- `gradle :app:assembleDebug --no-daemon --offline` → `BUILD SUCCESSFUL`; + `app-debug.apk` 18,486,624 bytes, sha256 + `2b23762b54f011bbec680804a232f32bd43c244fb52c465a0f4b2c2c9a0148cb`. +- **APK publish.** Copied to this run's artifacts directory as + `pipelines-debug-wip-2bc00a2.apk` (`2bc00a2` = `git rev-parse --short HEAD`, the + tree being uncommitted WIP on top of it), served at + `http://10.0.0.75:8080/artifacts/278/4/pipelines-debug-wip-2bc00a2.apk` + (`HTTP/1.1 200 OK`, `Content-Type: application/vnd.android.package-archive`; the + downloaded bytes hash to the same sha256). + +Not verified in this pass: how the wrapping summary title, the two-line list row +and the two-line stage header actually render — that needs the device, which this +build-and-unit-test pass did not use; visual review owns the operator's Pixel 9 +Pro XL. diff --git a/android/app/src/main/java/net/awan/pipelines/ui/RunIdentity.kt b/android/app/src/main/java/net/awan/pipelines/ui/RunIdentity.kt index 79e9c079..38ebeaf2 100644 --- a/android/app/src/main/java/net/awan/pipelines/ui/RunIdentity.kt +++ b/android/app/src/main/java/net/awan/pipelines/ui/RunIdentity.kt @@ -24,3 +24,22 @@ fun runIdentity(title: String?, name: String): RunIdentity { val stored = title?.trim().orEmpty() return if (stored.isEmpty()) RunIdentity(name, null) else RunIdentity(stored, name) } + +/** + * The line budget for a run's title in each place the app shows it. A title is + * derived from the run's prompt, so it is often long, and the places it appears + * have different jobs: the run view exists to let the operator read the run, so + * its own title is complete, while a runs-list row (one of many) and the stage + * pane's compact run-context line may clamp because the run view still carries + * the whole title. Kept here, named, so the budgets are a deliberate choice the + * tests pin rather than a bare `maxLines` literal at each call site. + */ + +/** The run view's own title never elides: it wraps over as many lines as it needs. */ +internal const val RUN_VIEW_TITLE_LINES: Int = Int.MAX_VALUE + +/** A runs-list row's title grows to two lines for a longer title, then ellipsises. */ +internal const val RUN_ROW_TITLE_LINES: Int = 2 + +/** The stage pane's compact run-context line shows at most two lines, then ellipsises. */ +internal const val STAGE_RUN_LABEL_LINES: Int = 2 diff --git a/android/app/src/main/java/net/awan/pipelines/ui/graph/StageDetailPane.kt b/android/app/src/main/java/net/awan/pipelines/ui/graph/StageDetailPane.kt index 9277f9d0..838a5cbb 100644 --- a/android/app/src/main/java/net/awan/pipelines/ui/graph/StageDetailPane.kt +++ b/android/app/src/main/java/net/awan/pipelines/ui/graph/StageDetailPane.kt @@ -50,6 +50,7 @@ import net.awan.pipelines.ui.components.KeyValueRow import net.awan.pipelines.ui.components.PaneIdentity import net.awan.pipelines.ui.components.SectionHeader import net.awan.pipelines.ui.components.paneSafeArea +import net.awan.pipelines.ui.STAGE_RUN_LABEL_LINES import net.awan.pipelines.ui.displayMap import net.awan.pipelines.ui.fileChangeLine import net.awan.pipelines.ui.fileChangesSummary @@ -428,7 +429,10 @@ fun StageDetailPane( Text( label, style = pipelinesText().meta, - maxLines = 1, + // The run's own complete title lives in the run + // view; here it is a compact context line, so it may + // take a second line but not run away with the pane. + maxLines = STAGE_RUN_LABEL_LINES, overflow = TextOverflow.Ellipsis, ) } diff --git a/android/app/src/main/java/net/awan/pipelines/ui/screens/RunDetailScreen.kt b/android/app/src/main/java/net/awan/pipelines/ui/screens/RunDetailScreen.kt index 42d80ab9..adc2d623 100644 --- a/android/app/src/main/java/net/awan/pipelines/ui/screens/RunDetailScreen.kt +++ b/android/app/src/main/java/net/awan/pipelines/ui/screens/RunDetailScreen.kt @@ -91,6 +91,7 @@ import net.awan.pipelines.ui.runArtifactGroups import net.awan.pipelines.ui.runArtifactsHeader import net.awan.pipelines.ui.runIdentity import net.awan.pipelines.ui.runLabel +import net.awan.pipelines.ui.RUN_VIEW_TITLE_LINES import net.awan.pipelines.ui.theme.ICON_INLINE_DP import net.awan.pipelines.ui.theme.ICON_STATUS_DP import net.awan.pipelines.ui.theme.SPACING_L @@ -195,7 +196,11 @@ fun RunDetailScreen( // The header names the run by its title and keeps the pipeline // it belongs to on a second line, so a stage pane opened from // here carries the same context. Without a title the pipeline - // name is the single identity, never a blank first line. + // name is the single identity, never a blank first line. This + // app-bar copy is a compact one-line label (the M3 app bar is a + // fixed height, so it cannot grow); the run's own complete, + // wrapping title is the summary's title line below, which is + // never elided. val identity = run?.let { runIdentity(it.title, it.name) } Column { Text( @@ -447,7 +452,17 @@ private fun RunSummaryTab( modifier = Modifier.fillMaxWidth().padding(horizontal = SPACING_L), verticalArrangement = Arrangement.spacedBy(SPACING_XS), ) { - Text(runLabel(run.title, run.name), style = text.screenTitle) + // The run view's own copy of the title: the operator must be + // able to read what the run is called, so it is never elided - + // it wraps over as many lines as it needs. The compact app-bar + // copy above stays a one-line label for context while this + // scrollable, complete one is what the operator reads. + Text( + runLabel(run.title, run.name), + style = text.screenTitle, + maxLines = RUN_VIEW_TITLE_LINES, + overflow = TextOverflow.Clip, + ) Row( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(SPACING_S), diff --git a/android/app/src/main/java/net/awan/pipelines/ui/screens/RunHistoryScreen.kt b/android/app/src/main/java/net/awan/pipelines/ui/screens/RunHistoryScreen.kt index 4cd57055..40b39c62 100644 --- a/android/app/src/main/java/net/awan/pipelines/ui/screens/RunHistoryScreen.kt +++ b/android/app/src/main/java/net/awan/pipelines/ui/screens/RunHistoryScreen.kt @@ -70,6 +70,7 @@ import net.awan.pipelines.ui.components.paneSafeArea import net.awan.pipelines.ui.components.rememberLiveNowMillis import net.awan.pipelines.ui.components.runStateColor import net.awan.pipelines.ui.components.runStateOf +import net.awan.pipelines.ui.RUN_ROW_TITLE_LINES import net.awan.pipelines.ui.formatDuration import net.awan.pipelines.ui.runDurationText import net.awan.pipelines.ui.runIdentity @@ -529,7 +530,7 @@ private fun RunRow( Text( identity.label, style = text.cardTitle, - maxLines = 1, + maxLines = RUN_ROW_TITLE_LINES, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f), ) diff --git a/android/app/src/test/java/net/awan/pipelines/ui/RunIdentityTest.kt b/android/app/src/test/java/net/awan/pipelines/ui/RunIdentityTest.kt index cfd1e135..53fcfba9 100644 --- a/android/app/src/test/java/net/awan/pipelines/ui/RunIdentityTest.kt +++ b/android/app/src/test/java/net/awan/pipelines/ui/RunIdentityTest.kt @@ -47,4 +47,16 @@ class RunIdentityTest { assertEquals("android-app", runLabel(null, "android-app")) assertEquals("android-app", runLabel(" ", "android-app")) } + + @Test + fun aVeryLongTitleIsKeptWholeAtTheDataLevel() { + // The run view's own title is rendered from this value with no line limit, + // so the identity itself must never silently shorten it: a prompt-derived + // title stays complete and the view, not this function, decides the + // layout. Guards against re-introducing a truncating helper here. + val long = "Implement the whole thing carefully, then review it ".repeat(40).trim() + assertEquals(long, runLabel(long, "android-app")) + assertEquals(long, runIdentity(long, "android-app").label) + assertEquals("android-app", runIdentity(long, "android-app").pipeline) + } } diff --git a/android/app/src/test/java/net/awan/pipelines/ui/RunTitlesTest.kt b/android/app/src/test/java/net/awan/pipelines/ui/RunTitlesTest.kt new file mode 100644 index 00000000..f49f18b9 --- /dev/null +++ b/android/app/src/test/java/net/awan/pipelines/ui/RunTitlesTest.kt @@ -0,0 +1,38 @@ +package net.awan.pipelines.ui + +import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue +import org.junit.Test + +/** + * The run title's line budget in each place it is shown. A title is derived from + * the run's prompt and is often long, so the run view - the place whose whole job + * is to let the operator read the run - must show it complete, while the places + * that are one of many (a runs-list row) or a compact label (the stage pane's + * run-context line) clamp. The budgets are pinned here so a change to one is a + * deliberate, reviewed decision and the run view can never become the most + * generous place by accident. + */ +class RunTitlesTest { + + @Test + fun theRunViewShowsTheWholeTitleNeverEliding() { + assertEquals(Int.MAX_VALUE, RUN_VIEW_TITLE_LINES) + } + + @Test + fun aRunsListRowGrowsForALongTitleThenClampsAtTwoLines() { + assertEquals(2, RUN_ROW_TITLE_LINES) + } + + @Test + fun theStagePaneRunContextTakesASecondLineThenClamps() { + assertEquals(2, STAGE_RUN_LABEL_LINES) + } + + @Test + fun aClampingPlaceIsNeverMoreGenerousThanTheCompleteOne() { + assertTrue("a list row may not outlive the run view", RUN_ROW_TITLE_LINES < RUN_VIEW_TITLE_LINES) + assertTrue("a stage context line may not outlive the run view", STAGE_RUN_LABEL_LINES < RUN_VIEW_TITLE_LINES) + } +}