From 7f09c2c2c633a524a92990fd81bec9451f5139a1 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 17 Oct 2026 20:42:19 -0700 Subject: [PATCH 01/59] test(mobile): cover native Android trail maps and persisted review lifecycle --- .github/workflows/mobile-e2e.yml | 54 ++++++++ .maestro/native-trail/maps.yaml | 71 ++++++++++ .maestro/native-trail/review-create.yaml | 37 ++++++ .maestro/native-trail/review-delete.yaml | 25 ++++ .maestro/native-trail/review-edit.yaml | 41 ++++++ .maestro/native-trail/sign-in.yaml | 27 ++++ scripts/run-mobile-e2e.ts | 27 ++-- scripts/run-native-trail-android-e2e.ts | 133 +++++++++++++++++++ tests/unit/mobile-e2e-runner.test.ts | 9 +- tests/unit/native-review-persistence.test.ts | 20 +++ tsconfig.app.json | 1 + 11 files changed, 423 insertions(+), 22 deletions(-) create mode 100644 .maestro/native-trail/maps.yaml create mode 100644 .maestro/native-trail/review-create.yaml create mode 100644 .maestro/native-trail/review-delete.yaml create mode 100644 .maestro/native-trail/review-edit.yaml create mode 100644 .maestro/native-trail/sign-in.yaml create mode 100644 scripts/run-native-trail-android-e2e.ts create mode 100644 tests/unit/native-review-persistence.test.ts diff --git a/.github/workflows/mobile-e2e.yml b/.github/workflows/mobile-e2e.yml index ab13950c7..9be682e79 100644 --- a/.github/workflows/mobile-e2e.yml +++ b/.github/workflows/mobile-e2e.yml @@ -8,6 +8,7 @@ on: - '.maestro/**' - 'tests/native/**' - 'scripts/run-native-trail-e2e.ts' + - 'scripts/run-native-trail-android-e2e.ts' - 'app/**' - 'config/mobile.ts' # The app icon config/mobile.ts points at; a bad one fails the iOS build. @@ -21,6 +22,7 @@ on: - '.maestro/**' - 'tests/native/**' - 'scripts/run-native-trail-e2e.ts' + - 'scripts/run-native-trail-android-e2e.ts' - 'app/**' - 'config/mobile.ts' # The app icon config/mobile.ts points at; a bad one fails the iOS build. @@ -175,3 +177,55 @@ jobs: storage/framework/runtime/e2e/native-trail/*.png storage/framework/runtime/e2e/native-trail/results-*.xcresult if-no-files-found: warn + + native-trail-android: + runs-on: ubuntu-latest + timeout-minutes: 35 + env: + QA_PORT_BASE: '7320' + NATIVE_QA_ANDROID_DEVICE: emulator-5554 + steps: + - uses: actions/checkout@v5 + - uses: oven-sh/setup-bun@v2 + with: + bun-version: '1.4.2' + - uses: actions/setup-java@v5 + with: + distribution: temurin + java-version: '17' + - uses: gradle/actions/setup-gradle@v4 + with: + gradle-version: '8.11.1' + - name: Install Maestro + run: | + curl -fsSL "https://github.com/mobile-dev-inc/Maestro/releases/download/${MAESTRO_VERSION}/maestro.zip" -o "$RUNNER_TEMP/maestro.zip" + echo "$MAESTRO_SHA256 $RUNNER_TEMP/maestro.zip" | sha256sum --check + unzip -q "$RUNNER_TEMP/maestro.zip" -d "$RUNNER_TEMP/maestro-cli" + echo "$RUNNER_TEMP/maestro-cli/maestro/bin" >> "$GITHUB_PATH" + - name: Install published dependencies + run: bun install --frozen-lockfile + - name: Build native MapLibre trail app + run: bun scripts/run-native-trail-android-e2e.ts --build-only + - name: Enable KVM + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + - name: Test native maps, sticky actions and persisted reviews + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: 34 + target: default + arch: x86_64 + profile: pixel_7 + ram-size: 4096M + emulator-options: -no-window -no-snapshot -gpu swiftshader_indirect -noaudio -no-boot-anim + disable-animations: false + script: bun scripts/run-native-trail-android-e2e.ts --skip-build + - name: Upload Android native trail evidence + if: always() + uses: actions/upload-artifact@v5 + with: + name: native-trail-android + path: storage/framework/runtime/e2e/native-trail-android + if-no-files-found: warn diff --git a/.maestro/native-trail/maps.yaml b/.maestro/native-trail/maps.yaml new file mode 100644 index 000000000..0e6f426d3 --- /dev/null +++ b/.maestro/native-trail/maps.yaml @@ -0,0 +1,71 @@ +appId: ${APP_ID} +name: Native Android trail maps and sticky save +--- +- runFlow: sign-in.yaml +- tapOn: + id: trail-save +- extendedWaitUntil: + visible: '^Saved$' + timeout: 15000 +- tapOn: + id: trail-save +- extendedWaitUntil: + visible: '^Save$' + timeout: 15000 +- scrollUntilVisible: + element: + id: trail-map-fullscreen + direction: DOWN +- assertVisible: + id: trail-sticky-actions +- tapOn: + id: trail-map-fullscreen +- extendedWaitUntil: + visible: + id: trail-full-map + timeout: 30000 +- takeScreenshot: android-native-map-outdoors +- tapOn: + id: map-zoom-in +- tapOn: + id: map-zoom-out +- tapOn: + id: map-fit +- tapOn: + id: map-3d +- assertVisible: '^2D$' +- tapOn: + id: map-north +- tapOn: + id: map-profile-toggle +- assertVisible: 'Toggle elevation profile, Elevation profile collapsed' +- takeScreenshot: android-native-map-profile-collapsed +- tapOn: + id: map-profile-toggle +- assertVisible: 'Toggle elevation profile, Elevation profile expanded' +- tapOn: + id: map-layer +- tapOn: '^Satellite$' +- assertVisible: 'Map layer, Satellite' +- takeScreenshot: android-native-map-satellite +- tapOn: + id: map-layer +- tapOn: '^Hybrid$' +- assertVisible: 'Map layer, Hybrid' +- takeScreenshot: android-native-map-hybrid +- tapOn: + id: map-layer +- tapOn: '^Street$' +- assertVisible: 'Map layer, Street' +- takeScreenshot: android-native-map-street +- tapOn: + id: map-layer +- tapOn: '^Outdoors$' +- assertVisible: 'Map layer, Outdoors' +- tapOn: + id: map-fit +- takeScreenshot: android-native-map-outdoors-restored +- back +- assertVisible: + id: trail-sticky-actions +- takeScreenshot: android-native-sticky-actions diff --git a/.maestro/native-trail/review-create.yaml b/.maestro/native-trail/review-create.yaml new file mode 100644 index 000000000..dce1c6d98 --- /dev/null +++ b/.maestro/native-trail/review-create.yaml @@ -0,0 +1,37 @@ +appId: ${APP_ID} +name: Create a review with native controls +--- +- runFlow: sign-in.yaml +- scrollUntilVisible: + element: + id: trail-write-review + direction: DOWN +- assertVisible: + id: trail-sticky-actions +- tapOn: + id: trail-write-review +- extendedWaitUntil: + visible: + id: trail-review-content + timeout: 15000 +- tapOn: + id: trail-review-star-5 +- tapOn: + id: trail-review-content +- inputText: ${REVIEW_TEXT} +- hideKeyboard +- scrollUntilVisible: + element: + id: trail-review-submit + direction: DOWN +- tapOn: + id: trail-review-submit +- extendedWaitUntil: + visible: 'Edit your review' + timeout: 15000 +- scrollUntilVisible: + element: + text: ${REVIEW_TEXT} + direction: DOWN +- assertVisible: ${REVIEW_TEXT} +- takeScreenshot: android-native-review-created diff --git a/.maestro/native-trail/review-delete.yaml b/.maestro/native-trail/review-delete.yaml new file mode 100644 index 000000000..dda70c362 --- /dev/null +++ b/.maestro/native-trail/review-delete.yaml @@ -0,0 +1,25 @@ +appId: ${APP_ID} +name: Delete the persisted review through native confirmation +--- +- launchApp +- openLink: wildloop://trail/${TRAIL_ID} +- extendedWaitUntil: + visible: ${TRAIL_NAME} + timeout: 30000 +- scrollUntilVisible: + element: + id: trail-delete-review + direction: DOWN +- tapOn: + id: trail-delete-review +- tapOn: '^Delete review$' +- extendedWaitUntil: + visible: 'Leave a review' + timeout: 15000 +- assertNotVisible: ${REVIEW_TEXT} +- assertNotVisible: ${EDITED_REVIEW_TEXT} +- assertNotVisible: + id: trail-delete-review +- assertVisible: + id: trail-sticky-actions +- takeScreenshot: android-native-review-deleted diff --git a/.maestro/native-trail/review-edit.yaml b/.maestro/native-trail/review-edit.yaml new file mode 100644 index 000000000..f14a926fd --- /dev/null +++ b/.maestro/native-trail/review-edit.yaml @@ -0,0 +1,41 @@ +appId: ${APP_ID} +name: Reopen and edit the persisted native review +--- +- launchApp +- openLink: wildloop://trail/${TRAIL_ID} +- extendedWaitUntil: + visible: ${TRAIL_NAME} + timeout: 30000 +- scrollUntilVisible: + element: + id: trail-write-review + direction: DOWN +- tapOn: + id: trail-write-review +- extendedWaitUntil: + visible: + id: trail-review-content + timeout: 15000 +- tapOn: + id: trail-review-content +- eraseText: 2000 +- inputText: ${EDITED_REVIEW_TEXT} +- hideKeyboard +- tapOn: + id: trail-review-star-4 +- scrollUntilVisible: + element: + id: trail-review-submit + direction: DOWN +- tapOn: + id: trail-review-submit +- extendedWaitUntil: + visible: 'Edit your review' + timeout: 15000 +- scrollUntilVisible: + element: + text: ${EDITED_REVIEW_TEXT} + direction: DOWN +- assertVisible: ${EDITED_REVIEW_TEXT} +- assertNotVisible: ${REVIEW_TEXT} +- takeScreenshot: android-native-review-edited diff --git a/.maestro/native-trail/sign-in.yaml b/.maestro/native-trail/sign-in.yaml new file mode 100644 index 000000000..924d8e70a --- /dev/null +++ b/.maestro/native-trail/sign-in.yaml @@ -0,0 +1,27 @@ +appId: ${APP_ID} +--- +- launchApp: + clearState: true +- extendedWaitUntil: + visible: + id: native-feed-scroll + timeout: 30000 +- openLink: wildloop://login?next=/trail/${TRAIL_ID} +- extendedWaitUntil: + visible: + id: login-email + timeout: 30000 +- tapOn: + id: login-email +- inputText: ${E2E_EMAIL} +- tapOn: + id: login-password +- inputText: ${E2E_PASSWORD} +- hideKeyboard +- tapOn: + id: login-submit +- extendedWaitUntil: + visible: ${TRAIL_NAME} + timeout: 30000 +- assertVisible: + id: trail-sticky-actions diff --git a/scripts/run-mobile-e2e.ts b/scripts/run-mobile-e2e.ts index d8bd0a1e9..1bbd7c12b 100644 --- a/scripts/run-mobile-e2e.ts +++ b/scripts/run-mobile-e2e.ts @@ -98,10 +98,9 @@ export function selectAndroidDeepLinkActivity(output: string, packageName: strin return null } -export function selectAndroidHomePackage(output: string): string | null { - const component = output.split(/\s+/).find(value => value.includes('/')) - const packageName = component?.split('/')[0] - return packageName || null +export function assertAndroidPlatformHealthy(events: string): void { + if (/am_(anr|crash)/.test(events)) + throw new Error('Android platform crash/ANR invalidates native acceptance. Inspect the emulator diagnostics.') } export function selectIosSimulator(payload: SimctlDevices): IosDevice | null { @@ -348,19 +347,10 @@ function seedTestLocation(platform: MobilePlatform, deviceId: string): void { ]) } -/** - * Google APIs images occasionally leave Pixel Launcher in an ANR state while - * Wildloop is foregrounded. The launcher is not part of this journey, so stop - * that background process before Maestro launches the app under test. - */ -function stopAndroidHomeLauncher(deviceId: string): void { - const home = execute([ - 'adb', '-s', deviceId, 'shell', 'cmd', 'package', 'resolve-activity', '--brief', - '-a', 'android.intent.action.MAIN', '-c', 'android.intent.category.HOME', - ], { capture: true }) - const packageName = selectAndroidHomePackage(home) - if (packageName) - execute(['adb', '-s', deviceId, 'shell', 'am', 'force-stop', packageName]) +function checkAndroidPlatform(deviceId: string): void { + assertAndroidPlatformHealthy(execute([ + 'adb', '-s', deviceId, 'logcat', '-b', 'events', '-d', '-v', 'threadtime', + ], { capture: true })) } function appId(platform: MobilePlatform): string { @@ -384,9 +374,10 @@ function runAndroid(preview: boolean): void { console.log(`Wildloop is open on Android device ${devices[0]}.`) } else { - stopAndroidHomeLauncher(devices[0]) + checkAndroidPlatform(devices[0]) seedTestLocation('android', devices[0]) runMaestroJourneys('android', devices[0], null) + checkAndroidPlatform(devices[0]) } } diff --git a/scripts/run-native-trail-android-e2e.ts b/scripts/run-native-trail-android-e2e.ts new file mode 100644 index 000000000..acc3b2d0e --- /dev/null +++ b/scripts/run-native-trail-android-e2e.ts @@ -0,0 +1,133 @@ +import { mkdir, readFile, writeFile } from 'node:fs/promises' +import { join, resolve } from 'node:path' +import process from 'node:process' +import mobile from '../config/mobile' +import { QA_PORTS } from '../tests/browser/qa-ports' +import { QA_SOCIAL_ACCOUNT } from '../tests/browser/qa-social-account' +import { assertAndroidPlatformHealthy, maestroEnvironment, maestroReportSummary, parseAdbDevices, validateGeneratedNativeApp } from './run-mobile-e2e' + +interface PersistedReview { id: number, rating: number, content: string } + +/** Check server persistence independently of the native screen's local state. */ +export function assertNativeReviewPersistence( + reviews: PersistedReview[], phase: 'create' | 'edit' | 'delete', content: string, previousId?: number, +): number | undefined { + if (phase === 'delete') { + if (reviews.length) throw new Error('The native delete did not remove the persisted review.') + return + } + const rating = phase === 'create' ? 5 : 4 + if (reviews.length !== 1 || reviews[0].content !== content || reviews[0].rating !== rating) + throw new Error(`The native ${phase} did not persist the expected review and rating.`) + if (phase === 'edit' && reviews[0].id !== previousId) + throw new Error('Editing created a second review instead of updating the original.') + return reviews[0].id +} + +/** Use only an owned emulator, a disposable database and normally published SDKs. */ +export async function runNativeTrailAndroidE2e(): Promise { + const root = resolve('storage/framework/runtime/e2e/native-trail-android') + const project = resolve('storage/framework/mobile/android') + const origin = `http://127.0.0.1:${QA_PORTS.app}` + await mkdir(root, { recursive: true }) + async function command(args: string[], name: string, env: Record = {}): Promise { + console.log(`Native Android trail QA: ${name}`) + const child = Bun.spawn(args, { env: { ...process.env, ...env }, stdout: 'pipe', stderr: 'pipe' }) + const [stdout, stderr, status] = await Promise.all([ + new Response(child.stdout).text(), new Response(child.stderr).text(), child.exited, + ]) + await writeFile(join(root, `${name}.log`), stdout + stderr) + if (status) throw new Error(`${args[0]} exited ${status}; see ${name}.log`) + return stdout + } + if (!process.argv.includes('--skip-build')) { + await command(['bun', 'run', 'build:android'], 'app-build', { MOBILE_URL: `${origin}/feed` }) + } + validateGeneratedNativeApp(project) + const config = JSON.parse(await readFile(join(project, 'craft.config.json'), 'utf8')) + if (config.devServerURL !== `${origin}/feed` || config.mapProvider !== 'maplibre') + throw new Error('Android trail QA requires its own loopback API and the native MapLibre provider.') + const gradle = await readFile(join(project, 'app/build.gradle.kts'), 'utf8') + if (!gradle.includes('org.maplibre.gl:android-sdk:') || gradle.includes('play-services-maps')) + throw new Error('Android trail QA requires the real key-free native map SDK.') + if (process.argv.includes('--build-only')) return + + const devices = parseAdbDevices(await command(['adb', 'devices'], 'devices')) + const device = process.env.NATIVE_QA_ANDROID_DEVICE + if (!device || !devices.includes(device)) throw new Error('NATIVE_QA_ANDROID_DEVICE must name an owned, ready emulator.') + const adb = (args: string[], name: string) => command(['adb', '-s', device, ...args], name) + const platformEvents = async (phase: string) => { + const events = await adb(['logcat', '-b', 'events', '-d', '-v', 'threadtime'], `platform-${phase}`) + assertAndroidPlatformHealthy(events) + } + await platformEvents('before') + for (const port of [QA_PORTS.app, QA_PORTS.api]) { + const occupied = await fetch(`http://127.0.0.1:${port}/api/health`, { signal: AbortSignal.timeout(1000) }).then(() => true).catch(() => false) + if (occupied) throw new Error(`QA port ${port} is occupied; select a different QA_PORT_BASE.`) + } + const qa = Bun.spawn(['bun', 'scripts/start-recording-qa.ts'], { stdout: Bun.file(join(root, 'qa-server.log')), stderr: 'inherit' }) + const forwards: number[] = [] + try { + const deadline = Date.now() + 180000 + while (!await fetch(`${origin}/api/health`, { signal: AbortSignal.timeout(1000) }).then(r => r.ok).catch(() => false)) { + if (qa.exitCode !== null || Date.now() > deadline) throw new Error('Isolated native QA server did not become ready.') + await Bun.sleep(250) + } + for (const port of [QA_PORTS.app, QA_PORTS.api]) { + await adb(['reverse', `tcp:${port}`, `tcp:${port}`], `reverse-${port}`) + forwards.push(port) + } + const listed = await (await fetch(`${origin}/api/trails?q=Craggy&country=all&limit=10`)).json() as any + let trail: any + for (const candidate of listed.trails ?? []) { + const detail = await (await fetch(`${origin}/api/trails/${candidate.id}`)).json() as any + if (detail.trail?.hasGeometry) { trail = detail.trail; break } + } + if (!trail) throw new Error('Native Android QA requires its seeded recorded route.') + const reviews = async (): Promise => { + const response = await fetch(`${origin}/api/trails/${trail.id}/reviews`, { cache: 'no-store' }) + if (!response.ok) throw new Error(`Reading persisted reviews failed: ${response.status}`) + return ((await response.json()) as any).reviews + } + if ((await reviews()).length) throw new Error('The isolated trail must start without reviews.') + await adb(['install', '-r', join(project, 'app/build/outputs/apk/debug/app-debug.apk')], 'app-install') + const marker = crypto.randomUUID().slice(0, 8) + const review = `Android QA ${marker}: clear signs and a beautiful ridge.` + const edit = `Android QA ${marker}: updated after a return visit.` + const variables = { + APP_ID: mobile.android.packageName, TRAIL_ID: String(trail.id), TRAIL_NAME: trail.name, + E2E_EMAIL: QA_SOCIAL_ACCOUNT.email, E2E_PASSWORD: QA_SOCIAL_ACCOUNT.sessionSecret, + REVIEW_TEXT: review, EDITED_REVIEW_TEXT: edit, + } + let reviewId: number | undefined + for (const phase of ['maps', 'review-create', 'review-edit', 'review-delete'] as const) { + const report = join(root, `${phase}.xml`) + await command([ + 'maestro', `--device=${device}`, '--no-ansi', 'test', + ...Object.entries(variables).flatMap(([key, value]) => ['--env', `${key}=${value}`]), + '--format', 'junit', '--output', report, '--debug-output', join(root, 'debug', phase), + '--test-output-dir', join(root, 'tests', phase), `.maestro/native-trail/${phase}.yaml`, + ], phase, maestroEnvironment()) + const summary = maestroReportSummary(await readFile(report, 'utf8')) + if (!summary.tests || summary.failures) throw new Error(`Native Android ${phase} did not pass.`) + if (phase !== 'maps') { + const saved = await reviews() + await writeFile(join(root, `${phase}-persistence.json`), JSON.stringify(saved, null, 2)) + const action = phase === 'review-create' ? 'create' : phase === 'review-edit' ? 'edit' : 'delete' + reviewId = assertNativeReviewPersistence(saved, action, action === 'create' ? review : edit, reviewId) + } + await platformEvents(phase) + } + console.log('Native Android maps, sticky save and persisted review create/edit/delete passed.') + } + finally { + await adb(['logcat', '-d', '-s', 'CraftNativeAndroid:V', 'AndroidRuntime:E'], 'app-runtime').catch(() => {}) + await adb(['shell', 'uiautomator', 'dump', '/sdcard/wildloop-trail-final.xml'], 'final-tree').then(() => + adb(['pull', '/sdcard/wildloop-trail-final.xml', join(root, 'final-tree.xml')], 'pull-final-tree')).catch(() => {}) + for (const port of forwards) await adb(['reverse', '--remove', `tcp:${port}`], `remove-reverse-${port}`).catch(() => {}) + qa.kill('SIGTERM') + await qa.exited + } +} + +if (import.meta.main) await runNativeTrailAndroidE2e() diff --git a/tests/unit/mobile-e2e-runner.test.ts b/tests/unit/mobile-e2e-runner.test.ts index 89937cfb7..e1bac4f2d 100644 --- a/tests/unit/mobile-e2e-runner.test.ts +++ b/tests/unit/mobile-e2e-runner.test.ts @@ -2,7 +2,7 @@ import { mkdirSync, mkdtempSync, readFileSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { describe, expect, it } from 'bun:test' -import { deepLinkFlow, maestroEnvironment, maestroReportSummary, parseAdbDevices, requestedPlatform, resolveJavaHome, selectAndroidDeepLinkActivity, selectAndroidHomePackage, selectIosSimulator, signedInTargetURL, validateAnalyticsScriptCount, validateBundledFrontend, validateGeneratedNativeApp, validateIosAppBundle, validateNativeShellStyles, validateNativeTabLinks } from '../../scripts/run-mobile-e2e' +import { assertAndroidPlatformHealthy, deepLinkFlow, maestroEnvironment, maestroReportSummary, parseAdbDevices, requestedPlatform, resolveJavaHome, selectAndroidDeepLinkActivity, selectIosSimulator, signedInTargetURL, validateAnalyticsScriptCount, validateBundledFrontend, validateGeneratedNativeApp, validateIosAppBundle, validateNativeShellStyles, validateNativeTabLinks } from '../../scripts/run-mobile-e2e' import { inferDevelopmentTeam, requiredIosAppPaths, requiresDevelopmentTeam, selectAvailableIphone } from '../../scripts/run-ios-device' function writeNativeNavigationFixtures(output: string, intercepted = ''): void { @@ -118,9 +118,10 @@ describe('mobile E2E runner', () => { expect(selectAndroidDeepLinkActivity(output, 'org.missing.app')).toBeNull() }) - it('selects the Android home package without assuming a launcher vendor', () => { - expect(selectAndroidHomePackage('com.google.android.apps.nexuslauncher/.NexusLauncherActivity\n')).toBe('com.google.android.apps.nexuslauncher') - expect(selectAndroidHomePackage('')).toBeNull() + it('rejects emulator crashes and ANRs rather than hiding the system launcher', () => { + expect(() => assertAndroidPlatformHealthy('am_resume_activity: org.wildloop.app')).not.toThrow() + expect(() => assertAndroidPlatformHealthy('am_anr: com.android.launcher3')).toThrow('invalidates native acceptance') + expect(() => assertAndroidPlatformHealthy('am_crash: org.wildloop.app')).toThrow('invalidates native acceptance') }) it('accepts only supported platform arguments', () => { diff --git a/tests/unit/native-review-persistence.test.ts b/tests/unit/native-review-persistence.test.ts new file mode 100644 index 000000000..24abe857c --- /dev/null +++ b/tests/unit/native-review-persistence.test.ts @@ -0,0 +1,20 @@ +import { describe, expect, it } from 'bun:test' +import { assertNativeReviewPersistence } from '../../scripts/run-native-trail-android-e2e' + +describe('native review acceptance persistence checks', () => { + it('requires the edited rating and text on the original review', () => { + const created = { id: 7, content: 'First visit.', rating: 5 } + const id = assertNativeReviewPersistence([created], 'create', created.content) + expect(id).toBe(7) + expect(() => assertNativeReviewPersistence([created], 'edit', 'Return visit.', id)).toThrow('expected review') + expect(() => assertNativeReviewPersistence([{ ...created, id: 8, content: 'Return visit.', rating: 4 }], 'edit', 'Return visit.', id)).toThrow('second review') + expect(assertNativeReviewPersistence([{ ...created, content: 'Return visit.', rating: 4 }], 'edit', 'Return visit.', id)).toBe(id) + }) + + it('rejects duplicate creates and a review left behind after deletion', () => { + const row = { id: 7, content: 'First visit.', rating: 5 } + expect(() => assertNativeReviewPersistence([row, { ...row, id: 8 }], 'create', row.content)).toThrow('expected review') + expect(() => assertNativeReviewPersistence([row], 'delete', row.content)).toThrow('did not remove') + expect(assertNativeReviewPersistence([], 'delete', row.content)).toBeUndefined() + }) +}) diff --git a/tsconfig.app.json b/tsconfig.app.json index 4706dfd6e..f81f875ff 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -79,6 +79,7 @@ "scripts/test-recording-api.ts", "scripts/start-recording-qa.ts", "scripts/run-native-trail-e2e.ts", + "scripts/run-native-trail-android-e2e.ts", "tests/native/**/*.ts", "tests/unit/account-deletion.test.ts", "tests/unit/battle-rows.test.ts", From e0ce81cb9c7e3fe2c95f91198e10fb5169cc49b1 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 17 Oct 2026 20:47:07 -0700 Subject: [PATCH 02/59] test(mobile): exercise native map exports location and action handoffs --- .maestro/native-trail/directions.yaml | 16 +++++++++ .maestro/native-trail/sharing.yaml | 28 ++++++++++++++++ .maestro/native-trail/utilities.yaml | 43 +++++++++++++++++++++++++ scripts/run-native-trail-android-e2e.ts | 29 ++++++++++++++--- 4 files changed, 112 insertions(+), 4 deletions(-) create mode 100644 .maestro/native-trail/directions.yaml create mode 100644 .maestro/native-trail/sharing.yaml create mode 100644 .maestro/native-trail/utilities.yaml diff --git a/.maestro/native-trail/directions.yaml b/.maestro/native-trail/directions.yaml new file mode 100644 index 000000000..429f30d29 --- /dev/null +++ b/.maestro/native-trail/directions.yaml @@ -0,0 +1,16 @@ +appId: ${APP_ID} +name: Open trailhead directions from the native sticky actions +--- +- launchApp +- openLink: wildloop://trail/${TRAIL_ID} +- extendedWaitUntil: + visible: + id: trail-directions + timeout: 30000 +- tapOn: + id: trail-directions +- extendedWaitUntil: + notVisible: + id: trail-sticky-actions + timeout: 15000 +- takeScreenshot: android-native-directions-handoff diff --git a/.maestro/native-trail/sharing.yaml b/.maestro/native-trail/sharing.yaml new file mode 100644 index 000000000..e37d3976d --- /dev/null +++ b/.maestro/native-trail/sharing.yaml @@ -0,0 +1,28 @@ +appId: ${APP_ID} +name: Copy the trail link and paste it into a real native field +--- +- launchApp +- openLink: wildloop://trail/${TRAIL_ID} +- extendedWaitUntil: + visible: + id: trail-share + timeout: 30000 +- tapOn: + id: trail-share +- extendedWaitUntil: + visible: '^Copy$' + timeout: 15000 +- takeScreenshot: android-native-share-sheet +- tapOn: '^Copy$' +- openLink: wildloop://login +- extendedWaitUntil: + visible: + id: login-email + timeout: 15000 +- longPressOn: + id: login-email +- tapOn: '^Paste$' +- assertVisible: + id: login-email + text: 'https://wildloop.org/trail/${TRAIL_ID}' +- takeScreenshot: android-native-share-link-pasted diff --git a/.maestro/native-trail/utilities.yaml b/.maestro/native-trail/utilities.yaml new file mode 100644 index 000000000..428f0ffea --- /dev/null +++ b/.maestro/native-trail/utilities.yaml @@ -0,0 +1,43 @@ +appId: ${APP_ID} +name: Native location, route customization and GPX sharing +--- +- launchApp +- openLink: wildloop://trail/${TRAIL_ID}/map +- extendedWaitUntil: + visible: + id: trail-full-map + timeout: 30000 +- assertNotVisible: + id: '.*permission_allow_foreground_only_button' +- tapOn: + id: map-locate +- extendedWaitUntil: + visible: + id: '.*permission_allow_foreground_only_button' + timeout: 15000 +- tapOn: + id: '.*permission_allow_foreground_only_button' +- extendedWaitUntil: + visible: 'Your location is shown' + timeout: 30000 +- takeScreenshot: android-native-map-location +- tapOn: + id: map-customize +- extendedWaitUntil: + visible: + id: route-builder-map + timeout: 30000 +- assertVisible: ${TRAIL_NAME} +- takeScreenshot: android-native-customize-route +- back +- assertVisible: + id: trail-full-map +- tapOn: + id: map-export +- extendedWaitUntil: + visible: ${GPX_NAME} + timeout: 15000 +- takeScreenshot: android-native-gpx-share-sheet +- back +- assertVisible: + id: trail-full-map diff --git a/scripts/run-native-trail-android-e2e.ts b/scripts/run-native-trail-android-e2e.ts index acc3b2d0e..748e4d4d5 100644 --- a/scripts/run-native-trail-android-e2e.ts +++ b/scripts/run-native-trail-android-e2e.ts @@ -4,6 +4,7 @@ import process from 'node:process' import mobile from '../config/mobile' import { QA_PORTS } from '../tests/browser/qa-ports' import { QA_SOCIAL_ACCOUNT } from '../tests/browser/qa-social-account' +import { decodeRouteParts, primaryRoutePart } from '../resources/functions/trail-geometry' import { assertAndroidPlatformHealthy, maestroEnvironment, maestroReportSummary, parseAdbDevices, validateGeneratedNativeApp } from './run-mobile-e2e' interface PersistedReview { id: number, rating: number, content: string } @@ -54,7 +55,7 @@ export async function runNativeTrailAndroidE2e(): Promise { const devices = parseAdbDevices(await command(['adb', 'devices'], 'devices')) const device = process.env.NATIVE_QA_ANDROID_DEVICE - if (!device || !devices.includes(device)) throw new Error('NATIVE_QA_ANDROID_DEVICE must name an owned, ready emulator.') + if (!device || !/^emulator-\d+$/.test(device) || !devices.includes(device)) throw new Error('NATIVE_QA_ANDROID_DEVICE must name an owned, ready emulator.') const adb = (args: string[], name: string) => command(['adb', '-s', device, ...args], name) const platformEvents = async (phase: string) => { const events = await adb(['logcat', '-b', 'events', '-d', '-v', 'threadtime'], `platform-${phase}`) @@ -84,6 +85,9 @@ export async function runNativeTrailAndroidE2e(): Promise { if (detail.trail?.hasGeometry) { trail = detail.trail; break } } if (!trail) throw new Error('Native Android QA requires its seeded recorded route.') + const first = primaryRoutePart([...decodeRouteParts(trail.geometry), ...(Array.isArray(trail.pieceRoutes) ? trail.pieceRoutes : [])])[0] + if (!first) throw new Error('The seeded trail has no recorded route start.') + await adb(['emu', 'geo', 'fix', String(first[1]), String(first[0])], 'seed-location') const reviews = async (): Promise => { const response = await fetch(`${origin}/api/trails/${trail.id}/reviews`, { cache: 'no-store' }) if (!response.ok) throw new Error(`Reading persisted reviews failed: ${response.status}`) @@ -98,9 +102,10 @@ export async function runNativeTrailAndroidE2e(): Promise { APP_ID: mobile.android.packageName, TRAIL_ID: String(trail.id), TRAIL_NAME: trail.name, E2E_EMAIL: QA_SOCIAL_ACCOUNT.email, E2E_PASSWORD: QA_SOCIAL_ACCOUNT.sessionSecret, REVIEW_TEXT: review, EDITED_REVIEW_TEXT: edit, + GPX_NAME: `${trail.name.replace(/[^a-z0-9]+/gi, '-').replace(/^-|-$/g, '').slice(0, 80)}.gpx`, } let reviewId: number | undefined - for (const phase of ['maps', 'review-create', 'review-edit', 'review-delete'] as const) { + for (const phase of ['maps', 'utilities', 'sharing', 'directions', 'review-create', 'review-edit', 'review-delete'] as const) { const report = join(root, `${phase}.xml`) await command([ 'maestro', `--device=${device}`, '--no-ansi', 'test', @@ -110,15 +115,31 @@ export async function runNativeTrailAndroidE2e(): Promise { ], phase, maestroEnvironment()) const summary = maestroReportSummary(await readFile(report, 'utf8')) if (!summary.tests || summary.failures) throw new Error(`Native Android ${phase} did not pass.`) - if (phase !== 'maps') { + if (phase.startsWith('review-')) { const saved = await reviews() await writeFile(join(root, `${phase}-persistence.json`), JSON.stringify(saved, null, 2)) const action = phase === 'review-create' ? 'create' : phase === 'review-edit' ? 'edit' : 'delete' reviewId = assertNativeReviewPersistence(saved, action, action === 'create' ? review : edit, reviewId) } + if (phase === 'utilities') { + const files = await adb(['shell', 'run-as', mobile.android.packageName, 'find', '.', '-type', 'f'], 'export-files') + const paths = files.split(/\r?\n/).filter(path => /^[a-zA-Z0-9_./-]+\.gpx$/.test(path)) + let exported = false + for (const path of paths) { + const xml = await adb(['exec-out', 'run-as', mobile.android.packageName, 'cat', path], 'exported-gpx') + if (xml.includes('') && xml.includes(` /(?:mResumedActivity|topResumedActivity):/.test(line)) + if (!resumed.length || resumed.some(line => line.includes(`${mobile.android.packageName}/`))) + throw new Error('Directions did not hand off to an external Android activity.') + } await platformEvents(phase) } - console.log('Native Android maps, sticky save and persisted review create/edit/delete passed.') + console.log('Native Android maps, sticky actions, location, GPX, route customization, actual share-link paste and persisted review create/edit/delete passed.') } finally { await adb(['logcat', '-d', '-s', 'CraftNativeAndroid:V', 'AndroidRuntime:E'], 'app-runtime').catch(() => {}) From 241a98c46d2740ee90ca158d7aecbac9ad64f6f7 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 17 Oct 2026 21:02:31 -0700 Subject: [PATCH 03/59] test(mobile): replace review text through native selection controls --- .maestro/native-trail/review-edit.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.maestro/native-trail/review-edit.yaml b/.maestro/native-trail/review-edit.yaml index f14a926fd..ca4b1478d 100644 --- a/.maestro/native-trail/review-edit.yaml +++ b/.maestro/native-trail/review-edit.yaml @@ -16,9 +16,10 @@ name: Reopen and edit the persisted native review visible: id: trail-review-content timeout: 15000 -- tapOn: +- longPressOn: id: trail-review-content -- eraseText: 2000 +- tapOn: '(?i)^Select all$' +- eraseText: 1 - inputText: ${EDITED_REVIEW_TEXT} - hideKeyboard - tapOn: From a39756ad681e383be73c42469a34ab62790967a0 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 17 Oct 2026 21:35:48 -0700 Subject: [PATCH 04/59] test(mobile): verify iOS review persistence and edit identity --- .github/workflows/mobile-e2e.yml | 1 + scripts/run-native-trail-e2e.ts | 27 ++++++++++++++++++++++++++- tests/native/trail-journey.ts | 11 ++++++++--- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mobile-e2e.yml b/.github/workflows/mobile-e2e.yml index 9be682e79..774fc3103 100644 --- a/.github/workflows/mobile-e2e.yml +++ b/.github/workflows/mobile-e2e.yml @@ -174,6 +174,7 @@ jobs: path: | storage/framework/runtime/e2e/native-trail/*.log storage/framework/runtime/e2e/native-trail/*.txt + storage/framework/runtime/e2e/native-trail/*-persistence.json storage/framework/runtime/e2e/native-trail/*.png storage/framework/runtime/e2e/native-trail/results-*.xcresult if-no-files-found: warn diff --git a/scripts/run-native-trail-e2e.ts b/scripts/run-native-trail-e2e.ts index 56363e1bd..407af6940 100644 --- a/scripts/run-native-trail-e2e.ts +++ b/scripts/run-native-trail-e2e.ts @@ -51,7 +51,15 @@ export async function runNativeTrailE2e(): Promise { } if(!trail)throw new Error('Native trail QA requires its seeded recorded route.') const review=`Native QA ${crypto.randomUUID().slice(0,8)}: clear signposts and a beautiful ridge.` - const journeys=nativeTrailJourneys({trailId:trail.id,trailName:trail.name,email:QA_SOCIAL_ACCOUNT.email,password:QA_SOCIAL_ACCOUNT.sessionSecret,review,edit:' Updated after a return visit.'}) + const edit=' Updated after a return visit.' + const readReviews=async()=>{ + const response=await fetch(`${origin}/api/trails/${trail.id}/reviews`,{cache:'no-store'}) + if(!response.ok)throw new Error(`Reading persisted reviews failed: ${response.status}`) + return ((await response.json()) as any).reviews as Array<{id:number,content:string,rating:number}> + } + if((await readReviews()).length)throw new Error('The isolated native trail must start without reviews.') + let createdReviewId:number|undefined + const journeys=nativeTrailJourneys({trailId:trail.id,trailName:trail.name,email:QA_SOCIAL_ACCOUNT.email,password:QA_SOCIAL_ACCOUNT.sessionSecret,review,edit}) const controlPort=QA_PORTS.app+15 const driver=prepareIosSimulatorDriver({...mobile.ios,simulator:{output:join(root,'driver'),projectName:'WildloopTrailDriver',bundleIdPrefix:'org.wildloop.trailqa',controlUrl:`http://127.0.0.1:${controlPort}`}}) control=Bun.serve({hostname:'127.0.0.1',port:controlPort,idleTimeout:120,async fetch(request){ @@ -60,6 +68,23 @@ export async function runNativeTrailE2e(): Promise { if(url.pathname==='/exec') { try { const hook=url.searchParams.get('name') + if(hook==='verify-review-created' || hook==='verify-review-edited' || hook==='verify-review-deleted') { + const rows=await readReviews() + await writeFile(join(root,`${hook}-persistence.json`),JSON.stringify(rows,null,2)) + if(hook==='verify-review-deleted') { + if(rows.length)throw new Error('The native deletion did not remove the persisted review.') + return new Response('PASS deleted review is absent from persistence') + } + if(rows.length!==1)throw new Error('The native review action must persist exactly one review.') + if(hook==='verify-review-created') { + if(rows[0].content!==review || rows[0].rating!==5)throw new Error('The created review text and rating did not persist.') + createdReviewId=rows[0].id + return new Response('PASS created review text and rating persisted') + } + if(rows[0].id!==createdReviewId || rows[0].rating!==4 || !rows[0].content.includes(edit.trim())) + throw new Error('The native edit did not retain the review identity and persist its new text and rating.') + return new Response('PASS edited review retained its identity and persisted') + } if(hook==='seed-location') { const first=primaryRoutePart([...decodeRouteParts(trail.geometry),...(Array.isArray(trail.pieceRoutes)?trail.pieceRoutes:[])])[0] if(!first)throw new Error('The seeded trail has no recorded route start.') diff --git a/tests/native/trail-journey.ts b/tests/native/trail-journey.ts index 4b3d0bb5b..05e0a39bd 100644 --- a/tests/native/trail-journey.ts +++ b/tests/native/trail-journey.ts @@ -79,27 +79,32 @@ const reviews:SimulatorStep[] = [ {command:'scrollto',text:'Edit your review'}, {command:'shot',name:'native-review-created'}, {command:'tree',name:'native-review-created'}, + {command:'exec',name:'verify-review-created'}, {command:'tapid',text:'trail-write-review'}, {command:'expectid',text:'trail-review-composer',seconds:10}, + {command:'tapid',text:'trail-review-star-4'}, {command:'typeid',id:'trail-review-content',text:input.edit}, {command:'scrollto',text:'Save review'}, {command:'tapid',text:'trail-review-submit'}, {command:'expect',text:input.edit.trim(),seconds:15}, {command:'shot',name:'native-review-edited'}, + {command:'exec',name:'verify-review-edited'}, ] // Keep deletion observable even when editing fails earlier in its own phase. // This removes the real review created above; the aggregate still fails if // any part of the lifecycle fails. const reviewDelete:SimulatorStep[] = [ ...arrival, - {command:'expect',text:input.review,seconds:15}, + {command:'expect',text:'Edit your review',seconds:15}, {command:'scrollto',text:'Delete your review'}, {command:'tapid',text:'trail-delete-review'}, {command:'tapexact',text:'Delete review'}, {command:'expect',text:'Leave a review',seconds:15}, {command:'absent',text:input.review}, + {command:'absent',text:input.edit.trim()}, {command:'shot',name:'native-review-deleted'}, {command:'tree',name:'native-review-deleted'}, + {command:'exec',name:'verify-review-deleted'}, ] const fullMap:SimulatorStep[] = [ ...arrival, @@ -146,8 +151,8 @@ const location:SimulatorStep[] = [ ] return [ {name:'maps',steps:maps,completion:'PASS expectid trail-sticky-actions'}, - {name:'reviews',steps:reviews,completion:`PASS expect ${input.edit.trim()}`}, - {name:'review-delete',steps:reviewDelete,completion:`PASS absent ${input.review}`}, + {name:'reviews',steps:reviews,completion:'exec verify-review-edited: PASS edited review retained its identity and persisted'}, + {name:'review-delete',steps:reviewDelete,completion:'exec verify-review-deleted: PASS deleted review is absent from persistence'}, {name:'sharing',steps:sharing,completion:'exec verify-share: PASS native share copied the trail link'}, {name:'gpx',steps:gpx,completion:'exec verify-gpx: PASS exported GPX contains the recorded route'}, {name:'planner',steps:planner,completion:'PASS expectid trail-full-map'}, From d0ccccc0c1c0d4b3efa928d670a2a261a43b9f81 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 17 Oct 2026 21:53:34 -0700 Subject: [PATCH 05/59] test(mobile): reject skipped native acceptance journeys --- scripts/run-mobile-e2e.ts | 4 +++- scripts/run-native-trail-android-e2e.ts | 2 +- tests/unit/mobile-e2e-runner.test.ts | 12 +++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/run-mobile-e2e.ts b/scripts/run-mobile-e2e.ts index 1bbd7c12b..c6260de23 100644 --- a/scripts/run-mobile-e2e.ts +++ b/scripts/run-mobile-e2e.ts @@ -113,10 +113,11 @@ export function selectIosSimulator(payload: SimctlDevices): IosDevice | null { return candidates.find(device => device.state === 'Booted') ?? candidates[0] ?? null } -export function maestroReportSummary(xml: string): { failures: number, tests: number } { +export function maestroReportSummary(xml: string): { failures: number, tests: number, skipped: number } { return { failures: xml.match(/<(?:failure|error)\b/g)?.length ?? 0, tests: xml.match(/ 0) throw new Error(`Maestro reported ${summary.failures} failed ${platform} test(s)`) + if (summary.skipped > 0) throw new Error(`Maestro skipped ${summary.skipped} required ${platform} test(s)`) } function runMaestroJourneys(platform: MobilePlatform, deviceId: string, signedInURL: string | null): void { diff --git a/scripts/run-native-trail-android-e2e.ts b/scripts/run-native-trail-android-e2e.ts index 748e4d4d5..135a3f4ed 100644 --- a/scripts/run-native-trail-android-e2e.ts +++ b/scripts/run-native-trail-android-e2e.ts @@ -114,7 +114,7 @@ export async function runNativeTrailAndroidE2e(): Promise { '--test-output-dir', join(root, 'tests', phase), `.maestro/native-trail/${phase}.yaml`, ], phase, maestroEnvironment()) const summary = maestroReportSummary(await readFile(report, 'utf8')) - if (!summary.tests || summary.failures) throw new Error(`Native Android ${phase} did not pass.`) + if (!summary.tests || summary.failures || summary.skipped) throw new Error(`Native Android ${phase} did not execute and pass every required test.`) if (phase.startsWith('review-')) { const saved = await reviews() await writeFile(join(root, `${phase}-persistence.json`), JSON.stringify(saved, null, 2)) diff --git a/tests/unit/mobile-e2e-runner.test.ts b/tests/unit/mobile-e2e-runner.test.ts index e1bac4f2d..d70f8c8f2 100644 --- a/tests/unit/mobile-e2e-runner.test.ts +++ b/tests/unit/mobile-e2e-runner.test.ts @@ -172,7 +172,17 @@ describe('mobile E2E runner', () => { not visible - `)).toEqual({ failures: 1, tests: 2 }) + `)).toEqual({ failures: 1, tests: 2, skipped: 0 }) + }) + + it('distinguishes skipped device journeys from executed passes', () => { + expect(maestroReportSummary(` + + + + offline + + `)).toEqual({ failures: 1, tests: 3, skipped: 1 }) }) it('rejects a mobile bundle that lost reactive page setup', () => { From 9f101d7b1d95c12ad630c77548b636b75733e9f1 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 17 Oct 2026 21:58:27 -0700 Subject: [PATCH 06/59] test(mobile): verify saved trails survive native navigation --- .maestro/native-trail/maps.yaml | 18 ++++++++++++++++++ tests/native/trail-journey.ts | 8 ++++++++ 2 files changed, 26 insertions(+) diff --git a/.maestro/native-trail/maps.yaml b/.maestro/native-trail/maps.yaml index 0e6f426d3..48bb0a6cc 100644 --- a/.maestro/native-trail/maps.yaml +++ b/.maestro/native-trail/maps.yaml @@ -7,11 +7,29 @@ name: Native Android trail maps and sticky save - extendedWaitUntil: visible: '^Saved$' timeout: 15000 +- openLink: wildloop://feed +- extendedWaitUntil: + visible: + id: native-feed-scroll + timeout: 30000 +- openLink: wildloop://trail/${TRAIL_ID} +- extendedWaitUntil: + visible: '^Saved$' + timeout: 30000 - tapOn: id: trail-save - extendedWaitUntil: visible: '^Save$' timeout: 15000 +- openLink: wildloop://feed +- extendedWaitUntil: + visible: + id: native-feed-scroll + timeout: 30000 +- openLink: wildloop://trail/${TRAIL_ID} +- extendedWaitUntil: + visible: '^Save$' + timeout: 30000 - scrollUntilVisible: element: id: trail-map-fullscreen diff --git a/tests/native/trail-journey.ts b/tests/native/trail-journey.ts index 05e0a39bd..91132b17e 100644 --- a/tests/native/trail-journey.ts +++ b/tests/native/trail-journey.ts @@ -26,8 +26,16 @@ const maps:SimulatorStep[] = [ {command:'expectexact',text:'Save',seconds:30}, {command:'tapid',text:'trail-save'}, {command:'expect',text:'Saved',seconds:10}, + {command:'openurl',url:'wildloop://feed'}, + {command:'expectid',text:'native-feed-scroll',seconds:15}, + {command:'openurl',url:`wildloop://trail/${input.trailId}`}, + {command:'expectexact',text:'Saved',seconds:30}, {command:'tapid',text:'trail-save'}, {command:'expectexact',text:'Save',seconds:10}, + {command:'openurl',url:'wildloop://feed'}, + {command:'expectid',text:'native-feed-scroll',seconds:15}, + {command:'openurl',url:`wildloop://trail/${input.trailId}`}, + {command:'expectexact',text:'Save',seconds:30}, {command:'scrollto',text:'Toggle elevation profile'}, {command:'shot',name:'native-floating-profile-inline'}, {command:'tapid',text:'trail-profile-toggle'}, From dad13bd8b889ff163f2dd9a139e28e4506b671fe Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 17 Oct 2026 22:16:58 -0700 Subject: [PATCH 07/59] test(mobile): select measured trail elevations through native sliders --- .maestro/native-trail/maps.yaml | 20 ++++++++++++++++++++ scripts/run-native-trail-android-e2e.ts | 9 +++++++++ 2 files changed, 29 insertions(+) diff --git a/.maestro/native-trail/maps.yaml b/.maestro/native-trail/maps.yaml index 48bb0a6cc..6b3063ca1 100644 --- a/.maestro/native-trail/maps.yaml +++ b/.maestro/native-trail/maps.yaml @@ -30,6 +30,17 @@ name: Native Android trail maps and sticky save - extendedWaitUntil: visible: '^Save$' timeout: 30000 +- scrollUntilVisible: + element: + id: trail-elevation-slider + direction: DOWN +- tapOn: + id: trail-elevation-slider + point: '99.9%,50%' +- extendedWaitUntil: + visible: ${INLINE_PROFILE_END_TEXT} + timeout: 15000 +- takeScreenshot: android-native-inline-elevation-selection - scrollUntilVisible: element: id: trail-map-fullscreen @@ -61,6 +72,15 @@ name: Native Android trail maps and sticky save - tapOn: id: map-profile-toggle - assertVisible: 'Toggle elevation profile, Elevation profile expanded' +- tapOn: + id: map-elevation-slider + point: '99.9%,50%' +- extendedWaitUntil: + visible: ${PROFILE_END_TEXT} + timeout: 15000 +- takeScreenshot: android-native-fullscreen-elevation-selection +- tapOn: + id: map-fit - tapOn: id: map-layer - tapOn: '^Satellite$' diff --git a/scripts/run-native-trail-android-e2e.ts b/scripts/run-native-trail-android-e2e.ts index 135a3f4ed..8f74bf483 100644 --- a/scripts/run-native-trail-android-e2e.ts +++ b/scripts/run-native-trail-android-e2e.ts @@ -85,6 +85,13 @@ export async function runNativeTrailAndroidE2e(): Promise { if (detail.trail?.hasGeometry) { trail = detail.trail; break } } if (!trail) throw new Error('Native Android QA requires its seeded recorded route.') + const profileResponse = await fetch(`${origin}/api/trails/${trail.id}/profile`) + if (!profileResponse.ok) throw new Error('Native Android QA requires the trail profile endpoint to be available.') + const profile = (await profileResponse.json()) as { points: Array<{ mi: number, ft: number | null }> } + const endpoint = profile.points?.at(-1) + if (!endpoint || profile.points.length < 2 || !Number.isFinite(endpoint.mi) || (endpoint.ft !== null && !Number.isFinite(endpoint.ft))) + throw new Error('Native Android QA requires a selectable recorded route profile.') + const endElevation = endpoint.ft === null ? 'elevation unavailable' : `${endpoint.ft} ft` const first = primaryRoutePart([...decodeRouteParts(trail.geometry), ...(Array.isArray(trail.pieceRoutes) ? trail.pieceRoutes : [])])[0] if (!first) throw new Error('The seeded trail has no recorded route start.') await adb(['emu', 'geo', 'fix', String(first[1]), String(first[0])], 'seed-location') @@ -102,6 +109,8 @@ export async function runNativeTrailAndroidE2e(): Promise { APP_ID: mobile.android.packageName, TRAIL_ID: String(trail.id), TRAIL_NAME: trail.name, E2E_EMAIL: QA_SOCIAL_ACCOUNT.email, E2E_PASSWORD: QA_SOCIAL_ACCOUNT.sessionSecret, REVIEW_TEXT: review, EDITED_REVIEW_TEXT: edit, + PROFILE_END_TEXT: `${endpoint.mi.toFixed(2)} mi · ${endElevation}`, + INLINE_PROFILE_END_TEXT: `${endpoint.mi.toFixed(2)} mi, ${endElevation}`, GPX_NAME: `${trail.name.replace(/[^a-z0-9]+/gi, '-').replace(/^-|-$/g, '').slice(0, 80)}.gpx`, } let reviewId: number | undefined From 6801859fa87ed8dfff3ac7024223011004d32eba Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 17 Oct 2026 22:59:19 -0700 Subject: [PATCH 08/59] test(mobile): cover inline map tools and both directions actions --- .maestro/native-trail/directions-map.yaml | 16 ++++++++++++ .maestro/native-trail/maps.yaml | 27 +++++++++++++++++++ .maestro/native-trail/utilities.yaml | 32 ++++++++++++++++++++++- resources/native/TrailDetail.stx | 2 +- resources/native/TrailMap.stx | 2 +- scripts/run-native-trail-android-e2e.ts | 6 ++--- 6 files changed, 79 insertions(+), 6 deletions(-) create mode 100644 .maestro/native-trail/directions-map.yaml diff --git a/.maestro/native-trail/directions-map.yaml b/.maestro/native-trail/directions-map.yaml new file mode 100644 index 000000000..c36b5bc18 --- /dev/null +++ b/.maestro/native-trail/directions-map.yaml @@ -0,0 +1,16 @@ +appId: ${APP_ID} +name: Open trailhead directions from the full native map +--- +- launchApp +- openLink: wildloop://trail/${TRAIL_ID}/map +- extendedWaitUntil: + visible: + id: map-directions + timeout: 30000 +- tapOn: + id: map-directions +- extendedWaitUntil: + notVisible: + id: trail-full-map + timeout: 15000 +- takeScreenshot: android-native-full-map-directions-handoff diff --git a/.maestro/native-trail/maps.yaml b/.maestro/native-trail/maps.yaml index 6b3063ca1..57b111034 100644 --- a/.maestro/native-trail/maps.yaml +++ b/.maestro/native-trail/maps.yaml @@ -41,6 +41,33 @@ name: Native Android trail maps and sticky save visible: ${INLINE_PROFILE_END_TEXT} timeout: 15000 - takeScreenshot: android-native-inline-elevation-selection +- scrollUntilVisible: + element: + id: trail-zoom-in + direction: DOWN +- tapOn: + id: trail-zoom-in +- tapOn: + id: trail-zoom-out +- tapOn: + id: trail-fit-route +- tapOn: + id: trail-map-3d +- assertVisible: '^2D$' +- tapOn: '^North$' +- scrollUntilVisible: + element: + id: trail-map-layer + direction: DOWN +- tapOn: + id: trail-map-layer +- tapOn: '^Satellite$' +- assertVisible: 'Map layer, Satellite' +- takeScreenshot: android-native-inline-map-satellite +- tapOn: + id: trail-map-layer +- tapOn: '^Outdoors$' +- assertVisible: 'Map layer, Outdoors' - scrollUntilVisible: element: id: trail-map-fullscreen diff --git a/.maestro/native-trail/utilities.yaml b/.maestro/native-trail/utilities.yaml index 428f0ffea..935e5a266 100644 --- a/.maestro/native-trail/utilities.yaml +++ b/.maestro/native-trail/utilities.yaml @@ -18,7 +18,7 @@ name: Native location, route customization and GPX sharing - tapOn: id: '.*permission_allow_foreground_only_button' - extendedWaitUntil: - visible: 'Your location is shown' + visible: 'My location, Your location is shown' timeout: 30000 - takeScreenshot: android-native-map-location - tapOn: @@ -41,3 +41,33 @@ name: Native location, route customization and GPX sharing - back - assertVisible: id: trail-full-map +- openLink: wildloop://trail/${TRAIL_ID} +- extendedWaitUntil: + visible: + id: trail-sticky-actions + timeout: 30000 +- scrollUntilVisible: + element: + id: trail-map-locate + direction: DOWN +- tapOn: + id: trail-map-locate +- extendedWaitUntil: + visible: 'My location, Your location is shown' + timeout: 30000 +- assertNotVisible: + id: '.*permission_allow_foreground_only_button' +- takeScreenshot: android-native-inline-map-location +- scrollUntilVisible: + element: + id: trail-map-export + direction: DOWN +- tapOn: + id: trail-map-export +- extendedWaitUntil: + visible: ${GPX_NAME} + timeout: 15000 +- takeScreenshot: android-native-inline-gpx-share-sheet +- back +- assertVisible: + id: trail-sticky-actions diff --git a/resources/native/TrailDetail.stx b/resources/native/TrailDetail.stx index b3ebf58a2..0447179c0 100644 --- a/resources/native/TrailDetail.stx +++ b/resources/native/TrailDetail.stx @@ -321,7 +321,7 @@ onMount(() => onNativeAccountChange(craft, () => { viewer.set(0); saved.set(fals - + diff --git a/resources/native/TrailMap.stx b/resources/native/TrailMap.stx index 994bca07d..c23b2697a 100644 --- a/resources/native/TrailMap.stx +++ b/resources/native/TrailMap.stx @@ -138,7 +138,7 @@ onMount(() => { void load(); return () => { alive = false } }) - + diff --git a/scripts/run-native-trail-android-e2e.ts b/scripts/run-native-trail-android-e2e.ts index 8f74bf483..5822a52c6 100644 --- a/scripts/run-native-trail-android-e2e.ts +++ b/scripts/run-native-trail-android-e2e.ts @@ -114,7 +114,7 @@ export async function runNativeTrailAndroidE2e(): Promise { GPX_NAME: `${trail.name.replace(/[^a-z0-9]+/gi, '-').replace(/^-|-$/g, '').slice(0, 80)}.gpx`, } let reviewId: number | undefined - for (const phase of ['maps', 'utilities', 'sharing', 'directions', 'review-create', 'review-edit', 'review-delete'] as const) { + for (const phase of ['maps', 'utilities', 'sharing', 'directions', 'directions-map', 'review-create', 'review-edit', 'review-delete'] as const) { const report = join(root, `${phase}.xml`) await command([ 'maestro', `--device=${device}`, '--no-ansi', 'test', @@ -140,8 +140,8 @@ export async function runNativeTrailAndroidE2e(): Promise { } if (!exported) throw new Error('The native GPX export did not contain the recorded route coordinates.') } - if (phase === 'directions') { - const activities = await adb(['shell', 'dumpsys', 'activity', 'activities'], 'directions-activities') + if (phase === 'directions' || phase === 'directions-map') { + const activities = await adb(['shell', 'dumpsys', 'activity', 'activities'], `${phase}-activities`) const resumed = activities.split('\n').filter(line => /(?:mResumedActivity|topResumedActivity):/.test(line)) if (!resumed.length || resumed.some(line => line.includes(`${mobile.android.packageName}/`))) throw new Error('Directions did not hand off to an external Android activity.') From fc10750fd0cac2baa2b4cb6026e43d7104ba69ee Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 17 Oct 2026 23:01:45 -0700 Subject: [PATCH 09/59] test(mobile): exercise inline iOS map utilities through native controls --- tests/native/trail-journey.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/native/trail-journey.ts b/tests/native/trail-journey.ts index 91132b17e..31878d3c5 100644 --- a/tests/native/trail-journey.ts +++ b/tests/native/trail-journey.ts @@ -44,6 +44,21 @@ const maps:SimulatorStep[] = [ {command:'shot',name:'native-profile-collapsed-inline'}, {command:'tapid',text:'trail-profile-toggle'}, {command:'expect',text:'Elevation profile expanded',seconds:10}, + {command:'scrollto',text:'Zoom in'}, + {command:'tapid',text:'trail-zoom-in'}, + {command:'tapid',text:'trail-zoom-out'}, + {command:'tapid',text:'trail-fit-route'}, + {command:'tapid',text:'trail-map-3d'}, + {command:'expectexact',text:'2D',seconds:10}, + {command:'tapexact',text:'North'}, + {command:'scrollto',text:'Map layer'}, + {command:'tapid',text:'trail-map-layer'}, + {command:'tapexact',text:'Satellite'}, + {command:'expect',text:'Map layer: Satellite',seconds:10}, + {command:'shot',name:'native-inline-satellite'}, + {command:'tapid',text:'trail-map-layer'}, + {command:'tapexact',text:'Outdoors'}, + {command:'expect',text:'Map layer: Outdoors',seconds:10}, {command:'scrollto',text:'Expand map'}, {command:'tapid',text:'trail-map-fullscreen'}, {command:'expectid',text:'trail-full-map',seconds:10}, @@ -136,6 +151,14 @@ const gpx:SimulatorStep[] = [ {command:'tree',name:'native-gpx-share-sheet'}, {command:'tapexact',text:'Copy'}, {command:'exec',name:'verify-gpx'}, + {command:'openurl',url:`wildloop://trail/${input.trailId}`}, + {command:'expectid',text:'trail-sticky-actions',seconds:15}, + {command:'scrollto',text:'Export GPX'}, + {command:'tapid',text:'trail-map-export'}, + {command:'expectexact',text:'Copy',seconds:10}, + {command:'shot',name:'native-inline-gpx-share-sheet'}, + {command:'tapexact',text:'Copy'}, + {command:'exec',name:'verify-gpx'}, ] const planner:SimulatorStep[] = [ ...fullMap, @@ -156,6 +179,13 @@ const location:SimulatorStep[] = [ {command:'expect',text:'Your location is shown',seconds:20}, {command:'tree',name:'native-location'}, {command:'shot',name:'native-location'}, + {command:'openurl',url:`wildloop://trail/${input.trailId}`}, + {command:'expectid',text:'trail-sticky-actions',seconds:15}, + {command:'scrollto',text:'My location'}, + {command:'tapid',text:'trail-map-locate'}, + {command:'expect',text:'Your location is shown',seconds:20}, + {command:'shot',name:'native-inline-location'}, + {command:'tree',name:'native-inline-location'}, ] return [ {name:'maps',steps:maps,completion:'PASS expectid trail-sticky-actions'}, From 47619a12d4cdc2de6bf59eb27f3a576b7d9a6e84 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 17 Oct 2026 23:05:36 -0700 Subject: [PATCH 10/59] chore: update published STX components to 0.2.566 --- bun.lock | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bun.lock b/bun.lock index 230e3b06c..62a2c15bd 100644 --- a/bun.lock +++ b/bun.lock @@ -10,7 +10,7 @@ "@loghq/stacks": "^0.2.6", "@stacksjs/composables": "^0.75.219", "@stacksjs/mobile": "^0.75.219", - "@stacksjs/stx": "^0.2.563", + "@stacksjs/stx": "^0.2.566", "@ts-analytics/tracking": "^0.1.17", "craft-native": "^0.0.237", "stacks": "^0.75.219", @@ -111,7 +111,7 @@ "@stacksjs/defaults": ["@stacksjs/defaults@0.75.219", "", { "dependencies": { "@iconify-json/f7": "^1.2.2", "@iconify-json/hugeicons": "^1.2.35", "@stacksjs/mobile": "0.75.219", "@stacksjs/sanitizer": "^0.2.534", "@xterm/addon-fit": "^0.11.0", "@xterm/xterm": "^6.0.0", "ts-qr-codes": "^0.1.8" } }, "sha512-wrw5pbvoB5ZMRrQWE2kdZ6lNhYABkoYN856oRzuvpYYNMPiDGzXRbfx8F8xGBFZLBxsJUvEBGBsEhn7X+ihKSw=="], - "@stacksjs/desktop": ["@stacksjs/desktop@0.2.563", "", { "dependencies": { "craft-native": ">=0.0.111" } }, "sha512-kNN1D1CZVF+luzgXhk12iRcQM51zrZy4siHhQ7y3WTDQBKY4O8sW+j/KrXPgMYaf1dDc9O3moxBSFPvPvqmuOg=="], + "@stacksjs/desktop": ["@stacksjs/desktop@0.2.566", "", { "dependencies": { "craft-native": ">=0.0.111" } }, "sha512-GGSQxtjHjdDNJ9GEmjroU5ZayIhyn9P9heR2gXN6/e5c98hm7l/SEZy8XuGSLsMUC/mJL37B9zxFMUtVQSf/fw=="], "@stacksjs/desktop-build": ["@stacksjs/desktop-build@0.75.219", "", { "dependencies": { "craft-native": ">=0.0.135" } }, "sha512-MI/gpXP/vY2/X2lNW0Yr5W6HLrf52K8TGAGUY7Y7PBcWS3ixDyAkpKBLJBsAIM8bIYg6N3sqxLNKLs9PJCWEHg=="], @@ -199,7 +199,7 @@ "@stacksjs/rpx": ["@stacksjs/rpx@0.11.54", "", { "dependencies": { "@stacksjs/clapp": "^0.2.10", "@stacksjs/tlsx": "^0.13.19", "ts-images": "^0.2.17" }, "bin": { "rpx": "./dist/bin/cli.js", "reverse-proxy": "./dist/bin/cli.js" } }, "sha512-3njfy0BYCpof1rkuY4slGmHRggLWlJdrnUJMNoou6kfBqXNvm8ANqXgiL/bIlQeIWwidqoo1IOjgPcB/EozNog=="], - "@stacksjs/sanitizer": ["@stacksjs/sanitizer@0.2.563", "", {}, "sha512-JkhUgIuiyTmjegQLKe+LEvdbgY+ACrnO0uurj3DNU95MhTtLLB6L/XmJCVHw68PUMbeZVVUw/hBXx4/SrUNg9g=="], + "@stacksjs/sanitizer": ["@stacksjs/sanitizer@0.2.566", "", {}, "sha512-rhi1R4dcMdwjif9xoUrC8xPkscbpFSEE7HXJG0Ec1mmA9zCbZ5plRjW5LqY050Ssm/7DCUEEUmN9k5sgxctFyQ=="], "@stacksjs/scheduler": ["@stacksjs/scheduler@0.75.219", "", { "dependencies": { "@stacksjs/action-runner": "0.75.219", "@stacksjs/cli": "0.75.219", "@stacksjs/cron": "0.75.219", "@stacksjs/database": "0.75.219", "@stacksjs/env": "0.75.219", "@stacksjs/error-handling": "0.75.219", "@stacksjs/logging": "0.75.219", "@stacksjs/notifications": "0.75.219", "@stacksjs/path": "0.75.219", "@stacksjs/queue": "0.75.219", "@stacksjs/storage": "0.75.219", "@stacksjs/types": "0.75.219" } }, "sha512-ourjJ5S/zcW/5QWvbLUuS7rw0KBbp6bpMM4sJBxeZ+ad6Cvw50v/y3iLn35WCebQAlNgwPnS3PRg1KPDtN6qLw=="], @@ -225,7 +225,7 @@ "@stacksjs/strings": ["@stacksjs/strings@0.75.219", "", {}, "sha512-88rZr9v1bONXcmfcteX1L/pK98LeN8IDVVaIJA5rjp4sd4xhKmB7rnfY4Bbz+GDcF9i0Q6FC289iDiLPUjaUWQ=="], - "@stacksjs/stx": ["@stacksjs/stx@0.2.563", "", { "dependencies": { "@stacksjs/clapp": "^0.2.16", "@stacksjs/desktop": "0.2.563", "@stacksjs/sanitizer": "0.2.563", "@stacksjs/ts-css": "^0.3.11", "@stacksjs/ts-i18n": "^0.1.11", "bun-plugin-stx": "0.2.563", "bunfig": "^0.15.19", "stx-router": "0.2.563", "ts-broadcasting": "^0.0.11", "ts-images": "^0.2.22", "ts-syntax-highlighter": "^0.2.1" }, "bin": { "stx": "./dist/cli.js" } }, "sha512-WTNOmbdnZ8ZfJp37fGGKc9C4R6xpDFAwauPeEdY/JX9s8A0BZX5cPBsB+4iNeLeOyQ7iFP5fz8Po/4Qmm3cNng=="], + "@stacksjs/stx": ["@stacksjs/stx@0.2.566", "", { "dependencies": { "@stacksjs/clapp": "^0.2.16", "@stacksjs/desktop": "0.2.566", "@stacksjs/sanitizer": "0.2.566", "@stacksjs/ts-css": "^0.3.11", "@stacksjs/ts-i18n": "^0.1.11", "bun-plugin-stx": "0.2.566", "bunfig": "^0.15.19", "stx-router": "0.2.566", "ts-broadcasting": "^0.0.11", "ts-images": "^0.2.22", "ts-syntax-highlighter": "^0.2.1" }, "bin": { "stx": "./dist/cli.js" } }, "sha512-ukCoVyNvaPCaRfOOYXkExXqWp52PXXuiQ3JlSU0eEia7QKdsuFLXkX3mCJVDpTuzrKzJxhlJWPwfvaHkjw9dsg=="], "@stacksjs/testing": ["@stacksjs/testing@0.75.219", "", { "dependencies": { "@stacksjs/auth": "0.75.219", "@stacksjs/cache": "0.75.219", "@stacksjs/config": "0.75.219", "@stacksjs/database": "0.75.219", "@stacksjs/email": "0.75.219", "@stacksjs/events": "0.75.219", "@stacksjs/path": "0.75.219", "@stacksjs/router": "0.75.219", "@stacksjs/storage": "0.75.219", "@stacksjs/strings": "0.75.219", "@stacksjs/ts-cloud": "^0.16.58", "very-happy-dom": "^0.3.5" } }, "sha512-OclrQD3AAOTbU5NHbM1Ls3COOMYAqLLg8+e2jS63gQaXmYfqbjBhLSMt83F+6Xeihmup3puin9XsGGA+fe6Gzw=="], @@ -337,7 +337,7 @@ "bun-plugin-dtsx": ["bun-plugin-dtsx@0.11.19", "", { "dependencies": { "@stacksjs/dtsx": "0.11.19" } }, "sha512-9itJqTxzONupXIS1Bwp/AqgXWrgSeHe/j0QyFewJ+//pL2Id+RoWFbMLpl42v2ucKgSFknsmAbLjn7wJkVx/vw=="], - "bun-plugin-stx": ["bun-plugin-stx@0.2.563", "", { "dependencies": { "@stacksjs/stx": "0.2.563", "stx-router": "0.2.563" }, "bin": { "serve": "./dist/serve.js", "stx-serve": "./dist/serve.js" } }, "sha512-o1lCCkNY/tgjf4esi0IyyWw8BlGNEtI0TyOhtbUxRZi5CjQOBEfDCe9kl/kcm+9TSJacLZUW92HDa3cA9uhZqg=="], + "bun-plugin-stx": ["bun-plugin-stx@0.2.566", "", { "dependencies": { "@stacksjs/stx": "0.2.566", "stx-router": "0.2.566" }, "bin": { "serve": "./dist/serve.js", "stx-serve": "./dist/serve.js" } }, "sha512-KzPI+2xEZnZ3lEAP7skEuF8gyjkD8YVFLyCgXR3ns8Orwzal+sYlGCMdr9fPOXwuJHkJP3zFQHAroAdBz99UDQ=="], "bun-query-builder": ["bun-query-builder@0.3.3", "", { "dependencies": { "@stacksjs/clapp": "^0.2.16", "@stacksjs/ts-faker": "^0.1.8", "@stacksjs/ts-validation": "^0.5.6", "dynamodb-tooling": "^0.3.6" }, "bin": { "qb": "./dist/bin/cli.js", "qbx": "./dist/bin/cli.js", "query-builder": "./dist/bin/cli.js" } }, "sha512-MzCmuRel0l9gmnHZBXqBera93jNthVQAnTHjZ5IGOqNyRSAB3Wm/9cGLu9zFPQK4zzkNXFsmP+maNwbenzkXzA=="], @@ -371,7 +371,7 @@ "stacks": ["stacks@0.75.219", "", { "dependencies": { "@stacksjs/actions": "0.75.219", "@stacksjs/ai": "0.75.219", "@stacksjs/alias": "0.75.219", "@stacksjs/analytics": "0.75.219", "@stacksjs/api": "0.75.219", "@stacksjs/arrays": "0.75.219", "@stacksjs/audio": "0.75.219", "@stacksjs/auth": "0.75.219", "@stacksjs/browser": "0.75.219", "@stacksjs/browser-extension": "0.75.219", "@stacksjs/buddy": "0.75.219", "@stacksjs/build": "0.75.219", "@stacksjs/cache": "0.75.219", "@stacksjs/calendar-api": "0.75.219", "@stacksjs/charts": "0.75.219", "@stacksjs/chat": "0.75.219", "@stacksjs/cli": "0.75.219", "@stacksjs/cloud": "0.75.219", "@stacksjs/cms": "0.75.219", "@stacksjs/collections": "0.75.219", "@stacksjs/commerce": "0.75.219", "@stacksjs/composables": "0.75.219", "@stacksjs/config": "0.75.219", "@stacksjs/cron": "0.75.219", "@stacksjs/database": "0.75.219", "@stacksjs/datetime": "0.75.219", "@stacksjs/defaults": "0.75.219", "@stacksjs/desktop": "^0.2.534", "@stacksjs/dns": "0.75.219", "@stacksjs/docs": "0.75.219", "@stacksjs/email": "0.75.219", "@stacksjs/enums": "0.75.219", "@stacksjs/env": "0.75.219", "@stacksjs/error-handling": "0.75.219", "@stacksjs/events": "0.75.219", "@stacksjs/faker": "0.75.219", "@stacksjs/feature-flags": "0.75.219", "@stacksjs/forms": "0.75.219", "@stacksjs/git": "0.75.219", "@stacksjs/github": "0.75.219", "@stacksjs/health": "0.75.219", "@stacksjs/http": "0.75.219", "@stacksjs/i18n": "0.75.219", "@stacksjs/image": "0.75.219", "@stacksjs/lint": "0.75.219", "@stacksjs/logging": "0.75.219", "@stacksjs/mobile": "0.75.219", "@stacksjs/newsletter": "0.75.219", "@stacksjs/notifications": "0.75.219", "@stacksjs/objects": "0.75.219", "@stacksjs/orm": "0.75.219", "@stacksjs/path": "0.75.219", "@stacksjs/payments": "0.75.219", "@stacksjs/push": "0.75.219", "@stacksjs/query-builder": "0.75.219", "@stacksjs/queue": "0.75.219", "@stacksjs/realtime": "0.75.219", "@stacksjs/registry": "0.75.219", "@stacksjs/repl": "0.75.219", "@stacksjs/router": "0.75.219", "@stacksjs/scheduler": "0.75.219", "@stacksjs/search-engine": "0.75.219", "@stacksjs/security": "0.75.219", "@stacksjs/server": "0.75.219", "@stacksjs/shell": "0.75.219", "@stacksjs/sites": "0.75.219", "@stacksjs/skills": "0.75.219", "@stacksjs/slug": "0.75.219", "@stacksjs/sms": "0.75.219", "@stacksjs/socials": "0.75.219", "@stacksjs/storage": "0.75.219", "@stacksjs/strings": "0.75.219", "@stacksjs/testing": "0.75.219", "@stacksjs/tinker": "0.75.219", "@stacksjs/tlsx": "^0.13.19", "@stacksjs/ts-cloud": "^0.16.52", "@stacksjs/tunnel": "0.75.219", "@stacksjs/types": "0.75.219", "@stacksjs/ui": "0.75.219", "@stacksjs/utils": "0.75.219", "@stacksjs/validation": "0.75.219", "@stacksjs/video": "0.75.219", "@stacksjs/whois": "0.75.219", "bun-query-builder": "^0.3.8" } }, "sha512-3NdYXURJ14BDEFiyJEq9UxOXLQYfmMe4zK5cWB8+6XuAurFBPnZyn4xwYpX51ta+v/g+9upfk2pmhRJSAEGX0A=="], - "stx-router": ["stx-router@0.2.563", "", {}, "sha512-po9NOFH13f0sTTrYr8yssQQmuCecH19UZR5hju3U/PR4bGYWfooN3qm/WAkTeRrbp/JfPbcFFEar1dMfNTzqDw=="], + "stx-router": ["stx-router@0.2.566", "", {}, "sha512-pNNKN9jyaAQEuUBfHT1tEbZvdmywTZH/FHevRqwJGtD2JGCokdaq9QKqwRJls1LtGeB825RDLUb1ZvwgiRBnuA=="], "ts-broadcasting": ["ts-broadcasting@0.0.11", "", { "bin": { "broadcast": "./dist/bin/cli.js" } }, "sha512-lqn/VGfW/JiXY8TMtzq4RLu2QlK6Q8oLQg/G9zLBtp5gFoO4dfxihyXPSr/elmGCvV9keC7RbLva6cMSBkhnQg=="], diff --git a/package.json b/package.json index 2396f53f7..f39183ac9 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "@loghq/stacks": "^0.2.6", "@stacksjs/composables": "^0.75.219", "@stacksjs/mobile": "^0.75.219", - "@stacksjs/stx": "^0.2.563", + "@stacksjs/stx": "^0.2.566", "@ts-analytics/tracking": "^0.1.17", "craft-native": "^0.0.237", "stacks": "^0.75.219", From 134cb96bbe1cace199b9d291e579075544fee85d Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 17 Oct 2026 23:28:36 -0700 Subject: [PATCH 11/59] fix(mobile): use native theme colors for forms and map leaders --- resources/native/Events.stx | 2 +- resources/native/ManualActivity.stx | 41 +++++++++++++++-------------- resources/native/Territories.stx | 2 +- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/resources/native/Events.stx b/resources/native/Events.stx index 5413bb343..67f1856ad 100644 --- a/resources/native/Events.stx +++ b/resources/native/Events.stx @@ -161,7 +161,7 @@ onMount(() => onNativeAccountChange(craft, () => { rows.set([]); void load() })) - Finished + Finished diff --git a/resources/native/ManualActivity.stx b/resources/native/ManualActivity.stx index 548da3458..6deff6b97 100644 --- a/resources/native/ManualActivity.stx +++ b/resources/native/ManualActivity.stx @@ -2,6 +2,7 @@ import { nativeApiOrigin } from '../functions/native-api' import type { NativeCraft } from '@stacksjs/stx/native' import { ACTIVITY_VISIBILITIES, buildManualActivity, MANUAL_ACTIVITY_TYPES, todayLocal } from '../functions/manual-activity' +import { nativeUi as ui } from '../functions/native-ui' const craft = (globalThis as typeof globalThis & { craft: NativeCraft }).craft const types = [...MANUAL_ACTIVITY_TYPES] @@ -114,34 +115,34 @@ onDestroy(() => { }) - - - The same manual entry saved by the Wildloop web feed. + + + Add a run, hike, walk, or ride to your log. - Activity + Activity - + - Distance (miles) - - Duration (MM:SS or H:MM:SS) - - Elevation gain (feet) - - Trail id (optional) - - Date - - Notes - + Distance (miles) + + Duration (MM:SS or H:MM:SS) + + Elevation gain (feet) + + Trail id (optional) + + Date + + Notes + - + @@ -154,7 +155,7 @@ onDestroy(() => { - - + diff --git a/resources/native/Territories.stx b/resources/native/Territories.stx index 97ba9f6e9..91cb8e2fb 100644 --- a/resources/native/Territories.stx +++ b/resources/native/Territories.stx @@ -226,7 +226,7 @@ onMount(() => onNativeAccountChange(craft, () => { rows.set([]); void load() })) - + From c8df1e760eb40e4d3e5a6670da4d9d100238a528 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 18 Oct 2026 00:03:43 -0700 Subject: [PATCH 12/59] fix(mobile): distinguish trailhead and elevation map markers --- resources/native/TrailDetail.stx | 4 ++-- resources/native/TrailMap.stx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/native/TrailDetail.stx b/resources/native/TrailDetail.stx index 0447179c0..c554976cc 100644 --- a/resources/native/TrailDetail.stx +++ b/resources/native/TrailDetail.stx @@ -291,8 +291,8 @@ onMount(() => onNativeAccountChange(craft, () => { viewer.set(0); saved.set(fals - - + +