Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/parity/drawer.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Status values: `todo`, `partial: <what is missing>`, `done`, `n/a: <reason and w

| iOS file | Lines | Kotlin file(s) | Status | Notes |
| --- | ---: | --- | --- | --- |
| `OpenCode/Drawer/CatchUpChrome.swift` | 153 | `feature/drawer/src/main/kotlin/ai/opencode/feature/drawer/catchup/CatchUpChrome.kt` | done | `CatchUpChrome` verbatim: “N Left” `RollingNumber` (heading, hidden at 0, keeps the last count), Leave Catch Up circle, Undo capsule (tertiary when nothing to undo), Keep Unread / Mark as Read (read control green tint) shrinking to 75 % on one line, footer fades and drops 6 dp at 0 (0.22 s ease-out, 0.2 s under Reduce Motion), Drift field behind, padded by system bars + cutout (not the keyboard). `DeferredDrawerContent` n/a (SwiftUI evaluation trick; Compose skips unchanged content). `CatchUpPreviewCard` → `CatchUpStack`'s `preview(sessionID, revision)` slot (inert, hidden from TalkBack; the revision is the equality key). Dynamic Type caps (`...accessibility1`) not ported. Sync 03adf07a (03adf07a): the Finish label shows and leaves on `MotionRole.MicroIn` (exit on finish).QA W-05: Catch Up opens with TalkBack on Leave Catch Up (`:core` `accessibilityFocusRequest`), VoiceOver's first element on a screen change (:28-42); after Keep Unread, Mark as Read or Undo the focus stays on the button pressed and nothing more is said, as with VoiceOver. |
| `OpenCode/Drawer/CatchUpChrome.swift` | 153 | `feature/drawer/src/main/kotlin/ai/opencode/feature/drawer/catchup/CatchUpChrome.kt` | done | `CatchUpChrome` verbatim: “N Left” `RollingNumber` (heading, hidden at 0, keeps the last count), Leave Catch Up and Undo in an `OpenCodeTopBar` (Android-native on purpose: a plain back arrow, the count as a start-aligned title and Undo as a text action, dimmed when nothing to undo), Keep Unread / Mark as Read (read control green tint) shrinking to 75 % on one line, footer fades and drops 6 dp at 0 (0.22 s ease-out, 0.2 s under Reduce Motion), Drift field behind, padded by system bars + cutout (not the keyboard). `DeferredDrawerContent` n/a (SwiftUI evaluation trick; Compose skips unchanged content). `CatchUpPreviewCard` → `CatchUpStack`'s `preview(sessionID, revision)` slot (inert, hidden from TalkBack; the revision is the equality key). Dynamic Type caps (`...accessibility1`) not ported. Sync 03adf07a (03adf07a): the Finish label shows and leaves on `MotionRole.MicroIn` (exit on finish).QA W-05: Catch Up opens with TalkBack on Leave Catch Up (`:core` `accessibilityFocusRequest`), VoiceOver's first element on a screen change (:28-42); after Keep Unread, Mark as Read or Undo the focus stays on the button pressed and nothing more is said, as with VoiceOver. |
| `OpenCode/Drawer/CatchUpDriftField.swift` | 156 | `feature/drawer/src/main/kotlin/ai/opencode/feature/drawer/catchup/CatchUpDriftField.kt` | done | Metal `catchUpDriftFragment` ported line for line to AGSL (`RuntimeShader`, minSdk 33 so no fallback); renderer uniforms, levels (0.28 → 0.56 over 0.65 s smoothstep, swell 0.55 s), 3.5 pt grid, pearl palette (light/dark), stage centre from system bars + 52/74 header/footer. Reduce Motion: one still frame (t = 1.3); paused when not resumed (iOS `scenePhase`). Sync 03adf07a (22ddb6a0): the frame loop advances the field 30 times a second (`CatchUpDriftRenderer.FRAMES_PER_SECOND`). The 0.75x pixel density is n/a: an AGSL `RuntimeShader` brush draws at the canvas's density, and a smaller target would need an offscreen hardware render that costs more than it saves.QA W-06: also holds `isStill` while TalkBack touch exploration is enabled (`AccessibilityManager.TouchExplorationStateChangeListener`; iOS `MTKView` renders on `CAMetalLayer` off UIKit's main-thread accessibility path, `:18-30`), so the decorative full-screen shader doesn't contend with `ViewRootImpl`'s main-thread `AccessibilityInteractionController` queries, and skips inter-dot pixels outside the dot+halo radius (`alpha < 0.0008`). |
| `OpenCode/Drawer/CatchUpFeature.swift` | 234 | `feature/drawer/src/main/kotlin/ai/opencode/feature/drawer/catchup/CatchUpFeature.kt` | done | Split out of `CatchUpStack.swift` (7f0ad348); the Kotlin reducer was already its own file, see that row. |
| `OpenCode/Drawer/CatchUpFinish.swift` | 366 | `feature/drawer/src/main/kotlin/ai/opencode/feature/drawer/catchup/CatchUpFinish.kt`, `feature/drawer/src/main/kotlin/ai/opencode/feature/drawer/catchup/CatchUpFeature.kt` | done | `CatchUpFinishTunables` (baked defaults), `CatchUpFinishTimeline` (frames, spring/ease math, `referenceNow` on the `System.nanoTime` clock `DrawerShortcutMotion.finishStart` uses), `reduceFinish` in `CatchUpFeature`, `DrawerCatchUpFinishedLabel` (title swap with travel + blur, count roll to 0 then fade/scale/blur, trimmed check, glow sweep and tint; per-frame values read in draw/layer blocks; TalkBack “All Caught Up”). Laid out like `DrawerShortcutLabel` itself (`DrawerMetrics.rowHeight` row, 22 dp symbol, 10/12 insets) rather than hosted in it. `AnimationTimeScale` (slow-motion dev tool) n/a. Sync f657969b: All Caught Up plays while Catch Up closes (b8115ff7: land 0.06, check 0.22 after, shorter roll/fade/draw/swap, glow 0.04 after the check) and a slower 1.25 s shimmer with a narrow glint (e9c4b0b7, d6722304: 30 dp band, 18°, `BlendMode.Plus`, starts 0.2 into the sweep over half its length). Tuning section titles n/a (no Tuning Panel). Catch Up Done (Sound Effects, b275ccb6) plays beside `.success` in `CatchUpFeature` `FinishChecked`. Sync 03adf07a (03adf07a): Android-native on purpose, the return to the session is the stage's Swap fade (no `sessionReturn` spring); the Reduce Motion fade is `MotionRole.Reduced`.QA W-06: swapping titles and shrinking count record into `rememberGraphicsLayer()` inside `drawWithContent` instead of positional `Modifier.graphicsLayer` (`:258-296`). |
Expand Down
2 changes: 1 addition & 1 deletion docs/parity/media.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Status values: `todo`, `partial: <what is missing>`, `done`, `n/a: <reason and w
| `OpenCode/Media/AgentFiles/AgentTextDocument.swift` | 417 | feature/media/.../agentfiles/AgentTextDocument.kt | done | Android already kept the document in its own file; a large file renders as a plain lazy list of lines (iOS: TextKit 2 storage) Sync 440b77f0 (92a19c0d): nothing changed (iOS moved it out of AgentFileViewer.swift unchanged) |
| `OpenCode/Media/AgentFiles/MediaPlaybackAudio.swift` | 25 | feature/media/.../agentfiles/MediaPlaybackAudio.kt | done | own audio-focus holder count (AudioSessionOwner is voice's, above media); joins calls without requesting focus |
| `OpenCode/Media/ImageDrawing.swift` (iOS PR #335, not on iOS main yet) | 95 | `ImageDrawing.kt` | done | `ImageDrawing` (six inks, red first; strokes of pixel-space points; `undo`; `attachment(image, id)` flattens once at the composer's 1568 px JPEG 0.8 on `Dispatchers.Default`, reading a hardware bitmap through a bounded software copy) and `ImageDrawingClient` (`flatten`, `liveValue`/inert `testValue`). `PromptImageFormat` holds `SharedImageEncoder`'s size, quality and MIME here, since `:feature:composer` sits above media (noted in composer.md). |
| `OpenCode/Media/ImageDrawingEditor.swift` (iOS PR #335, not on iOS main yet) | 302 | `ImageDrawingEditor.kt` | done | `ImageDrawingFeature(add)` (ink, finished strokes, undo, “Discard drawing?” / Discard Drawing / Keep Drawing, one cancellable export with its id from `UuidClient`, “Couldn’t Add Drawing” with the `Flatten`/`Prompt` messages, both keeping the drawing). iOS's `@Dependency(\.dismiss)` is a `Dismiss` delegate its presenter acts on; the binding is `IsConfirmingDiscardChanged`. `ImageDrawingEditor` is a full-window `Dialog` (iOS `fullScreenCover`), Back is Cancel; `InkCanvas` (a `View`) samples historical pointer positions and draws the live stroke, sending only finished strokes; a cancelled touch never commits. |
| `OpenCode/Media/ImageDrawingEditor.swift` (iOS PR #335, not on iOS main yet) | 302 | `ImageDrawingEditor.kt` | done | `ImageDrawingFeature(add)` (ink, finished strokes, undo, “Discard drawing?” / Discard Drawing / Keep Drawing, one cancellable export with its id from `UuidClient`, “Couldn’t Add Drawing” with the `Flatten`/`Prompt` messages, both keeping the drawing). iOS's `@Dependency(\.dismiss)` is a `Dismiss` delegate its presenter acts on; the binding is `IsConfirmingDiscardChanged`. `ImageDrawingEditor` is a full-window `Dialog` (iOS `fullScreenCover`), Back is Cancel; its controls are a dark `OpenCodeTopBar` (Android-native on purpose: × navigation, “Draw on Image” title, Undo icon and an “Add” text action announced as “Add to Prompt”); `InkCanvas` (a `View`) samples historical pointer positions and draws the live stroke, sending only finished strokes; a cancelled touch never commits. |
| `OpenCode/Media/ImageLinkPreviewClient.swift` | 162 | feature/media/.../ImageLinkPreviewClient.kt | done | extension from the last non-empty path segment (iOS `pathExtension`) |
| `OpenCode/Media/LinkPreviews/LinkPreview.swift` | 276 | feature/media/.../linkpreviews/LinkPreview.kt | done | `NSDataDetector` → `Patterns.WEB_URL`; extractor takes `LinkTextBlock`/`LinkTextRun` (Markdown block type is transcript's; it maps blocks with `linkTextBlocks()`). The one copy of these types: the transcript's link views use them |
| `OpenCode/Media/LinkPreviews/LinkPreviewClient.swift` | 618 | feature/media/.../linkpreviews/LinkPreviewClient.kt | done | lab switches via debug `debug.opencode.lab_link_preview*` system properties Sync 440b77f0 (6b072111): `LinkPreviewLoader.freshLifetime(source)` is the one freshness rule (rich previews keep `RICH_LIFETIME`, others `LOADED_LIFETIME`). Sync 03adf07a (9a39cafd): `stale` reads memory only; a cold miss is null rather than a disk read while drawing. |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
package ai.opencode.feature.drawer.catchup

import ai.opencode.core.ui.OpenCodeSurfaces
import ai.opencode.core.motion.Motion
import ai.opencode.core.motion.MotionPhase
import ai.opencode.core.motion.MotionRole
import ai.opencode.core.motion.rememberReduceMotion
import ai.opencode.core.ui.AccessibilityFocusRequest
import ai.opencode.core.ui.OpenCodeIconButton
import ai.opencode.core.ui.OpenCodeIconButtonStyle
import ai.opencode.core.ui.OpenCodeMinTapTarget
import ai.opencode.core.ui.OpenCodePrimaryButton
import ai.opencode.core.ui.OpenCodeSecondaryButton
import ai.opencode.core.ui.OpenCodeShape
import ai.opencode.core.ui.OpenCodeTextStyles
import ai.opencode.core.ui.OpenCodeTheme
import ai.opencode.core.ui.OpenCodeTopBar
import ai.opencode.core.ui.RollingNumber
import ai.opencode.core.ui.RollingNumberAlignment
import ai.opencode.core.ui.SFSymbol
Expand All @@ -31,19 +28,16 @@ import androidx.compose.foundation.layout.displayCutout
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.layout.union
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.text.BasicText
import androidx.compose.foundation.text.TextAutoSize
import androidx.compose.material3.FilledTonalButton
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
Expand All @@ -52,6 +46,7 @@ import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.res.pluralStringResource
import androidx.compose.ui.res.stringResource
Expand Down Expand Up @@ -102,41 +97,40 @@ fun CatchUpChrome(
.fillMaxSize()
.windowInsetsPadding(WindowInsets.systemBars.union(WindowInsets.displayCutout)),
) {
Box(
Modifier
.fillMaxWidth()
.height(CatchUpMetrics.headerHeight),
contentAlignment = Alignment.Center,
) {
RollingNumber(
text = pluralStringResource(R.plurals.drawer_catch_up_remaining, shownRemaining, shownRemaining),
style = OpenCodeTextStyles.headline.copy(fontWeight = FontWeight.SemiBold),
alignment = RollingNumberAlignment.Center,
modifier = Modifier
.graphicsLayer { alpha = 1f - finishedProgress }
.then(
if (finished) Modifier.clearAndSetSemantics {}
else Modifier.semantics { heading() },
),
)
Row(
Modifier
.fillMaxWidth()
.padding(horizontal = CatchUpMetrics.sideInset),
verticalAlignment = Alignment.CenterVertically,
) {
OpenCodeTopBar(
title = {
RollingNumber(
text = pluralStringResource(R.plurals.drawer_catch_up_remaining, shownRemaining, shownRemaining),
style = OpenCodeTextStyles.headline.copy(fontWeight = FontWeight.SemiBold),
alignment = RollingNumberAlignment.Start,
modifier = Modifier
.graphicsLayer { alpha = 1f - finishedProgress }
.then(
if (finished) Modifier.clearAndSetSemantics {}
else Modifier.semantics { heading() },
),
)
},
modifier = Modifier.height(CatchUpMetrics.headerHeight),
navigation = {
OpenCodeIconButton(
symbol = SFSymbol.ChevronBackward,
contentDescription = stringResource(R.string.drawer_catch_up_leave_description),
onClick = onExit,
// The stage opens on its first element, as VoiceOver does on a screen change.
modifier = Modifier.accessibilityFocusRequest(openFocus),
style = OpenCodeIconButtonStyle.Circle,
style = OpenCodeIconButtonStyle.Standard,
)
Spacer(Modifier.weight(1f))
CatchUpUndoButton(canUndo = canUndo, onClick = onUndo)
}
}
},
actions = {
TextButton(onClick = onUndo, enabled = canUndo) {
Text(stringResource(R.string.drawer_catch_up_undo), maxLines = 1)
}
},
containerColor = Color.Transparent,
hairline = false,
windowInsets = WindowInsets(0, 0, 0, 0),
)

Spacer(Modifier.weight(1f))

Expand Down Expand Up @@ -173,28 +167,6 @@ fun CatchUpChrome(
}
}

/** Subheadline semibold, tertiary while there's nothing to undo. */
@Composable
private fun CatchUpUndoButton(canUndo: Boolean, onClick: () -> Unit) {
FilledTonalButton(
onClick = onClick,
enabled = canUndo,
shape = OpenCodeShape.control,
// The desktop's neutral button: base surface and a hairline.
border = OpenCodeSurfaces.border,
contentPadding = androidx.compose.foundation.layout.PaddingValues(horizontal = 16.dp),
colors = ButtonDefaults.filledTonalButtonColors(
containerColor = OpenCodeSurfaces.neutralFill,
contentColor = OpenCodeTheme.colors.text,
disabledContainerColor = OpenCodeSurfaces.neutralFill,
disabledContentColor = OpenCodeTheme.colors.tertiaryText,
),
modifier = Modifier.heightIn(min = OpenCodeMinTapTarget).widthIn(min = OpenCodeMinTapTarget),
) {
Text(stringResource(R.string.drawer_catch_up_undo), style = OpenCodeTextStyles.subheadline.copy(fontWeight = FontWeight.SemiBold), maxLines = 1)
}
}

/** One line, shrinking to 75 % before it would wrap. */
@Composable
private fun FittingLabel(text: String) {
Expand Down
Loading
Loading