diff --git a/core/src/main/kotlin/ai/opencode/core/sharing/SharedKeys.kt b/core/src/main/kotlin/ai/opencode/core/sharing/SharedKeys.kt index 6d530804b..8382ac7d6 100644 --- a/core/src/main/kotlin/ai/opencode/core/sharing/SharedKeys.kt +++ b/core/src/main/kotlin/ai/opencode/core/sharing/SharedKeys.kt @@ -83,6 +83,9 @@ object SharedKeys { /** Phone-local, server-scoped (`serverID|sessionID`) like pins: muted sessions never reach Catch Up or an unread badge. */ val mutedSessionKeys = SharedKey.fileStorage>(FileDirectory.Documents, "muted-sessions.json", emptySet()) + /** Phone-local, server-scoped (`serverID|sessionID`) like pins: hidden sessions leave the drawer's list but still turn up in search. */ + val hiddenSessionKeys = SharedKey.fileStorage>(FileDirectory.Documents, "hidden-sessions.json", emptySet()) + val initializedInboxServerIDs = SharedKey.fileStorage>(FileDirectory.Documents, "initialized-inbox-servers.json", emptySet()) diff --git a/core/src/testFixtures/kotlin/ai/opencode/core/testing/TestIsolationGuard.kt b/core/src/testFixtures/kotlin/ai/opencode/core/testing/TestIsolationGuard.kt index 8d30a17b4..6a7062955 100644 --- a/core/src/testFixtures/kotlin/ai/opencode/core/testing/TestIsolationGuard.kt +++ b/core/src/testFixtures/kotlin/ai/opencode/core/testing/TestIsolationGuard.kt @@ -208,6 +208,7 @@ object TestIsolationGuard { sharedProbe("Shared.uploadUnsupportedServerIDs", SharedKeys.uploadUnsupportedServerIDs, "[]"), sharedProbe("Shared.pinnedSessionKeys", SharedKeys.pinnedSessionKeys, "[]"), sharedProbe("Shared.mutedSessionKeys", SharedKeys.mutedSessionKeys, "[]"), + sharedProbe("Shared.hiddenSessionKeys", SharedKeys.hiddenSessionKeys, "[]"), sharedProbe("Shared.favoriteModelIDs", SharedKeys.favoriteModelIDs, "[]"), sharedProbe("Shared.appTheme", ThemeSharedKeys.appTheme, "System"), sharedProbe("Shared.appearanceColorScheme", ThemeSharedKeys.appearanceColorScheme, "System"), diff --git a/docs/parity/drawer.md b/docs/parity/drawer.md index 8a54c6de5..56509d2e4 100644 --- a/docs/parity/drawer.md +++ b/docs/parity/drawer.md @@ -22,11 +22,11 @@ Status values: `todo`, `partial: `, `done`, `n/a: 8 ms, clamped ±4000 dp/s) and the row lands on `pinDropSpring` 0.36/0.12 (0.2 s under Reduce Motion) while the lift settles. Sync round 2: `DrawerLiftedRowView.apply(lift)` gives the scale and iOS's tunable shadow (`pinLiftShadow` 0.3 × lift, `pinLiftShadowY` 6, `pinLiftShadowRadius` 14), drawn under the raised surface with a framework `setShadowLayer` (no Material elevation while lifted). Sync 03adf07a (03adf07a): lift on `MotionRole.MicroIn` (exit on drop), drop on `MotionRole.Release` with the throw's velocity, Reduce MotionQA A-03: the dragged row's lazy item draws above every other item (`zIndex` on the item's root, keyed on `DrawerPinDrag.draggingID`, so it lasts through the roles.landing and settle); on the cell's own box it only ordered it within its item, and section headers and later rows painted over it. | | `OpenCode/Drawer/DrawerListCellParts.swift` | 476 | `feature/drawer/src/main/kotlin/ai/opencode/feature/drawer/list/DrawerListCellParts.kt` | done | `DrawerListFonts` (Bold Text via Compose `fontWeightAdjustment`), `DrawerListActivityRing` (sweep-gradient arc, 0.8 s layer rotation), `DrawerListProjectTile` (+ `rememberProjectIcon`, 0.18 s crossfade, palette/backing/sheen/border), `DrawerListTitleView` (natural-width layout, start kept in view by writing direction, DstIn fade mask, reduce-motion time crossfade). Sync to f657969b: the tile is lit as glass (a0fc7375, d7aea740): `ProjectTileLighting` draws one cached white bitmap per size/look (specular spot above the top edge, 0.5 dp edge fading 85 %), highlight ×0.6 over images, no edge under Increase Contrast (a solid border instead); two-layer contact shadow ×1.5 in dark; the sheen and border are gone. 3bbf1928 is an iOS-only request-key refactor (Compose keys the load already). Sync ae029f85 (a599a6a4): n/a, the ring's `rememberInfiniteTransition` runs on the composition's frame clock, which resumes after the app comes back, and a reused lazy row's composition restarts it, so the dropped/still Core Animation loop can't happen; no `RenderServerLoop`. Sync 03adf07a (03adf07a, f5636460): the ring spins on `AmbientClock` (sweep fraction 0.5) and stopsdrw-phas paused while the drawer is hidden (`LocalDrawerHidden`); the project tile crossfades on `MotionRole.Swap`. iOS's icon request made only for a new project or server: Android already remembered it per project and server.via `LocalDrawerVisible` QA AB-01: `DrawerListActivityRing` holds its still arc while TalkBack touch exploration is enabled (`rememberTouchExplorationEnabled()`). | | `OpenCode/Drawer/DrawerListController.swift` | 830 | `feature/drawer/src/main/kotlin/ai/opencode/feature/drawer/list/DrawerListView.kt` | done | `LazyColumn` keyed by `DrawerListItem.key` (+ `contentType`); one model build in a `derivedStateOf`, unchanged rows keep their instances so only changed rows recompose (iOS reconfigure). Observation flush on layout → the list reads Home's state through its own snapshot value that the pin drop sets at once (`DrawerPinDragHost.flushNow`), so the drop lays out in the frame that commits it; `requestScrollToItem` keeps the scroll by index across it. Reveal: rows read the live `DrawerTimeReveal` and spring back from their last place on release (0.4 s/0.2; Reduce Motion 0.2 s fade). Shortcut motion `sync` from the model, header scroll from the first item's offset (0.5 dp steps), search's IME hidden on a list drag (`keyboardDismissMode = .interactive`), Catch Up TalkBack focus via `FocusRequester` on the Catch Up row or the selected row when touch exploration is on. n/a: `DrawerListHostedCell` safe-area override, UIKit edge-effect interaction, `-lab-a11y-focus-trace`. Sync to f657969b: Server Flow (d8a311bd: ghost rows, the note row) is ported. Sync round 2: ff935bef `movesPins` → `DrawerShownPins.movesPins` (same server, same search, the pinned section changed) calls `DrawerPinMove.begin` before the change lays out; see DrawerPinDrag. Android differs on purpose (Android Motion rules: switching views is instant): a server switch swaps the rows on the next frame, with no row flight out, no chain and no list fade, and the next server's rows replace its ghost rows the same way. Sync p244 (iOS e8e7cc13..da365285): the footer asks for the next page when it comes into view and again after each page or search change (a `snapshotFlow` over the footer’s visibility, `pagesRead` and the search sends `.sessionPages(.loadMoreRequested)`), as iOS’s `loadMoreIfFooterVisible` on willDisplay and after each apply. Sync 03adf07a (03adf07a, 34a02fc4, f5636460): while the drawer is hidden the model build returns the last model (`DrawerListModelHolder.model(isHidden)`), so status changes rebuild nothing; the reveal builds once and syncs the shortcut rows as not visible (`isRevealing`), so what changed while hidden lands in place (34a02fc4). Android keeps its 1.5 s prewarm (`DRAWER_PREWARM_DELAY_MS`: the drawer composes hidden once so the first open doesn't spend ~85 ms on rows), which matches iOS's one prewarm build; the hidden signal is the container's `drawerShows` (`LocalDrawerHidden`), and the activity ring and ghost sweep stop while hidden, so nothing ticks per frame behind a shut drawer. One `DrawerTimestamp.Day` and `OpenCodeProjectLookup` per build; tunables `registerIfNeeded` once per store. Spring-back on Release/Reduced (03adf07a). n/a: iOS's accessibility and hit-testing flips (UIKit).QA AD-02: leaving Catch Up puts TalkBack's focus on the Catch Up row, or the highlighted session, through `:core`'s one-shot `accessibilityFocusRequest` (iOS `focusCatchUpRow`, `.layoutChanged`, DrawerListController.swift:652-664), offered for 1 s; it used to move input focus there (`FocusRequester` + `focusable()`), which TalkBack mostly followed to the scrim. | -| `OpenCode/Drawer/DrawerListModel.swift` | 290 | `list/DrawerListModel.kt` | done | Pure build; iOS `DrawerListStyle` tunable snapshot n/a (constants on Android); timestamp/project resolvers passed in. Sync f657969b: Server Flow ghosts (`Ghost`, `ghostCount` 5) while the picked server connects, the `ServerNote` item first in Top without a search, `serverID` from the swap (d8a311bd). a0fc7375’s `projectTile` style is the tunable snapshot (n/a; the tile itself is the ProjectIcon row). Sync p244 (iOS e8e7cc13..da365285): `DrawerListItem.Footer` closes Recent while more pages exist (`drawerListFooter`), the empty row shows only without a footer, `pagesRead` makes a page that adds no row still change the model. Sync 440b77f0 (a32edc20): Project Icons graduated: `DrawerListRow.showsProjectIcons`, `DrawerListInputs.showsProjectIcons` and `twoLineRows` are gone; every row resolves its project. Sync 03adf07a (03adf07a, f5636460): pins and recents come from `drawerSessions` in one pass; `revealFadeIn` removed with iOS (the row veil fades on Swap). | +| `OpenCode/Drawer/DrawerListModel.swift` | 290 | `list/DrawerListModel.kt` | done | Pure build; iOS `DrawerListStyle` tunable snapshot n/a (constants on Android); timestamp/project resolvers passed in. Sync f657969b: Server Flow ghosts (`Ghost`, `ghostCount` 5) while the picked server connects, the `ServerNote` item first in Top without a search, `serverID` from the swap (d8a311bd). a0fc7375’s `projectTile` style is the tunable snapshot (n/a; the tile itself is the ProjectIcon row). Sync p244 (iOS e8e7cc13..da365285): `DrawerListItem.Footer` closes Recent while more pages exist (`drawerListFooter`), the empty row shows only without a footer, `pagesRead` makes a page that adds no row still change the model. Sync 440b77f0 (a32edc20): Project Icons graduated: `DrawerListRow.showsProjectIcons`, `DrawerListInputs.showsProjectIcons` and `twoLineRows` are gone; every row resolves its project. Sync 03adf07a (03adf07a, f5636460): pins and recents come from `drawerSessions` in one pass; `revealFadeIn` removed with iOS (the row veil fades on Swap). Ported ahead of the next sync (fe22dea2, 42c10069): `DrawerListRow.hidden` (TalkBack value Hidden) from `hiddenSessionIDs`. | | `OpenCode/Drawer/DrawerDragDiagnostics.swift` | 158 | – | n/a: internal-build trail of UIKit drag sessions (the system asking for drag items, add-to-session, the lift preview, open `UIDragSession`s) that logs a hold which shows the menu but never drags; Android's hold → menu → pin drag is one Compose pointer handler with no system drag session to trail | Sync 03adf07a (32fa40f0): new iOS file, n/a; its Troubleshooting export filter (`drawer_hold_`/`drawer_drag_` lines, devtools.md) is n/a with it. | | `OpenCode/Drawer/DrawerListPerfProbe.swift` | 100 | `feature/drawer/src/main/kotlin/ai/opencode/feature/drawer/list/DrawerListPerfProbe.kt` | done | `drawer_list_first_frame` (ms, PSS KB, delta, cells) on the first layout with ≥ 4 rows, then `drawer_list_footprint` each second for 20 s via `AppLog.perf`. iOS's `OPENCODE_PERF_FRAMES=1` launch env has no Android counterpart: a lab harness sets `DrawerListPerfProbe.isEnabled`; footprint is `Debug.getPss()`. | | `OpenCode/Drawer/DrawerListServerFlowCells.swift` | 139 | `list/DrawerListServerFlowCells.kt` | done | Server Flow (d8a311bd): `DrawerListGhostCell` (12dp bar of `drawerGhostLengths` [0.72, 0.54, 0.8, 0.46, 0.64], radius 6, 1.6 s sweep held under Reduce Motion, hidden from TalkBack) and `DrawerServerNoteRow` (tinted glyph — timed out secondary, unreachable red, sign-in orange —, subheadline semibold title, footnote detail at 28dp, `OpenCodePrimaryButton` with the note’s action, radius 22 on `surfaceContainerHigh`, `drawer-server-note(-action)` tags). Sync ae029f85 (a599a6a4): n/a, the ghost sweep is a `rememberInfiniteTransition` (see `DrawerListCellParts.swift`), which can't be dropped by a suspension; no `RenderServerLoop`. Sync 03adf07a (03adf07a): the ghost sweep runs on `AmbientClock` (linear, `sweepPeriod`), held under Reduce Motion and while the drawer is hidden. | -| `OpenCode/Drawer/DrawerListSessionCell.swift` | 440 | `feature/drawer/src/main/kotlin/ai/opencode/feature/drawer/list/DrawerListSessionCell.kt` | done | Row layout (tile, fading title, ring 14 dp / dot in an 18 dp slot, status gap and title reflow on a 0.25 s snappy spring, selection fill/tint/outline/bar, two-line subtitle), time riding in `SPACING` before the row, card-edge fade (DstIn mask from −160 dp to `titleFade` past the edge, ramp sliding on over `revealFadeRamp`, eased in over `revealFadeIn`), all per-frame values read in layer/draw blocks. TalkBack: one Button node, title + state value, selected, custom actions Pin/Unpin, Mark as Read/Unread, Mute/Unmute, Delete, Move Up/Down (pinned). The lifted row draws itself raised (iOS hides it under the system platter). Sync to f657969b: the lifted row grows with `liftProgress` (64d91f88); one copy of the row (ff935bef) is how Compose draws it; the lit tile (a0fc7375) is in DrawerListCellParts; 3bbf1928 is an iOS-only refactor. Android divergence: the shipped selection mark is Material's navigation drawer indicator, a `secondaryContainer` capsule. Sync 440b77f0 (a32edc20): the tile shows whenever the row has a project; the two-line subtitle is gone. Sync 03adf07a (03adf07a): the status inset and the dot/ring show and leave on `MotionRole.MicroIn` (Reduce Motion through the role); the edge veil fades on Swap; the land and hold settle leave on Swap's exit. Android only: unsent sessions (`DrawerListRow.unsent`) lead Recents with the running ring while sending and a red `exclamationmark.circle.fill` once the send failed; they can't be held, pinned, muted or marked read (`HomeFeature.State.unsentDrafts`, `openingUnsentDraft`). | +| `OpenCode/Drawer/DrawerListSessionCell.swift` | 440 | `feature/drawer/src/main/kotlin/ai/opencode/feature/drawer/list/DrawerListSessionCell.kt` | done | Row layout (tile, fading title, ring 14 dp / dot in an 18 dp slot, status gap and title reflow on a 0.25 s snappy spring, selection fill/tint/outline/bar, two-line subtitle), time riding in `SPACING` before the row, card-edge fade (DstIn mask from −160 dp to `titleFade` past the edge, ramp sliding on over `revealFadeRamp`, eased in over `revealFadeIn`), all per-frame values read in layer/draw blocks. TalkBack: one Button node, title + state value, selected, custom actions Pin/Unpin, Mark as Read/Unread, Mute/Unmute, Hide/Unhide, Delete, Move Up/Down (pinned). The lifted row draws itself raised (iOS hides it under the system platter). Sync to f657969b: the lifted row grows with `liftProgress` (64d91f88); one copy of the row (ff935bef) is how Compose draws it; the lit tile (a0fc7375) is in DrawerListCellParts; 3bbf1928 is an iOS-only refactor. Android divergence: the shipped selection mark is Material's navigation drawer indicator, a `secondaryContainer` capsule. Sync 440b77f0 (a32edc20): the tile shows whenever the row has a project; the two-line subtitle is gone. Sync 03adf07a (03adf07a): the status inset and the dot/ring show and leave on `MotionRole.MicroIn` (Reduce Motion through the role); the edge veil fades on Swap; the land and hold settle leave on Swap's exit. Android only: unsent sessions (`DrawerListRow.unsent`) lead Recents with the running ring while sending and a red `exclamationmark.circle.fill` once the send failed; they can't be held, pinned, muted or marked read (`HomeFeature.State.unsentDrafts`, `openingUnsentDraft`). | | `OpenCode/Drawer/DrawerListSupportCells.swift` | 283 | `feature/drawer/src/main/kotlin/ai/opencode/feature/drawer/list/DrawerListSupportCells.kt` | done | Header / gap / hairline (heading, `drawer-section-*` tags, moved and faded by the pin drag), Catch Up and What’s New folding in and out with `AnimatedVisibility` on `MotionRole.Layout` (height and fade, scale 0.96 from the top, no touches while leaving); this fold is Android-native on purpose, with no blur, Catch Up's `RollingNumber`, Mark All as Read hold menu + TalkBack action, finished row via `DrawerCatchUpFinishedLabel`, empty / no-results rows with iOS copy. Android divergence: iOS's red deletion-error row is a `DrawerFailure` (`DrawerFailureNotice.kt`) drawn as an `OpenCodeNotice` above New Session (what failed, then why) shown 5 s for a failed archive, unarchive or delete, counting the sessions that fail together. iOS's Settings `WhatsNewButton` is drawn here (`DrawerWhatsNewButton`); its Hide sends `HomeFeature.Action.WhatsNew(WhatsNewFeature.Action.HideTapped)`. Sync p244 (iOS e8e7cc13..da365285): `DrawerListFooterRow`: M3 `CircularProgressIndicator` (“Loading more sessions”, `drawer-load-more`) while a page loads; on failure “Couldn’t load more sessions” and a `TextButton` “Try Again” (`drawer-load-more-retry`, the reducer plays `Haptic.tap`). | | `OpenCode/Drawer/DrawerMotion.swift` | 437 | `feature/drawer/src/main/kotlin/ai/opencode/feature/drawer/motion/DrawerMotion.kt` | done | `DrawerMotionTunables` (ω 28.5, recede 0.96, dim 0.7/0.6, power 1.3, shortcut morph 0.34/0, scale 0.96, close delay 0.12), `DrawerShortcutMotion` (only the Catch Up count kept while it folds and the finish start; the fold itself is `AnimatedVisibility`, Android-native on purpose), `DrawerSpring` (exact critically damped, edge stop, 1 dp arrival, 0.25 dp/8 dp·s⁻¹ settle), `DrawerDim`, `DrawerDepth`, `DrawerCorner` (Android `RoundedCorner` instead of the iPhone table). Plus `DrawerMotionState` (iOS container drag/settle/apply: 250 dp/s flick else halfway, `onCommitted`→`Haptic.snap`, `onArrived`, keyboard hold calls). Sidebar mode stays with `SessionDrawerContainer`. Android divergence: predictive back pulls the open card a quarter of the way shut with the gesture (`DrawerMotionTunables.BACK_PREVIEW_TRAVEL`, `DrawerMotionState.endBackDrag`); the commit closes it from there, a cancel springs it open. QA AB-01: `isContentHiddenFromAccessibility` and `isDrawerHiddenFromAccessibility` follow `presentedState` immediately once a drag ends or `setPresented`/`close` commits (`draggingState` keeps finger drags following `progress`), so tapping a drawer session row exposes the session to TalkBack on the first frame instead of after the 350–500 ms close spring settles. Sync 03adf07a (03adf07a, f5636460): `cardOmega` and `shortcutMorph` removed: the drawer spring is `MotionRole.Release`, the shortcut slots move on `MotionRole.Layout`, and a release commits by `MotionRelease.shouldCommit`. Not ported: iOS's Reduce Motion crossfade for a programmatic open or close (Android still places the drawer at once). n/a: f5636460's presentation-layer reads and the `DrawerScrim` move (UIKit). | | `OpenCode/Drawer/DrawerPanExclusion.swift` | 181 | `motion/DirectionalPan.kt` (`DrawerPanRegions` as `DrawerPanExclusion`), `:core` `ui/DrawerSeams.kt` (`LocalDrawerPanExclusion` and its modifiers) | done | Split out of `SessionDrawerContainer.swift` (0abb034d) unchanged. Controls that track their own drag (the + menu’s press-and-slide, the held mic) register window-coordinate regions the pan never takes; Compose layout coordinates replace iOS’s exclusion-space marker view. Android divergence: with the modal drawer over the card, a touch on the open drawer is the drawer's, not the exposed card's. | @@ -44,7 +44,7 @@ Status values: `todo`, `partial: `, `done`, `n/a: