Modern Apps git

← Modern-Apps.git

todo: merge todo-wear into the single todo APK

Commit
7d9df615125c653e47d4baeddcf0ccdae1ea7c93
Author
Vayun Mathur <[email protected]>
When
2026-12-04 18:08 UTC (1 day ago)
Parents
5e09a70
Owner directive: singular apps that detect when they are on a watch
and adapt, instead of a separate *-wear APK per companion. Todo
follows the merged clock pilot.

The merged :todo APK keeps applicationId com.vayunmathur.todo and
the convention signing on both form factors, as the WearLink
handshake requires; neither side's identity changed. Runtime
detection is PackageManager.FEATURE_WATCH (platform/FormFactor):
MainActivity, the sole launcher entry, forwards watches to
ui/WearMainActivity before any phone state (Room, phone conduit
sync, permission gate) is touched, and phones keep the existing
list UI. TodoApplication skips TodoBackground on a watch and the
phone BootReceiver early-returns there. The wear sync is
unchanged: sync/WearTodoSync publishes /todo/catalog and
/todo/page from the phone experience, sync/WearLinkBridge receives
them in the watch experience, over the protocol shared in
:library:wearlink.

Manifest shape, verified against AGP lint: no
android.hardware.type.watch uses-feature is declared, as in the
clock merge. The standalone=false meta-data, WAKE_LOCK, and the
watch activity are carried into the phone application element;
WearMainActivity loses its LAUNCHER filter (exported=false).

All todo-wear sources move into todo's closed package roots
(wear/data -> data, wear/sync -> sync, wear/ui -> ui), R references
retarget to com.vayunmathur.todo.R, and wear strings merge as
res/values/wear_strings.xml (duplicate app_name dropped). The
watch unit-test copy is dropped because :todo already pins the
same golden JSON. Watch screenshot previews become
ui/WearMetadataPreviews with group=wear, so :todo:metadata keeps
rendering them into metadata_data/photos/todo/wear/. The todo-wear
module, its settings include, and its AGENTS.md are deleted. Root
and todo AGENTS.md describe the merged state. Same applicationId
and signing; only a real watch can confirm install and
FEATURE_WATCH routing.

Verified fresh on devvm21958 in the wt-wear-todo worktree:
./gradlew :todo:lint :todo:lintVitalRelease :todo:testDevUnitTest
green, including the new FormFactorTest; the same command was
green on the untouched base commit de47de281 before the change,
so there are no pre-existing failures to attribute.

Diff

AGENTS.md
diff --git a/AGENTS.md b/AGENTS.mdindex 3571af4898..630ea4b7f3 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -49,7 +49,7 @@ Monorepo: ~100 Gradle modules + Rust workspace. Do scoped work only. ### Apps (Gradle key → dir) Reference: `backup/` satisfies every rule; `notes/` second + `intents/` demo. `camera` + `games/voxels` hand-commit screenshots. Full canonical index (Gradle key → dir + group + notes): `.llms/repo-map.md`.-`clock`, `notes`, `calendar` and `launcher` are single merged APKs for phone and watch (watch experience inside the phone app's module; the remaining `*-wear` modules are separate companion APKs with the phone app's applicationId/signing).+`clock`, `notes`, `calendar`, `launcher` and `todo` are single merged APKs for phone and watch (watch experience inside the phone app's module; the remaining `*-wear` modules are separate companion APKs with the phone app's applicationId/signing). `appstore→appstore/` `astronomy→astronomy/` `auto→auto/,auto/protocol/` `backup→backup/` `calculator→calculator/` `calendar→calendar/` `camera→camera/` `cast→cast/,cast/protocol/,cast/tv/` `clock→clock/` `code→code/` `communicate→communicate/` `contacts→contacts/` `education→education/` `email→email/` `emergency→emergency/` `euicc→euicc/` `everysync→everysync/` `files→files/` `findfamily→findfamily/` `findfamily-ios→apple/FindFamily/` (SwiftPM/xtool, not Gradle) `flashcards→flashcards/` `fooddelivery→fooddelivery/` `health→health/` `keyboard→keyboard/` `launcher→launcher/` `logviewer→logviewer/` `maps→maps/` `measure→measure/` `music→music/` `networklocation→networklocation/` `news→news/` `notes→notes/` `office→office/` `openassistant→openassistant/` `passwords→passwords/` `pdf→pdf/` `photos→photos/` `parentalcontrols→parentalcontrols/` `screentime→screentime/` `setupwizard→setupwizard/` `share→share/` `speech→speech/` `taxi→taxi/` `things→things/` `todo→todo/` `translate→translate/` `travel→travel/` `tuner→tuner/` `updater→updater/` `vpn→vpn/` `weather→weather/` `watch→watch/,watch-wear/` `web→web/` `youpipe→youpipe/,youpipe/extractor/` `games-hub→games/hub/` `games-arrows→games/arrows/` `games-chess→games/chess/` `games-logicgate→games/logicgate/` `games-minesweeper→games/minesweeper/` `games-nonogram→games/nonogram/` `games-pipes→games/pipes/` `games-solitaire→games/solitaire/` `games-sudoku→games/sudoku/` `games-unblockjam→games/unblockjam/` `games-voxels→games/voxels/` `games-wordmaker→games/wordmaker/` Slash == colon for Gradle (`games/voxels` == `games:voxels`). 
metadata_data/photos/todo/wear/1.png
diff --git a/metadata_data/photos/todo-wear/wear/1.png b/metadata_data/photos/todo/wear/1.pngsimilarity index 100%rename from metadata_data/photos/todo-wear/wear/1.pngrename to metadata_data/photos/todo/wear/1.png
metadata_data/photos/todo/wear/2.png
diff --git a/metadata_data/photos/todo-wear/wear/2.png b/metadata_data/photos/todo/wear/2.pngsimilarity index 100%rename from metadata_data/photos/todo-wear/wear/2.pngrename to metadata_data/photos/todo/wear/2.png
metadata_data/photos/todo/wear/3.png
diff --git a/metadata_data/photos/todo-wear/wear/3.png b/metadata_data/photos/todo/wear/3.pngsimilarity index 100%rename from metadata_data/photos/todo-wear/wear/3.pngrename to metadata_data/photos/todo/wear/3.png
metadata_data/photos/todo/wear/4.png
diff --git a/metadata_data/photos/todo-wear/wear/4.png b/metadata_data/photos/todo/wear/4.pngsimilarity index 100%rename from metadata_data/photos/todo-wear/wear/4.pngrename to metadata_data/photos/todo/wear/4.png
metadata_data/photos/todo/wear/5.png
diff --git a/metadata_data/photos/todo-wear/wear/5.png b/metadata_data/photos/todo/wear/5.pngsimilarity index 100%rename from metadata_data/photos/todo-wear/wear/5.pngrename to metadata_data/photos/todo/wear/5.png
metadata_data/photos/todo/wear/6.png
diff --git a/metadata_data/photos/todo-wear/wear/6.png b/metadata_data/photos/todo/wear/6.pngsimilarity index 100%rename from metadata_data/photos/todo-wear/wear/6.pngrename to metadata_data/photos/todo/wear/6.png
settings.gradle.kts
diff --git a/settings.gradle.kts b/settings.gradle.ktsindex 8538615b09..ddf128cf2e 100644--- a/settings.gradle.kts+++ b/settings.gradle.kts@@ -138,7 +138,6 @@ include(":sdk:cast") include(":sdk:controller") include(":things") include(":todo")-include(":todo-wear") include(":education") include(":everysync") include(":travel")
todo-wear/AGENTS.md
diff --git a/todo-wear/AGENTS.md b/todo-wear/AGENTS.mddeleted file mode 100644index 195cd25348..0000000000--- a/todo-wear/AGENTS.md+++ /dev/null@@ -1,65 +0,0 @@-# AGENTS.md — todo-wear/ (':todo-wear')--> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside-> `todo-wear/` + `todo/` (the phone side of the same feature).--- Gradle: :todo-wear / dir: todo-wear/ (convention: `common-conventions-wear`)-- Package roots present: ui, data, domain, sync-- Entry file: ui/WearMainActivity.kt--## Why this module exists (read before changing identity)-Wear OS companion of the phone Todo (`:todo`). This module deliberately-uses `applicationId = "com.vayunmathur.todo"` (the phone app's) with the-shared dev/release signing from the convention plugins: WearLink's-handshake token requires the same signing certificate on both sides, so-changing either breaks phone<->watch sync. Bootstrap is a one-time ADB-sideload of this APK onto the watch.--## Navigation mirror (phone Route -> watch WearRoute)-- `Route.TodoList("inbox"|"today"|"upcoming"|"priority"|"all"|"completed")`-  -> `WearRoute.Page` with the same key (smart views, phone drawer order)-- `Route.TodoList("list:<syncId>")` / `("tag:<tag>")` -> `WearRoute.Page`-  with the same key (catalog carries every list/tag from the phone drawer)-- `Route.TodoDetail(id)` -> `WearRoute.TaskDetail(syncId)` (syncId, not the-  phone's Room id, is the cross-device identity)-- Quick-add sheet -> `WearRoute.QuickAdd(pageKey)`; detail edit ->-  `WearRoute.EditTask(syncId)`; delete -> `WearRoute.ConfirmDelete(syncId)`-- `Route.Settings`: NO watch counterpart — settings, sync setup, import/-  export and data management stay on the phone (screen + data-entry cost-  with no watch benefit). Also omitted, deliberately: search, sort,-  manual reorder, bulk selection, list/tag/section editing, recurrence-  and reminder-offset editing, blocked-by/estimates, subtask creation-  (existing subtasks show and can be checked off). These remain fully-  available in the phone detail editor the watch data comes from.--## Protocol-The wire protocol lives in `:library:wearlink` at-`com.vayunmathur.library.wearlink.todo.WearTodoProtocol` (shared by-`:todo` and `:todo-wear`; neither app module depends on the other). Each-side's `WearTodoProtocolTest` pins the same golden JSON against that-shared code.--- Catalog + page snapshots: WearLink data items (`/todo/catalog`,-  `/todo/page`, phone -> watch; paginated, PAGE_SIZE tasks per page)-- Page/sync requests: WearLink messages (`/todo/request-page`,-  `/todo/request-sync`, watch -> phone)-- Watch-originated ops: WearLink message (`/todo/op`: SET_DONE incl.-  repeating-task roll-forward on the phone, SNOOZE_HOUR/SNOOZE_TOMORROW,-  QUICK_ADD parsed by the phone's QuickAddParser, EDIT title/due/priority,-  DELETE with watch-side confirmation)-- Transport: :library:wearlink (RFCOMM, no Play services); app-lifecycle-bound--## Sync semantics (stated, not implied)-- Phone -> watch: bounded catalog (≤100 views) + per-view pages of 20-  tasks, ≤90_000 JSON bytes each. The watch caches catalog and every-  visited page in app-private files and renders them fully offline.-- Watch -> phone: ops apply on the phone only (source of truth). An op-  stays pending (persisted, resent on reconnect) until a refreshed-  catalog/page reflects it; SET_DONE/EDIT/DELETE also overlay the cached-  pages locally so the watch never shows pre-op state as confirmed.--## Verify (this module only)-```-./gradlew :todo-wear:assembleDev-./gradlew :todo-wear:testDebugUnitTest-```
todo-wear/build.gradle.kts
diff --git a/todo-wear/build.gradle.kts b/todo-wear/build.gradle.ktsdeleted file mode 100644index d977521d08..0000000000--- a/todo-wear/build.gradle.kts+++ /dev/null@@ -1,40 +0,0 @@-plugins {-    id("common-conventions-wear")-    id("common-conventions-preview-metadata")-}--launcherIcon {-    symbol = "checklist"-}--// Version shared with the phone app (root version.txt), read directly because-// common-conventions-wear inlines 1/"1.0" until a wear consumer wires the shared reader.-val wearVersionLines = file("../version.txt").readLines()-val wearVersionCode = wearVersionLines[0].trim().toInt()-val wearVersionName = wearVersionLines[1].trim()--android {-    // The WearLink handshake only connects apps that share a package name and-    // signing certificate, so this module MUST ship as the phone app's package:-    // same applicationId (below) and the same signing config the convention-    // plugins already apply to both (debug key for dev, release key for-    // release). The namespace only names this module's own R/resources.-    namespace = "com.vayunmathur.todo.wear"-    defaultConfig {-        applicationId = "com.vayunmathur.todo"-        // Convention defaults to 30, but :library:log (pulled in by the wear-        // convention) requires 31, so the watch floor is 31.-        minSdk = 31-        versionCode = wearVersionCode-        versionName = wearVersionName-    }-}--dependencies {-    // Watch side of the Wear OS sync (see domain/WearTodoProtocol.kt, the-    // copy of the phone protocol it must stay in step with).-    implementation(libs.kotlinx.coroutines.android)-    implementation(project(":library:wearlink"))-    testImplementation(libs.kotlin.test)-    testImplementation(libs.kotlin.test.junit)-}
todo-wear/src/main/AndroidManifest.xml
diff --git a/todo-wear/src/main/AndroidManifest.xml b/todo-wear/src/main/AndroidManifest.xmldeleted file mode 100644index 7ccb8c3001..0000000000--- a/todo-wear/src/main/AndroidManifest.xml+++ /dev/null@@ -1,40 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<manifest xmlns:android="http://schemas.android.com/apk/res/android">--    <!-- Wear OS form factor. Declaring the watch hardware makes this build-         installable on Wear OS; the touchscreen is not required there. -->-    <uses-feature-        android:name="android.hardware.type.watch"-        android:required="true" />-    <uses-feature-        android:name="android.hardware.touchscreen"-        android:required="false" />--    <uses-permission android:name="android.permission.WAKE_LOCK" />--    <application-        android:allowBackup="false"-        android:icon="@mipmap/ic_launcher"-        android:label="@string/app_name"-        android:roundIcon="@mipmap/ic_launcher"-        android:supportsRtl="true"-        android:theme="@android:style/Theme.Material.NoActionBar">--        <!-- Paired with the phone app, not a standalone watch app. -->-        <meta-data-            android:name="com.google.android.wearable.standalone"-            android:value="false" />--        <activity-            android:name=".ui.WearMainActivity"-            android:exported="true"-            android:taskAffinity="">-            <intent-filter>-                <action android:name="android.intent.action.MAIN" />-                <category android:name="android.intent.category.LAUNCHER" />-            </intent-filter>-        </activity>--        <!-- WearLink delivery is app-lifecycle-bound; no system listener service. -->-    </application>-</manifest>
todo-wear/src/main/res/values/colors.xml
diff --git a/todo-wear/src/main/res/values/colors.xml b/todo-wear/src/main/res/values/colors.xmldeleted file mode 100644index bfc7025d71..0000000000--- a/todo-wear/src/main/res/values/colors.xml+++ /dev/null@@ -1,5 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<!-- Background for the generated adaptive launcher icon (see LauncherIconGen). -->-<resources>-    <color name="ic_launcher_background">#FFFFFF</color>-</resources>
todo-wear/src/test/java/com/vayunmathur/todo/wear/domain/WearTodoProtocolTest.kt
diff --git a/todo-wear/src/test/java/com/vayunmathur/todo/wear/domain/WearTodoProtocolTest.kt b/todo-wear/src/test/java/com/vayunmathur/todo/wear/domain/WearTodoProtocolTest.ktdeleted file mode 100644index 294ee2842c..0000000000--- a/todo-wear/src/test/java/com/vayunmathur/todo/wear/domain/WearTodoProtocolTest.kt+++ /dev/null@@ -1,227 +0,0 @@-package com.vayunmathur.todo.wear.domain--import com.vayunmathur.library.wearlink.todo.WearTodoCatalog-import com.vayunmathur.library.wearlink.todo.WearTodoOp-import com.vayunmathur.library.wearlink.todo.WearTodoOpKind-import com.vayunmathur.library.wearlink.todo.WearTodoPage-import com.vayunmathur.library.wearlink.todo.WearTodoProtocol-import com.vayunmathur.library.wearlink.todo.WearTodoTask-import com.vayunmathur.library.wearlink.todo.WearTodoViewEntry-import com.vayunmathur.library.wearlink.todo.buildWearPage-import com.vayunmathur.library.wearlink.todo.overlayPendingTasks-import com.vayunmathur.library.wearlink.todo.pendingOpsNotReflectedBy-import kotlinx.serialization.encodeToString-import kotlin.test.Test-import kotlin.test.assertEquals-import kotlin.test.assertFalse-import kotlin.test.assertTrue--class WearTodoProtocolTest {--    private fun task(id: String, title: String = "Task $id") =-        WearTodoTask(syncId = id, title = title)--    @Test-    fun goldenCatalogJson() {-        val catalog = WearTodoCatalog(-            generatedAtMillis = 1_000L,-            views = listOf(WearTodoViewEntry("today", "Today", "SMART", 2, 3)),-            defaultViewKey = "today",-        )-        assertEquals(-            """{"generatedAtMillis":1000,"views":[{"key":"today","title":"Today",""" +-                """"openCount":2,"totalCount":3}]}""",-            WearTodoProtocol.json.encodeToString(catalog),-        )-    }--    @Test-    fun goldenPageJson() {-        val page = WearTodoPage(-            pageKey = "today",-            title = "Today",-            generatedAtMillis = 1_000L,-            totalCount = 1,-            tasks = listOf(task("a", "Buy milk")),-        )-        assertEquals(-            """{"pageKey":"today","title":"Today","generatedAtMillis":1000,""" +-                """"totalCount":1,"tasks":[{"syncId":"a","title":"Buy milk"}]}""",-            WearTodoProtocol.json.encodeToString(page),-        )-    }--    @Test-    fun goldenOpJson() {-        val edit = WearTodoOp(-            WearTodoOpKind.EDIT, opId = "o1", syncId = "a", title = "New", priority = 2,-        )-        assertEquals(-            """{"kind":"EDIT","opId":"o1","syncId":"a","title":"New","priority":2}""",-            WearTodoProtocol.json.encodeToString(edit),-        )-        val quickAdd = WearTodoOp(-            WearTodoOpKind.QUICK_ADD, opId = "o2", syncId = "n1",-            text = "Buy milk tomorrow", pageKey = "today",-        )-        assertEquals(-            """{"kind":"QUICK_ADD","opId":"o2","syncId":"n1",""" +-                """"text":"Buy milk tomorrow","pageKey":"today"}""",-            WearTodoProtocol.json.encodeToString(quickAdd),-        )-    }--    @Test-    fun pageSlicesByOffsetWithHasMore() {-        val all = (1..45).map { task("t$it") }-        val first = buildWearPage("all", "All", all, offset = 0, generatedAtMillis = 5L)-        assertEquals(WearTodoProtocol.PAGE_SIZE, first.tasks.size)-        assertTrue(first.hasMore)-        assertEquals(20, first.nextOffset)-        val last = buildWearPage("all", "All", all, offset = 40, generatedAtMillis = 5L)-        assertEquals(5, last.tasks.size)-        assertFalse(last.hasMore)-        assertEquals(45, last.totalCount)-        // Offsets past the end clamp to an empty terminal page.-        val past = buildWearPage("all", "All", all, offset = 99, generatedAtMillis = 5L)-        assertEquals(45, past.offset)-        assertTrue(past.tasks.isEmpty())-    }--    @Test-    fun pageCapsFieldsAndBytes() {-        val all = (1..30).map {-            task("t$it", "x".repeat(300)).copy(notes = "n".repeat(2_000))-        }-        val page = buildWearPage("all", "All", all, offset = 0, generatedAtMillis = 0L)-        assertTrue(-            page.tasks.all {-                it.title.length == WearTodoProtocol.MAX_TITLE_CHARS &&-                    it.notes.length == WearTodoProtocol.MAX_NOTES_CHARS && it.notesTruncated-            },-        )-        val bytes = WearTodoProtocol.json.encodeToString(page).encodeToByteArray().size-        assertTrue(bytes <= WearTodoProtocol.MAX_JSON_BYTES, "page $bytes bytes over cap")-    }--    @Test-    fun quickAddDroppedOncePageCarriesTheCreatedTask() {-        // Regression: QUICK_ADD fell into the keep-forever branch, so a-        // reflected quick-add stayed pending and was resent on every-        // reconnect (WearLinkBridge.flushPending) for the same opId/syncId.-        val quickAdd = WearTodoOp(-            WearTodoOpKind.QUICK_ADD, opId = "o2", syncId = "n1",-            text = "Buy milk tomorrow", pageKey = "today",-        )-        val reflectedPage = WearTodoPage(-            pageKey = "today", generatedAtMillis = 2_000L,-            tasks = listOf(task("n1", "Buy milk tomorrow")),-        )-        assertEquals(emptyList(), pendingOpsNotReflectedBy(listOf(quickAdd), reflectedPage))-    }--    @Test-    fun quickAddKeptWhilePageDoesNotCarryTheCreatedTask() {-        val quickAdd = WearTodoOp(-            WearTodoOpKind.QUICK_ADD, opId = "o2", syncId = "n1",-            text = "Buy milk tomorrow", pageKey = "today",-        )-        val otherPage = WearTodoPage(-            pageKey = "today", generatedAtMillis = 2_000L,-            tasks = listOf(task("a")),-        )-        assertEquals(listOf(quickAdd), pendingOpsNotReflectedBy(listOf(quickAdd), otherPage))-    }--    @Test-    fun reflectedPageKeepsExistingDoneEditDeleteAndSnoozeSemantics() {-        val setDone = WearTodoOp(WearTodoOpKind.SET_DONE, syncId = "a", done = true)-        val edit = WearTodoOp(WearTodoOpKind.EDIT, syncId = "b", title = "Edited")-        val delete = WearTodoOp(WearTodoOpKind.DELETE, syncId = "c")-        val snooze = WearTodoOp(WearTodoOpKind.SNOOZE_HOUR, syncId = "a")-        val page = WearTodoPage(-            pageKey = "today", generatedAtMillis = 2_000L,-            tasks = listOf(task("a"), task("b")),-        )-        // a/b present -> done/edit reflected; c absent -> delete reflected;-        // snooze has no page-visible proof, so it stays queued.-        assertEquals(-            listOf(snooze),-            pendingOpsNotReflectedBy(listOf(setDone, edit, delete, snooze), page),-        )-    }--    @Test-    fun goldenTruncatedPageJson() {-        val page = WearTodoPage(-            pageKey = "today",-            title = "Today",-            generatedAtMillis = 1_000L,-            totalCount = 1,-            tasks = listOf(task("a", "Buy milk")),-            truncated = true,-        )-        assertEquals(-            """{"pageKey":"today","title":"Today","generatedAtMillis":1000,""" +-                """"totalCount":1,"tasks":[{"syncId":"a","title":"Buy milk"}],"truncated":true}""",-            WearTodoProtocol.json.encodeToString(page),-        )-    }--    @Test-    fun goldenWatchStateJson() {-        val state = com.vayunmathur.library.wearlink.todo.WearTodoWatchState(-            appliedCatalogAtMillis = 1_000L,-            cachedPages = 2,-            pendingOps = 3,-        )-        assertEquals(-            """{"appliedCatalogAtMillis":1000,"cachedPages":2,"pendingOps":3}""",-            WearTodoProtocol.json.encodeToString(state),-        )-    }--    @Test-    fun truncatedPageDoesNotProveDeleteReflected() {-        val setDone = WearTodoOp(WearTodoOpKind.SET_DONE, syncId = "a", done = true)-        val delete = WearTodoOp(WearTodoOpKind.DELETE, syncId = "c")-        val quickAdd = WearTodoOp(-            WearTodoOpKind.QUICK_ADD, opId = "o2", syncId = "n1",-            text = "Buy milk tomorrow", pageKey = "today",-        )-        val page = WearTodoPage(-            pageKey = "today", generatedAtMillis = 2_000L,-            tasks = listOf(task("a")),-            truncated = true,-        )-        // Presence is positive proof (setDone drops), but absence on a-        // truncated page proves nothing: delete and quick-add stay queued.-        assertEquals(-            listOf(delete, quickAdd),-            pendingOpsNotReflectedBy(listOf(setDone, delete, quickAdd), page),-        )-    }--    @Test-    fun overlayAppliesDoneEditAndDeleteButNotSnoozeOrQuickAdd() {-        val tasks = listOf(task("a"), task("b"), task("c"))-        val overlaid = overlayPendingTasks(-            tasks,-            listOf(-                WearTodoOp(WearTodoOpKind.SET_DONE, syncId = "a", done = true),-                WearTodoOp(-                    WearTodoOpKind.EDIT, syncId = "b", title = "Edited", priority = 1,-                ),-                WearTodoOp(WearTodoOpKind.DELETE, syncId = "c"),-                WearTodoOp(WearTodoOpKind.SNOOZE_HOUR, syncId = "a"),-                WearTodoOp(-                    WearTodoOpKind.QUICK_ADD, syncId = "n1", text = "New", pageKey = "all",-                ),-            ),-        )-        assertEquals(listOf("a", "b"), overlaid.map { it.syncId })-        assertTrue(overlaid[0].done)-        assertEquals("Edited", overlaid[1].title)-        assertEquals(1, overlaid[1].priority)-    }-}
todo/AGENTS.md
diff --git a/todo/AGENTS.md b/todo/AGENTS.mdindex 3f9d9eb27e..5978c65cba 100644--- a/todo/AGENTS.md+++ b/todo/AGENTS.md@@ -5,9 +5,9 @@ _Install: ./install todo (dev by default)._ - Gradle: :todo / dir: todo/ - Package roots present: ui, data, domain, platform, sync, notifications, widget, service, intents-- Entry files: MainActivity.kt, Route.kt, Navigation.kt, TodoApplication.kt+- Entry files: MainActivity.kt (sole launcher; routes watches to WearMainActivity), Route.kt, Navigation.kt, TodoApplication.kt, ui/WearMainActivity.kt - Dialog routes: `Route` dialog destinations (list edit/delete, todo delete/move, bulk move/date, import confirm, digest time) are `DialogPage()` entries in Navigation.kt rendering stateless content from `ui/dialogs/`; sheet-nested pickers and the quick-add paste confirm remain local (see DIALOG LOCAL EXCEPTION markers in those files)-- Deps: :library:room, :library:widgets, :library:wearlink+- Deps: :library:room, :library:widgets, :library:wearlink, :library:log, Wear Compose (material + foundation) - Metadata: metadata_data/todo.md (present) - Rust: no / screenshotTest: yes @@ -15,6 +15,34 @@ _Install: ./install todo (dev by default)._ **Purpose:** Offline task manager: lists, smart views, subtasks, priorities, timed due dates, repeats, reminders, natural-language quick add, widgets, calendar mirror, import/export, and E2EE sync via EverySync. **Architecture / data-flow:** `ui/` (stateless `*Screen` + binding `*Page`) → `platform/TodoViewModel` / `platform/TodoEditor` → `data/TodoRepository` over Room (`Todo`, `TodoList`, `SyncSnapshot`). Pure logic lives in `domain/` (no Android): `TodoQuery` (views/sort/groups), `QuickAddParser`, `Recurrence`, `Completion`, `Positions`, `DueDates`, `format/` (todo.txt, CSV, VTODO). `platform/TodoBackground` (started by `TodoApplication`) reacts to any data change: reminder alarms, digest, per-list channels, widgets, calendar mirror. **Entry points + reading order:** `Route` → `Navigation.kt` → `ui/TodoShell` → `ui/TodoListPage` → `platform/TodoViewModel` → `domain/TodoQuery` → `data/TodoRepository` → `sync/RelayTodoProvider`.++## One APK, two form factors (phone + watch)+This module is the single Todo APK for phones and watches: same+`applicationId = "com.vayunmathur.todo"` and signing on both, as the+WearLink handshake requires. The manifest deliberately declares no+`android.hardware.type.watch` feature (required=true would block+phones; required=false is disallowed for this feature), plus+touchscreen not-required and+`com.google.android.wearable.standalone=false`; distribution is+sideload/F-Droid, not Play's watch channel, so the APK installs on+phones and watches alike. `platform/FormFactor.kt`+reads `PackageManager.FEATURE_WATCH` at runtime: `MainActivity` (the+sole launcher entry) forwards watches to `ui/WearMainActivity` before+any phone state loads; phones get the list UI. Phone-only work gates+on the same signal: `TodoApplication` skips `TodoBackground` on a+watch, and `notifications/BootReceiver` early-returns there.++## Wear sync (Watch conduit client)+**Protocol:** shared wire types live in `:library:wearlink` at `com.vayunmathur.library.wearlink.todo.WearTodoProtocol`; the golden-JSON tests in this module pin the shared code's wire format.+- Catalog + page snapshots: WearLink data items (`/todo/catalog`, `/todo/page`, phone -> watch; paginated, PAGE_SIZE tasks per page)+- Page/sync requests: WearLink messages (`/todo/request-page`, `/todo/request-sync`, watch -> phone)+- Watch-originated ops: WearLink message (`/todo/op`: SET_DONE incl. repeating-task roll-forward on the phone, SNOOZE_HOUR/SNOOZE_TOMORROW, QUICK_ADD parsed by the phone's QuickAddParser, EDIT title/due/priority, DELETE with watch-side confirmation)+- Transport: :library:wearlink (RFCOMM, no Play services); app-lifecycle-bound. Phone side is `sync/WearTodoSync.kt`; watch side is `sync/WearLinkBridge.kt`.++## Watch experience (in this module)+- `ui/WearMainActivity` (a `WearShellActivity`) routes `ui/WearRoute` over home (the phone drawer's view index) / task pages / task detail / quick-add / edit / delete-confirm, mirroring the phone `Route` (detail routes carry the task syncId, the cross-device identity). Settings, search, sort, manual reorder, bulk selection, list/tag/section editing, recurrence and reminder-offset editing, blocked-by/estimates, and subtask creation stay on the phone; existing subtasks show and can be checked off.+- Watch state persists in `data/WearTodoStore` (catalog, visited pages, and pending watch-originated ops as JSON in app-private files); the watch renders fully offline and an op leaves the pending queue only when a refreshed catalog/page reflects it.+- Watch listing screenshots are the `group = "wear"` previews in `src/screenshotTest/.../ui/WearMetadataPreviews.kt`, collected by `:todo:metadata` into `metadata_data/photos/todo/wear/`; phone shots use the `phone` bucket. **Gotchas:** - Relay envelopes (`sync/RelayEnvelopes.kt`) mirror everysync's `RemoteTodo` / `RemoteTodoList` field-for-field. Never rename a key; new fields need defaults (encodeDefaults is off, so hashes of existing envelopes stay identical). Update both sides together. - Lists sync on their own `todolists:<vault>` channel so pre-list builds never see them as tasks.@@ -36,7 +64,12 @@ _Install: ./install todo (dev by default)._ ### ui/dialogs/ - ListPickerDialog.kt, ListSectionPickerDialog.kt, ListEditDialog.kt, TodoDatePickerDialog.kt, TodoTimePickerDialog.kt, DeleteTodoDialog.kt, DeleteListDialog.kt, ImportConfirmDialog.kt (stateless dialog content for the dialog routes) ### sync/-- RelayTodoProvider.kt, RelayEnvelopes.kt, CalendarMirror.kt, WearTodoSync.kt (phone side of the wear companion; wire protocol `com.vayunmathur.library.wearlink.todo.WearTodoProtocol` in `:library:wearlink`, shared with `:todo-wear`)+- RelayTodoProvider.kt, RelayEnvelopes.kt, CalendarMirror.kt, WearTodoSync.kt (phone side of the wear sync; wire protocol `com.vayunmathur.library.wearlink.todo.WearTodoProtocol` in `:library:wearlink`), WearLinkBridge.kt (watch side of the same sync)+### Watch experience (ui/ + data/)+- ui/WearMainActivity.kt — watch entry (WearShellActivity)+- ui/WearRoute.kt, WearTodoHomeScreen.kt, WearTodoPageScreen.kt, WearTodoTaskScreen.kt, WearTodoQuickAddScreen.kt, WearTodoEditScreen.kt, WearTodoConfirmDeleteScreen.kt+- data/WearTodoStore.kt — watch cache (catalog, pages, pending ops)+- platform/FormFactor.kt — watch detection (`FEATURE_WATCH`) ### notifications/ widget/ service/ intents/ - ReminderScheduler, ReminderReceiver, ReminderActionReceiver, BootReceiver, DigestScheduler; TodayWidget, QuickAddWidget; QuickAddTileService; Get/Insert/CompleteTodoIntent (openassistant tools) 
todo/build.gradle.kts
diff --git a/todo/build.gradle.kts b/todo/build.gradle.ktsindex a530e2379d..1053e9fbfa 100644--- a/todo/build.gradle.kts+++ b/todo/build.gradle.kts@@ -24,10 +24,16 @@ dependencies {     implementRoom(libs)     implementation(project(":library:room"))     implementation(project(":library:widgets"))-    // Phone side of the Wear OS sync (sync/WearTodoSync): catalog/page-    // publish and watch-originated ops to :todo-wear, which shares this-    // app's applicationId and signing certificate.+    // Both sides of the Wear OS sync live in this one APK (same+    // applicationId and signing, as the WearLink handshake requires):+    // sync/WearTodoSync publishes the phone catalog/pages, sync/WearLinkBridge+    // receives them on a watch. FormFactor picks the side at runtime.     implementation(project(":library:wearlink"))+    // Watch experience (ui/Wear*): Wear Compose + the repo log facade the+    // watch data/sync code writes through.+    implementation(libs.androidx.wear.compose.material)+    implementation(libs.androidx.wear.compose.foundation)+    implementation(project(":library:log"))     implementation(libs.kotlinx.coroutines.android)     testImplementation(libs.androidx.sqlite.bundled.jvm) }
todo/src/main/AndroidManifest.xml
diff --git a/todo/src/main/AndroidManifest.xml b/todo/src/main/AndroidManifest.xmlindex 25f7d1dc28..dd03cb3bdc 100644--- a/todo/src/main/AndroidManifest.xml+++ b/todo/src/main/AndroidManifest.xml@@ -9,6 +9,23 @@     <!-- Sensors permission at install instead of auto-granting it. -->     <uses-permission android:name="com.vayunmathur.permission.SENSORS_OPTOUT" /> +    <!-- Single APK for phone and watch. Deliberately NO+         android.hardware.type.watch uses-feature here: required="true"+         would block every phone install, and required="false" is+         disallowed for this feature (lint InvalidWearFeatureAttribute;+         Google's packaging model does not support one APK for Wear and+         non-Wear via Play). This app does not distribute through Play's+         watch channel — it is sideloaded / F-Droid-installed, where no+         feature declaration is needed to install on a watch — so the+         APK carries no watch feature filter at all and+         FormFactor.isWatch (PackageManager.FEATURE_WATCH, still+         reported by watch hardware at runtime) routes the experience. -->+    <uses-feature+        android:name="android.hardware.touchscreen"+        android:required="false" />+    <!-- Watch-local sync wakes the watch CPU when the link connects. -->+    <uses-permission android:name="android.permission.WAKE_LOCK" />+     <uses-permission android:name="android.permission.USE_EXACT_ALARM" />     <uses-permission         android:name="android.permission.SCHEDULE_EXACT_ALARM"@@ -51,6 +68,10 @@         android:roundIcon="@mipmap/ic_launcher"         android:supportsRtl="true"         android:theme="@style/Theme.General">+        <!-- Watch experience is paired with the phone app, not standalone. -->+        <meta-data+            android:name="com.google.android.wearable.standalone"+            android:value="false" />         <activity             android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"             android:name=".MainActivity"@@ -134,6 +155,15 @@             android:readPermission="com.vayunmathur.todo.permission.RELAY"             android:writePermission="com.vayunmathur.todo.permission.RELAY" /> +        <!-- Watch experience: entered only via MainActivity's watch routing+             (no launcher filter of its own). Inert on a phone: it is reached+             only on a watch, where WearTodoStore/WearLinkBridge run. -->+        <activity+            android:name=".ui.WearMainActivity"+            android:exported="false"+            android:taskAffinity=""+            android:theme="@android:style/Theme.Material.NoActionBar" />+         <receiver             android:name=".notifications.ReminderReceiver"             android:exported="false" />
todo/src/main/java/com/vayunmathur/todo/MainActivity.kt
diff --git a/todo/src/main/java/com/vayunmathur/todo/MainActivity.kt b/todo/src/main/java/com/vayunmathur/todo/MainActivity.ktindex 859f049b7c..e6a095a19e 100644--- a/todo/src/main/java/com/vayunmathur/todo/MainActivity.kt+++ b/todo/src/main/java/com/vayunmathur/todo/MainActivity.kt@@ -1,25 +1,46 @@ package com.vayunmathur.todo  import android.content.Intent+import android.os.Bundle import androidx.activity.viewModels import androidx.compose.runtime.Composable import com.vayunmathur.library.ui.MaActivity import com.vayunmathur.todo.data.TodoRepository import com.vayunmathur.todo.data.TodoSettings+import com.vayunmathur.todo.platform.FormFactor import com.vayunmathur.todo.platform.IntentRouter import com.vayunmathur.todo.platform.TodoViewModel+import com.vayunmathur.todo.ui.WearMainActivity  /**- * Entry activity: builds the repository and view model, forwards intents to IntentRouter, and hosts the- * navigation graph.+ * Sole launcher entry of the single merged Todo APK. On a watch (the+ * `android.hardware.type.watch` system feature, see [FormFactor]) it hands+ * off to [WearMainActivity] and finishes before any phone state (Room,+ * phone sync, permission request) is touched; on a phone it builds the+ * repository and view model, forwards intents to IntentRouter, and hosts+ * the navigation graph.  */ class MainActivity : MaActivity() {++    /** True on a watch, where this activity only forwards to [WearMainActivity]. */+    private var routedToWear = false++    override fun onCreate(savedInstanceState: Bundle?) {+        routedToWear = FormFactor.isWatch(this)+        super.onCreate(savedInstanceState)+        if (routedToWear) {+            startActivity(Intent(this, WearMainActivity::class.java))+            finish()+        }+    }+     private lateinit var todoRepository: TodoRepository     private val todoViewModel: TodoViewModel by viewModels {         TodoViewModel.factory(application, todoRepository, TodoSettings(applicationContext))     }      override fun onCreateBeforeContent() {+        if (routedToWear) return         com.vayunmathur.library.wearlink.WearLinkPermissions.requestIfNeeded(this)         todoRepository = TodoRepository.get(applicationContext)         // Wear companion lives and dies with this process (WearLink has no@@ -35,6 +56,9 @@ class MainActivity : MaActivity() {      @Composable     override fun Content() {+        // On a watch this activity is finishing towards WearMainActivity;+        // compose nothing (and touch no phone state) in the meantime.+        if (routedToWear) return         Navigation(todoViewModel)     } }
todo/src/main/java/com/vayunmathur/todo/TodoApplication.kt
diff --git a/todo/src/main/java/com/vayunmathur/todo/TodoApplication.kt b/todo/src/main/java/com/vayunmathur/todo/TodoApplication.ktindex b273b37b6c..0f7f467eff 100644--- a/todo/src/main/java/com/vayunmathur/todo/TodoApplication.kt+++ b/todo/src/main/java/com/vayunmathur/todo/TodoApplication.kt@@ -1,12 +1,17 @@ package com.vayunmathur.todo  import android.app.Application+import com.vayunmathur.todo.platform.FormFactor import com.vayunmathur.todo.platform.TodoBackground  /** Application entry point: starts background work for reminders, widgets and the calendar mirror. */ class TodoApplication : Application() {     override fun onCreate() {         super.onCreate()+        // Phone experience only: on a watch the wear store/bridge own the+        // process (started from WearMainActivity); no Room, alarms, widgets+        // or calendar mirror run there.+        if (FormFactor.isWatch(this)) return         TodoBackground.start(this)     } }
todo/src/main/java/com/vayunmathur/todo/data/WearTodoStore.kt
diff --git a/todo-wear/src/main/java/com/vayunmathur/todo/wear/data/WearTodoStore.kt b/todo/src/main/java/com/vayunmathur/todo/data/WearTodoStore.ktsimilarity index 95%rename from todo-wear/src/main/java/com/vayunmathur/todo/wear/data/WearTodoStore.ktrename to todo/src/main/java/com/vayunmathur/todo/data/WearTodoStore.ktindex 273d801e79..0860ea705e 100644--- a/todo-wear/src/main/java/com/vayunmathur/todo/wear/data/WearTodoStore.kt+++ b/todo/src/main/java/com/vayunmathur/todo/data/WearTodoStore.kt@@ -1,4 +1,4 @@-package com.vayunmathur.todo.wear.data+package com.vayunmathur.todo.data  import android.content.Context import com.vayunmathur.library.log.Log@@ -65,7 +65,7 @@ class WearTodoStore private constructor(private val context: Context) {         if (catalog.generatedAtMillis < _catalog.value.generatedAtMillis) return         _catalog.value = catalog         persist(catalogFile, WearTodoProtocol.json.encodeToString(catalog))-        com.vayunmathur.todo.wear.sync.WearLinkBridge.publishWatchState(context)+        com.vayunmathur.todo.sync.WearLinkBridge.publishWatchState(context)     }      fun setPage(page: WearTodoPage) {@@ -75,7 +75,7 @@ class WearTodoStore private constructor(private val context: Context) {         _pages.value = _pages.value + (key to page)         persist(pagesFile, WearTodoProtocol.json.encodeToString(_pages.value))         dropReflected(page)-        com.vayunmathur.todo.wear.sync.WearLinkBridge.publishWatchState(context)+        com.vayunmathur.todo.sync.WearLinkBridge.publishWatchState(context)     }      /** All cached slices of one view, in offset order (for offline paging). */@@ -128,7 +128,7 @@ class WearTodoStore private constructor(private val context: Context) {             op.kind == WearTodoOpKind.QUICK_ADD || it.kind != op.kind || it.syncId != op.syncId         } + op         persist(pendingFile, WearTodoProtocol.json.encodeToString(_pendingOps.value))-        com.vayunmathur.todo.wear.sync.WearLinkBridge.flushPending(context)+        com.vayunmathur.todo.sync.WearLinkBridge.flushPending(context)     }      private fun dropReflected(page: WearTodoPage) {
todo/src/main/java/com/vayunmathur/todo/notifications/BootReceiver.kt
diff --git a/todo/src/main/java/com/vayunmathur/todo/notifications/BootReceiver.kt b/todo/src/main/java/com/vayunmathur/todo/notifications/BootReceiver.ktindex 1335d00308..5f4c3fd073 100644--- a/todo/src/main/java/com/vayunmathur/todo/notifications/BootReceiver.kt+++ b/todo/src/main/java/com/vayunmathur/todo/notifications/BootReceiver.kt@@ -4,6 +4,7 @@ import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import com.vayunmathur.todo.data.TodoRepository+import com.vayunmathur.todo.platform.FormFactor import com.vayunmathur.todo.platform.TodoBackground import kotlinx.coroutines.launch @@ -13,6 +14,8 @@ import kotlinx.coroutines.launch  */ class BootReceiver : BroadcastReceiver() {     override fun onReceive(context: Context, intent: Intent) {+        // Phone experience only: on a watch no reminder alarms exist to re-arm.+        if (FormFactor.isWatch(context)) return         if (intent.action !in HANDLED) return         val app = context.applicationContext         val pending = goAsync()
todo/src/main/java/com/vayunmathur/todo/platform/FormFactor.kt
diff --git a/todo/src/main/java/com/vayunmathur/todo/platform/FormFactor.kt b/todo/src/main/java/com/vayunmathur/todo/platform/FormFactor.ktnew file mode 100644index 0000000000..e298086eba--- /dev/null+++ b/todo/src/main/java/com/vayunmathur/todo/platform/FormFactor.kt@@ -0,0 +1,25 @@+package com.vayunmathur.todo.platform++import android.content.Context+import android.content.pm.PackageManager++/**+ * Runtime form-factor detection for the single merged Todo APK.+ *+ * One APK ships to phones and watches (same applicationId and signing, as+ * the WearLink handshake requires). [PackageManager.FEATURE_WATCH] is the+ * canonical signal: Wear OS devices report the `android.hardware.type.watch`+ * system feature, phones and tablets do not. The manifest deliberately+ * declares no such uses-feature (required=true would block phones,+ * required=false is disallowed for this feature), so the same APK+ * installs on both; this runtime check is what routes the experience.+ */+object FormFactor {++    /** True when this device reports the watch system feature. */+    fun isWatch(context: Context): Boolean =+        isWatch(context.packageManager.hasSystemFeature(PackageManager.FEATURE_WATCH))++    /** Pure core of [isWatch], split out so unit tests need no Android runtime. */+    fun isWatch(hasWatchSystemFeature: Boolean): Boolean = hasWatchSystemFeature+}
todo/src/main/java/com/vayunmathur/todo/sync/WearLinkBridge.kt
diff --git a/todo-wear/src/main/java/com/vayunmathur/todo/wear/sync/WearLinkBridge.kt b/todo/src/main/java/com/vayunmathur/todo/sync/WearLinkBridge.ktsimilarity index 98%rename from todo-wear/src/main/java/com/vayunmathur/todo/wear/sync/WearLinkBridge.ktrename to todo/src/main/java/com/vayunmathur/todo/sync/WearLinkBridge.ktindex f234ec8668..d8988b8bf0 100644--- a/todo-wear/src/main/java/com/vayunmathur/todo/wear/sync/WearLinkBridge.kt+++ b/todo/src/main/java/com/vayunmathur/todo/sync/WearLinkBridge.kt@@ -1,4 +1,4 @@-package com.vayunmathur.todo.wear.sync+package com.vayunmathur.todo.sync  import android.content.Context import com.vayunmathur.library.log.Log@@ -10,7 +10,7 @@ import com.vayunmathur.library.wearlink.todo.WearTodoPage import com.vayunmathur.library.wearlink.todo.WearTodoPageRequest import com.vayunmathur.library.wearlink.todo.WearTodoProtocol import com.vayunmathur.library.wearlink.todo.WearTodoWatchState-import com.vayunmathur.todo.wear.data.WearTodoStore+import com.vayunmathur.todo.data.WearTodoStore import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob
todo/src/main/java/com/vayunmathur/todo/ui/WearMainActivity.kt
diff --git a/todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearMainActivity.kt b/todo/src/main/java/com/vayunmathur/todo/ui/WearMainActivity.ktsimilarity index 95%rename from todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearMainActivity.ktrename to todo/src/main/java/com/vayunmathur/todo/ui/WearMainActivity.ktindex 63fa846eb5..edf61ddb56 100644--- a/todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearMainActivity.kt+++ b/todo/src/main/java/com/vayunmathur/todo/ui/WearMainActivity.kt@@ -1,9 +1,9 @@-package com.vayunmathur.todo.wear.ui+package com.vayunmathur.todo.ui  import androidx.compose.runtime.Composable import com.vayunmathur.library.wearlink.WearShellActivity-import com.vayunmathur.todo.wear.data.WearTodoStore-import com.vayunmathur.todo.wear.sync.WearLinkBridge+import com.vayunmathur.todo.data.WearTodoStore+import com.vayunmathur.todo.sync.WearLinkBridge  /**  * Watch todo entry: the phone app's navigation (view index -> task pages ->
todo/src/main/java/com/vayunmathur/todo/ui/WearRoute.kt
diff --git a/todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearRoute.kt b/todo/src/main/java/com/vayunmathur/todo/ui/WearRoute.ktsimilarity index 96%rename from todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearRoute.ktrename to todo/src/main/java/com/vayunmathur/todo/ui/WearRoute.ktindex 78e1023c07..780cc2a598 100644--- a/todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearRoute.kt+++ b/todo/src/main/java/com/vayunmathur/todo/ui/WearRoute.kt@@ -1,4 +1,4 @@-package com.vayunmathur.todo.wear.ui+package com.vayunmathur.todo.ui  /**  * Watch navigation destinations mirroring the phone's `Route`: page routes
todo/src/main/java/com/vayunmathur/todo/ui/WearTodoConfirmDeleteScreen.kt
diff --git a/todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearTodoConfirmDeleteScreen.kt b/todo/src/main/java/com/vayunmathur/todo/ui/WearTodoConfirmDeleteScreen.ktsimilarity index 94%rename from todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearTodoConfirmDeleteScreen.ktrename to todo/src/main/java/com/vayunmathur/todo/ui/WearTodoConfirmDeleteScreen.ktindex 555908aa8e..562a385b15 100644--- a/todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearTodoConfirmDeleteScreen.kt+++ b/todo/src/main/java/com/vayunmathur/todo/ui/WearTodoConfirmDeleteScreen.kt@@ -1,4 +1,4 @@-package com.vayunmathur.todo.wear.ui+package com.vayunmathur.todo.ui  import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding@@ -13,8 +13,8 @@ import androidx.wear.compose.material.Chip import androidx.wear.compose.material.ChipDefaults import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text-import com.vayunmathur.todo.wear.R-import com.vayunmathur.todo.wear.data.WearTodoStore+import com.vayunmathur.todo.R+import com.vayunmathur.todo.data.WearTodoStore  /** Delete needs an explicit confirmation on the watch (no swipe-to-delete). */ @Composable
todo/src/main/java/com/vayunmathur/todo/ui/WearTodoEditScreen.kt
diff --git a/todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearTodoEditScreen.kt b/todo/src/main/java/com/vayunmathur/todo/ui/WearTodoEditScreen.ktsimilarity index 98%rename from todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearTodoEditScreen.ktrename to todo/src/main/java/com/vayunmathur/todo/ui/WearTodoEditScreen.ktindex 7749b2a8be..682b654985 100644--- a/todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearTodoEditScreen.kt+++ b/todo/src/main/java/com/vayunmathur/todo/ui/WearTodoEditScreen.kt@@ -1,4 +1,4 @@-package com.vayunmathur.todo.wear.ui+package com.vayunmathur.todo.ui  import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding@@ -20,8 +20,8 @@ import androidx.wear.compose.material.Chip import androidx.wear.compose.material.ChipDefaults import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text-import com.vayunmathur.todo.wear.R-import com.vayunmathur.todo.wear.data.WearTodoStore+import com.vayunmathur.todo.R+import com.vayunmathur.todo.data.WearTodoStore import java.time.LocalDate import java.time.ZoneId 
todo/src/main/java/com/vayunmathur/todo/ui/WearTodoHomeScreen.kt
diff --git a/todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearTodoHomeScreen.kt b/todo/src/main/java/com/vayunmathur/todo/ui/WearTodoHomeScreen.ktsimilarity index 96%rename from todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearTodoHomeScreen.ktrename to todo/src/main/java/com/vayunmathur/todo/ui/WearTodoHomeScreen.ktindex 471e2f6d71..44a4e7c19e 100644--- a/todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearTodoHomeScreen.kt+++ b/todo/src/main/java/com/vayunmathur/todo/ui/WearTodoHomeScreen.kt@@ -1,4 +1,4 @@-package com.vayunmathur.todo.wear.ui+package com.vayunmathur.todo.ui  import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding@@ -21,9 +21,9 @@ import androidx.wear.compose.material.Chip import androidx.wear.compose.material.ChipDefaults import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text-import com.vayunmathur.todo.wear.R-import com.vayunmathur.todo.wear.data.WearTodoStore-import com.vayunmathur.todo.wear.sync.WearLinkBridge+import com.vayunmathur.todo.R+import com.vayunmathur.todo.data.WearTodoStore+import com.vayunmathur.todo.sync.WearLinkBridge import kotlinx.coroutines.launch  /**
todo/src/main/java/com/vayunmathur/todo/ui/WearTodoPageScreen.kt
diff --git a/todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearTodoPageScreen.kt b/todo/src/main/java/com/vayunmathur/todo/ui/WearTodoPageScreen.ktsimilarity index 97%rename from todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearTodoPageScreen.ktrename to todo/src/main/java/com/vayunmathur/todo/ui/WearTodoPageScreen.ktindex 8034799bbc..7e5ea7b0f4 100644--- a/todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearTodoPageScreen.kt+++ b/todo/src/main/java/com/vayunmathur/todo/ui/WearTodoPageScreen.kt@@ -1,4 +1,4 @@-package com.vayunmathur.todo.wear.ui+package com.vayunmathur.todo.ui  import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding@@ -20,9 +20,9 @@ import androidx.wear.compose.material.ChipDefaults import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text import com.vayunmathur.library.wearlink.todo.overlayPendingTasks-import com.vayunmathur.todo.wear.R-import com.vayunmathur.todo.wear.data.WearTodoStore-import com.vayunmathur.todo.wear.sync.WearLinkBridge+import com.vayunmathur.todo.R+import com.vayunmathur.todo.data.WearTodoStore+import com.vayunmathur.todo.sync.WearLinkBridge import kotlinx.coroutines.launch  /**
todo/src/main/java/com/vayunmathur/todo/ui/WearTodoQuickAddScreen.kt
diff --git a/todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearTodoQuickAddScreen.kt b/todo/src/main/java/com/vayunmathur/todo/ui/WearTodoQuickAddScreen.ktsimilarity index 96%rename from todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearTodoQuickAddScreen.ktrename to todo/src/main/java/com/vayunmathur/todo/ui/WearTodoQuickAddScreen.ktindex e05ee6ca7b..442b12e9a1 100644--- a/todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearTodoQuickAddScreen.kt+++ b/todo/src/main/java/com/vayunmathur/todo/ui/WearTodoQuickAddScreen.kt@@ -1,4 +1,4 @@-package com.vayunmathur.todo.wear.ui+package com.vayunmathur.todo.ui  import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding@@ -19,8 +19,8 @@ import androidx.wear.compose.material.Chip import androidx.wear.compose.material.ChipDefaults import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text-import com.vayunmathur.todo.wear.R-import com.vayunmathur.todo.wear.data.WearTodoStore+import com.vayunmathur.todo.R+import com.vayunmathur.todo.data.WearTodoStore  /**  * Quick add: one text field (system IME microphone = dictation). The raw
todo/src/main/java/com/vayunmathur/todo/ui/WearTodoTaskScreen.kt
diff --git a/todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearTodoTaskScreen.kt b/todo/src/main/java/com/vayunmathur/todo/ui/WearTodoTaskScreen.ktsimilarity index 98%rename from todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearTodoTaskScreen.ktrename to todo/src/main/java/com/vayunmathur/todo/ui/WearTodoTaskScreen.ktindex 44129b58d7..6f6e8ef847 100644--- a/todo-wear/src/main/java/com/vayunmathur/todo/wear/ui/WearTodoTaskScreen.kt+++ b/todo/src/main/java/com/vayunmathur/todo/ui/WearTodoTaskScreen.kt@@ -1,4 +1,4 @@-package com.vayunmathur.todo.wear.ui+package com.vayunmathur.todo.ui  import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding@@ -17,8 +17,8 @@ import androidx.wear.compose.material.ChipDefaults import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text import com.vayunmathur.library.wearlink.todo.overlayPendingTasks-import com.vayunmathur.todo.wear.R-import com.vayunmathur.todo.wear.data.WearTodoStore+import com.vayunmathur.todo.R+import com.vayunmathur.todo.data.WearTodoStore import java.time.Instant import java.time.ZoneId import java.time.format.DateTimeFormatter
todo/src/main/res/values/wear_strings.xml
diff --git a/todo-wear/src/main/res/values/strings.xml b/todo/src/main/res/values/wear_strings.xmlsimilarity index 97%rename from todo-wear/src/main/res/values/strings.xmlrename to todo/src/main/res/values/wear_strings.xmlindex 4f757be72f..e68b478c8f 100644--- a/todo-wear/src/main/res/values/strings.xml+++ b/todo/src/main/res/values/wear_strings.xml@@ -1,6 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <resources>-    <string name="app_name">Todo</string>     <string name="wear_empty">No tasks synced yet. Open Todo on your phone to sync this watch.</string>     <string name="wear_no_page">This page has not synced yet. Open Todo on your phone, or tap Sync.</string>     <string name="wear_quick_add">Quick add</string>
todo/src/screenshotTest/kotlin/com/vayunmathur/todo/ui/WearMetadataPreviews.kt
diff --git a/todo-wear/src/screenshotTest/kotlin/com/vayunmathur/todo/wear/ui/MetadataPreviews.kt b/todo/src/screenshotTest/kotlin/com/vayunmathur/todo/ui/WearMetadataPreviews.ktsimilarity index 94%rename from todo-wear/src/screenshotTest/kotlin/com/vayunmathur/todo/wear/ui/MetadataPreviews.ktrename to todo/src/screenshotTest/kotlin/com/vayunmathur/todo/ui/WearMetadataPreviews.ktindex df231de16d..d4c6d9309f 100644--- a/todo-wear/src/screenshotTest/kotlin/com/vayunmathur/todo/wear/ui/MetadataPreviews.kt+++ b/todo/src/screenshotTest/kotlin/com/vayunmathur/todo/ui/WearMetadataPreviews.kt@@ -1,4 +1,4 @@-package com.vayunmathur.todo.wear.ui+package com.vayunmathur.todo.ui  import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box@@ -25,11 +25,11 @@ private val fixtureTasks = listOf( )  /**- * Store listing images for `:todo-wear` — every top-level screen/route+ * Store listing images for :todo (watch experience) — every top-level screen/route  * (home, page, task detail, quick-add, edit, confirm-delete).- * `./gradlew :todo-wear:metadata` copies renders into `metadata_data/photos/todo-wear/wear/`.+ * `./gradlew :todo:metadata` copies renders into `metadata_data/photos/todo/wear/`.  */-class MetadataPreviews {+class WearMetadataPreviews {      @PreviewTest     @Preview(name = "1-home-round", device = ROUND, group = "wear")
todo/src/test/java/com/vayunmathur/todo/platform/FormFactorTest.kt
diff --git a/todo/src/test/java/com/vayunmathur/todo/platform/FormFactorTest.kt b/todo/src/test/java/com/vayunmathur/todo/platform/FormFactorTest.ktnew file mode 100644index 0000000000..dbbd6792bb--- /dev/null+++ b/todo/src/test/java/com/vayunmathur/todo/platform/FormFactorTest.kt@@ -0,0 +1,19 @@+package com.vayunmathur.todo.platform++import kotlin.test.Test+import kotlin.test.assertFalse+import kotlin.test.assertTrue++/** The watch system feature is the single-APK routing signal. */+class FormFactorTest {++    @Test+    fun watchFeatureMeansWatch() {+        assertTrue(FormFactor.isWatch(hasWatchSystemFeature = true))+    }++    @Test+    fun noWatchFeatureMeansPhone() {+        assertFalse(FormFactor.isWatch(hasWatchSystemFeature = false))+    }+}