Skip to content

test(ui): cover app-shell dialogs, router guards, dialog gating, VM navigation/toggles - #425

Merged
tstapler merged 15 commits into
mainfrom
backlog/stelekit-ui-shell-test-coverage
Oct 16, 2026
Merged

tstapler merged 15 commits into
mainfrom
backlog/stelekit-ui-shell-test-coverage

Conversation

@tstapler

@tstapler tstapler commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

Raises coverage of the ui/ app shell (backlog item f344219b): extracts dialog-selection predicates from GraphDialogLayer.kt and adds headless tests for dialogs, router guards, flashcards, and ViewModel navigation/UI toggles.

What Changed

  • GraphDialogLayer.kt: internal fun AppState.shouldShow*() predicates (behavior-preserving, used by hosts)
  • androidUnitTest: WikiSubdirFixDialogTest, FlashcardsScreenTest, ScreenRouterGuardTest, GraphDialogLayerHostsTest
  • commonTest: GraphDialogLayerLogicTest
  • businessTest: StelekitViewModelNavigationTest, StelekitViewModelUiToggleTest
  • project_plans/ui-shell-test-coverage/ plan, research, validation (latest commit 56e3a3bd records the sdd:6-verify re-run)

Acceptance criteria

Passing (7): AC1 WikiSubdirFixDialogTest, AC2 FlashcardsScreenTest, AC3 ScreenRouterGuardTest, AC4 predicates + GraphDialogLayerLogicTest, AC6 UiToggle test, AC7 headless (no X11), AC9 deferred files documented.

Open (2) — not met as written:

  • AC5 (history-size cap boundary): StelekitViewModel has no history cap; adding one is a product change. goBack/goForward boundaries are covered.
  • AC8 (per-package floors ui/ ≥28% line, ≥8% branch, VM ≥48% branch): CI gate has no per-package thresholds; the existing diffCoverage --fail-under 80 gate was accepted.

Both are recorded as owner decisions in project_plans/ui-shell-test-coverage/validation.md lines 123–161. The backlog AC text was not reworded.

/backlog/review did not record a review this session: request_review rejects while AC5 and AC8 are not pass. A human needs to review and reconcile those two criteria.

Test plan

  • :kmp:testDebugUnitTest — WikiSubdirFixDialogTest 6, FlashcardsScreenTest 4, ScreenRouterGuardTest 6, GraphDialogLayerHostsTest 6, GraphDialogLayerLogicTest 15: 0 failures
  • :kmp:jvmTest — StelekitViewModelNavigationTest 7, StelekitViewModelUiToggleTest 6: 0 failures
  • Remote CI: Bazel jobs and emulator smoke tests still pending/unreported at time of writing

…avigation/toggles

Extracts AppState.shouldShow*() dialog-selection predicates from GraphDialogLayer.
Adds WikiSubdirFixDialog, FlashcardsScreen, ScreenRouter guard (Robolectric),
GraphDialogLayerLogic (commonTest), and StelekitViewModel navigation/toggle tests.
Documents deferred files and plan deviations in validation.md.
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

JVM Load Benchmark (Desktop)

Synthetic in-memory benchmark measuring load performance for the desktop (JVM) app.
Comparing fd7f0537 (this PR) vs 0db11151 (baseline)
Graph config: xlarge — 230 pages

Metric This PR Baseline Delta
Phase 1 TTI ↓ 0ms 0ms 0 (0%)
Phase 2 background ↓ 0ms 0ms 0 (0%)
Phase 3 index ↓ 0ms 0ms 0 (0%)
Total ↓ 0ms 0ms 0 (0%)
Write p95 (baseline) ↓ 30ms 27ms +3ms (+11%) ⚠️
Write p95 (under load) ↓ 1ms n/a
Jank factor ↓ 0.03x n/a
↓ lower is better
Flamegraphs (this PR) **Allocation** — object allocation pressure (JDBC/SQLite churn)

Alloc flamegraph not available

CPU — method-level hotspots by on-CPU time

CPU flamegraph not available

Top allocation hotspots (this PR) `34.8%` byte[]_[k] `6.9%` java.lang.String_[k] `5.5%` int[]_[k] `5.4%` java.lang.Object[]_[k] `5.1%` java.util.LinkedHashMap$Entry_[k]
Top CPU hotspots (this PR) `97.5%` /usr/lib/x86_64-linux-gnu/libc.so.6 `0.7%` /tmp/sqlite-3.51.3.0-7ddb2cb6-be06-4e50-b2c2-3b323a0e8d13-libsqlitejdbc.so `0.5%` fsync `0.3%` __libc_pwrite `0.1%` pthread_cond_signal

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Android Load Benchmark

Instrumented benchmark on an API 30 x86_64 emulator — 500-page synthetic graph.

Comparing fd7f0537 (this PR) vs 0db11151 (baseline)
Device: API 30 x86_64 emulator — 530 pages loaded

Graph Load

Metric This PR Baseline Delta
Phase 1 TTI ↓ 46ms 27ms +19ms (+70%) ⚠️
Phase 3 index ↓ 4611ms 2760ms +1851ms (+67%) ⚠️

Interactive Write Latency (during Phase 3)

Metric This PR Baseline Delta
Write p95 (baseline) ↓ 8ms 8ms 0 (0%)
Write p95 (during phase 3) ↓ 12ms 22ms -10ms (-45%) ✅
Jank factor ↓ 1.5x 2.75x -1.25x (-45%) ✅
Concurrent writes ↑ 22 14 +8ms (+57%) ✅

SAF I/O Overhead (ContentProvider vs direct File read)

Measures Binder IPC cost added by ContentResolver per readFile() call.
Real SAF via ExternalStorageProvider will be higher on device; this is a lower bound.

Metric This PR Baseline Delta
Direct read / file ↓ 0.0ms 0.0ms 0 (0%)
Provider read / file ↓ 0.3ms 0.2ms +0ms (+17%) ⚠️
IPC overhead ratio ↓ 8x 7x +1x (+14%) ⚠️
↓ lower is better · ↑ higher is better

Without registration Bazel's business_tests suite never ran them and
AllBusinessTestsCompletenessTest failed in CI.
@tstapler

Copy link
Copy Markdown
Owner Author

request_review refused this item three times with the same message (AC8 is index 7, 0-based, and the tool only accepts pass):

request_review rejected: 1 acceptance criteria are not yet marked pass via report_progress: 7: CI incremental coverage gate floor updated to ui/ line ≥ 28%, ui/ branch ≥ 8%, StelekitViewModel branch ≥ 48%; gate passes in CI (status=in_progress). Call report_progress for each remaining criterion, or report_blocked if genuinely stuck

Per the backlog fallback, shipping as a draft for human review. AC8 stays marked fail: CI gate is :kmp:diffCoverage with no per-package floors; a merged JVM+Android JaCoCo baseline is needed to set ui/ floors.

@tstapler

Copy link
Copy Markdown
Owner Author

Tracked by Stapler Squad backlog item: ssq://onyx.staplerhome.internal/backlog/v1/bl_01M4WBVTXRVSRYBF12131ES3D1
Host: host_01M0H2V3S43XCN5MGPZ4Z5Y3JX

@tstapler
tstapler marked this pull request as ready for review October 16, 2026 03:59
@tstapler
tstapler merged commit b88563a into main Oct 16, 2026
43 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant