Unify vertical position and display mode settings; add to onboarding

This commit is contained in:
James Babcock committed 2026-10-10 22:48:26 -07:00
1 parent 6b1e64c5ac
commit 5a9ca08921
36 files changed
+810 -574

No files matched your search

+2 -4
View File
@@ -20,7 +20,7 @@ carries `seq` (monotonic per watch process) and is answered on `/faceclaw/ack`.
| --- | --- | --- |
| `/faceclaw/input` | `{gesture, steps?}` | A ring gesture through the same path as the phone UI's test buttons. `gesture` ∈ `click`, `double-click`, `scroll-up`, `scroll-down`, `long-press` (complete short hold), `long-press-start`, `long-press-release`, `short-then-long-press` (tap then hold: the app's context menu; a plain `long-press` is the glasses' system menu), `wakeword` ("Hey Even"), `swipe-up`, `swipe-down`, `swipe-left`, `swipe-right` (spatial input only a watch can produce: delivered to the glasses UI as `swipe-*` events for components that navigate spatially — launcher grid, settings columns, sidebar, Music — with a scroll / click / double-click fallback elsewhere). `steps` (1–12) repeats a scroll. Refused while the glasses are disconnected. The lock screen is honoured exactly as for the ring. While the display is off, a double-click wakes the display, a `click` shows the phone's Glanceboard for a few seconds, and `long-press-start`/`long-press-release` hold it up; everything else is ignored. |
| `/faceclaw/press` | none | A finger landed on the pad (each first-finger touch-down, the second tap of a double-tap included) or the stem button went down: delivered on the glasses as a `ring-press` from source `watch`, exactly like the R1 ring's touch-down, ahead of whatever gesture the touch becomes (which is still sent on `/faceclaw/input`). Components that act on touch-down (Flappy, Pinball) then ignore the gesture that follows. Sent only while the mirrored state says the glasses are connected with the display on. Carries no `seq` and is never acked; the phone drops it silently wherever the following gesture would be refused. |
| `/faceclaw/command` | `{command, …}` | `launch-app {appId}`, `focus-window {windowId}`, `close-window {windowId}`, `sidebar`, `wake`, `sleep`, `lock`, `unlock`, `connect`, `disconnect`, `close-assistant`, `display-mode {value}` (`value` ∈ `576x288`, `576x480`, `640x480`; sets the phone's Display > Display mode). Everything but connect/disconnect needs a connection; everything but lock/unlock is refused while locked; `unlock` also needs the phone's "Watch can unlock glasses" setting. |
| `/faceclaw/command` | `{command, …}` | `launch-app {appId}`, `focus-window {windowId}`, `close-window {windowId}`, `sidebar`, `wake`, `sleep`, `lock`, `unlock`, `connect`, `disconnect`, `close-assistant`. Everything but connect/disconnect needs a connection; everything but lock/unlock is refused while locked; `unlock` also needs the phone's "Watch can unlock glasses" setting. |
| `/faceclaw/assistant` | `{text}` | Send a query to the assistant (`shell.sendToAssistant`) — the reply shows on the glasses and streams back to the watch as events. |
| `/faceclaw/text` | `{text}` | Type text into the foreground window (`receiveTextInput`, e.g. the terminal). Refused when the window doesn't take text. |
| `/faceclaw/state/request` | `{}` | Re-publish the state item even if unchanged. |
@@ -61,7 +61,6 @@ dashboard state, re-sent whenever it changes (and at least every 30 s):
"foreground": {"appId": "music", "title": "Music"},
"windows": [{"windowId": "…", "title": "…", "appId": "…", "focused": true, "closeable": true, "acceptsText": false}],
"apps": [{"appId": "timer", "title": "Timer"}],
"displayMode": "576x288",
"remoteEnabled": true, "crownClockwiseNext": false,
"canUnlock": true, "mirrorAssistant": true,
"assistantAvailable": true
@@ -73,8 +72,7 @@ dashboard state, re-sent whenever it changes (and at least every 30 s):
visible even though the BLE session remains available.
`protocol` is reserved for incompatible revisions of this format (nothing
checks it yet); `displayMode` mirrors the phone's Display > Display mode and
is what the `display-mode` command changes. `crownClockwiseNext` mirrors the
checks it yet). `crownClockwiseNext` mirrors the
on-glasses Settings > Watch toggle; when false (the default), clockwise crown
rotation sends previous/up, and when true it sends next/down.
@@ -69,20 +69,6 @@ object Command {
const val CONNECT = "connect"
const val DISCONNECT = "disconnect"
const val CLOSE_ASSISTANT = "close-assistant"
const val DISPLAY_MODE = "display-mode"
}
/** The glasses' display modes, mirroring the phone's Display > Display mode. */
enum class DisplayMode(val wire: String, val label: String) {
BAND("576x288", "Band · 576×288"),
TALL("576x480", "Tall · 576×480"),
FULL("640x480", "Full panel · 640×480");
fun next(): DisplayMode = entries[(ordinal + 1) % entries.size]
companion object {
fun fromWire(value: String): DisplayMode? = entries.firstOrNull { it.wire == value }
}
}
data class AppEntry(val appId: String, val title: String)
@@ -106,8 +92,6 @@ data class PhoneState(
val locked: Boolean,
val worn: Boolean?,
val listening: Boolean,
/** Display mode wire value ("576x288" | "576x480" | "640x480"). */
val displayMode: String,
/** Current or last-known G2 charge percentage. */
val battery: Int?,
val charging: Boolean,
@@ -137,7 +121,6 @@ data class PhoneState(
locked = o.optBoolean("locked", false),
worn = if (o.isNull("worn")) null else o.optBoolean("worn"),
listening = o.optBoolean("listening", false),
displayMode = o.optString("displayMode", "576x288"),
battery = if (o.isNull("battery")) null else o.optInt("battery", -1).takeIf { it in 0..100 },
charging = o.optBoolean("charging", false),
silentMode = o.optBoolean("silentMode", false),
@@ -21,7 +21,6 @@ import androidx.wear.compose.material.Scaffold
import androidx.wear.compose.material.Text
import androidx.wear.compose.material.TimeText
import com.faceclaw.wear.Command
import com.faceclaw.wear.DisplayMode
import com.faceclaw.wear.Haptics
import com.faceclaw.wear.PhoneLink
import com.faceclaw.wear.R
@@ -101,20 +100,6 @@ fun StatusScreen(link: PhoneLink, haptics: Haptics, onOpenSettings: () -> Unit)
enabled = connected && !(locked && state?.canUnlock == false),
)
}
item {
val mode = DisplayMode.fromWire(state?.displayMode ?: "") ?: DisplayMode.BAND
Chip(
onClick = {
haptics.click()
link.sendCommand(Command.DISPLAY_MODE, "value" to mode.next().wire)
},
label = { Text("Display mode") },
secondaryLabel = { Text(mode.label) },
colors = ChipDefaults.secondaryChipColors(),
modifier = Modifier.fillMaxWidth(),
enabled = connected,
)
}
state?.foreground?.let { foreground ->
item {
Chip(