Skip to content

feat(mobile-android): add the camera recorder - #4766

Open
AatmanAJ wants to merge 772 commits into
CapSoftware:mainfrom
AatmanAJ:feat/mobile-android-camera
Open

AatmanAJ wants to merge 772 commits into
CapSoftware:mainfrom
AatmanAJ:feat/mobile-android-camera

Conversation

@AatmanAJ

@AatmanAJ AatmanAJ commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on the recording engine PR (#4764), which sits on the earlier Android PRs. Only the top 15 commits are new here, from "render camera frames upright through GL" onwards (b0ed15449 to edc680317), then a merge of the recording engine PR (91cadad00), two fixes after review (19807755e, f68a4661b), a second merge of the recording engine PR (1ed64d194), a fix after review (712104580), a third merge of the recording engine PR with its review fixes (62a61d6fb), a fix for the notification permission (14cfec5ff), its test (092644604, made to wait for the camera in 48d38ff0c) and a fourth merge of the recording engine PR, which brings in the sign-in fixes from #4734 (aae17d165), and a fifth merge of the recording engine PR (759a73c8f). It brings in the review fixes from the earlier Android PRs, among them: sign-out clears notifications and stops playback, Cap images send the video access token, paging carries on after a refresh and shows its errors, the screen stays on while a Cap plays, an upload that storage asks to send later is retried, and lint no longer fails when a newer Kotlin is released. Then come a fix after review (15861a5e8) and its test (5c23ceaf3), two more merges of the recording engine PR (666bf9bdf, 9862f4e59), a fix that keeps a segment writer alive until its recording is saved (d45d50ed7), a merge of the recording engine PR that brings in its drain deadline (effb7ce6f) and a fix that says how much of a recording was kept when saving stops (dfdb927d4). A last merge of the recording engine PR (69b5716c9) brings in the recording engine's fix that keeps the debug pattern recorder's footage when saving stops early (077ea1786, #4764). Once the PRs below merge this shows only its own diff.

This PR adds the camera recorder, the Android counterpart of the iOS Instant Mode camera recording.

What is in it

The Record tab and the Add menu's Record now open the recorder instead of the placeholder. Someone can record themselves with the front or back camera and the microphone, and when they stop, the link to the Cap is on their clipboard, while the segments upload through the recording engine from the previous PR.

  • Capture (media). GlFrameRenderer draws camera frames upright through OpenGL to the viewfinder and to the encoder, mirroring only the front camera's viewfinder and cropping each sensor to the recording's shape. MicrophoneCapture records 48 kHz mono on the capture clock. CameraCapture opens, flips and closes the camera with Camera2.
  • State machine. RecordModel is a port of the iOS RecordModel: preparing, camera denied, unavailable, ready, recording and finishing. It drives the camera through RecorderCommand values, which CameraRecorder carries out, so every transition runs on the JVM. Recording creates the job and begins its uploads, so the Cap is created while the first frames are encoded.
  • Recorder screen. Black and dark like the iOS recorder: the capture mode switch with Studio and Screenshot coming soon, the Camera and Screen picker with Screen coming soon until screen recording lands, the record button, the flip button and the timer. The screen stays on and the system bars hide while recording.
  • Flipping. A recording keeps the shape it started with: a quarter turn waits until it ends, a half turn applies at once. A flip whose new camera fails opens the previous one again, so the recording carries on, as on iOS.
  • Permissions. The recorder asks for the camera and microphone once when it opens and checks again whenever it comes back to the front. Without the camera it shows "Cap needs your camera" with Open Settings; without the microphone it records without sound and shows Microphone off. The camera and microphone are declared as not required, so a device without them can still install the app.
  • Free plan and short recordings. On the free plan a recording stops itself at 5 minutes with the iOS message, the timer shows "/ 5:00" and turns orange with a haptic for the last 30 seconds, and the idle recorder says so. A recording shorter than one second is thrown away with "Recording was too short" and its Cap is deleted.
  • Discarding. Closing or going back while recording asks "Discard this recording?"; Discard cancels the writer and deletes the job and its Cap. Closing is not possible while a recording is finishing.
  • Backgrounding and interruptions. Going to the background stops the recording, keeps what was recorded and closes the camera, which opens again on return. A camera taken away by the system stops a recording the same way.
  • Recent recordings. As in the iOS RecentRecordings: up to six recordings, the newest three shown, each with its upload progress, ready or failed. The newest link is copied when its recording stops, or when its Cap is created if that comes later, as iOS does in RecordingCoordinator.swift, with a toast when the recorder is not showing. A failed upload shows why and has its Cap deleted. Tapping a row opens its Cap. The list starts empty when another account signs in.
  • Upload notification. Once a recording stops and its Cap exists, its upload shows in the shade as "Uploading recording" with its percentage, then "Ready to share" or the error, through the Live Updates PR's RecordingUploadFeed, with the same throttle, stale state and dismissal as other uploads.
  • Waiting for unfinished jobs. The recent list is a second collector of the recording events, so the upload worker now waits on a revision counter instead of taking events, and cannot miss the one that ends its wait.

Screenshots

The recorder on the API 37 emulator, filming the emulator's virtual back camera scene, in the light and dark system themes. Taken at 1ed64d194, this PR's tip, so they include the status bar fix: the recorder is always dark and its status bar icons stay white in both themes. While recording, the system bars are hidden.

Light Dark
Ready Camera recorder ready, white status bar icons, light theme Camera recorder ready, white status bar icons, dark theme
Recording Camera recorder recording, light theme Camera recorder recording, dark theme
Discard confirmation Discard this recording? dialog, light theme Discard this recording? dialog, dark theme
Recent recordings Two camera recordings in the recent list, light theme Two camera recordings in the recent list, dark theme
Camera permission request System camera permission request over the recorder, light theme System camera permission request over the recorder, dark theme
Camera blocked Cap needs your camera, with Open Settings, light theme Cap needs your camera, with Open Settings, dark theme

In the dark recent list, Android's own clipboard preview shows the link that was just copied.

The last 30 seconds warning, on a free account 4:39 into a recording. The timer turns orange 30 seconds before the five minute stop. Light theme only.

Timer at 4:39 of 5:00 in orange

Where it differs from iOS, on purpose

  • The camera stops in the background. Android does not let an app record from the camera in the background, so leaving the app stops the recording and keeps it rather than pausing.
  • The 5 minute limit lives with the recorder. The free plan stop is part of RecordModel, not the shared recording limits, so it is tested with the recorder's transitions.
  • No upgrade link. iOS shows it only on the US App Store, so it stays behind a flag that is off.
  • No test camera source in the app. The media tests use the emulator's image cameras for a known picture instead.
  • Date in titles. A recording's title uses the device locale's medium date and short time, which is close to, but not the same as, the iOS format.

Tests

  • capkit, :capkit:test: 269 tests, 1 new: the wait for unfinished jobs ends while something else collects the recording events.
  • JVM, :app:testDebugUnitTest: 489 tests on edc680317 and 495 on the merge, 27 of them new (two more after review, below). RecordModelTest (22) goes through each row of the recorder's transition table on virtual time against a loopback server and real recording uploads: permissions, camera failure, recording, stopping, the too-short discard with its Cap deleted, a writer failure that keeps what is on disk, the 5 minute stop without waiting 5 minutes, discard, teardown, upload failure, interruption, backgrounding, a failed flip and rotation. RecordingCoordinatorTest (5) checks the automatic link copy, a failed upload's message and deleted Cap, the list's length, the updates fed to the upload notification from uploading to failed, and that another account starts with an empty list.
  • media, :media:testDebugUnitTest: 61 tests, 31 of them new: FrameGeometryTest 9, PcmConverterTest 8, CameraChoiceTest 7 and FrameClockTest 7.
  • Instrumented, app: new RecorderTest (3) checks that the recorder offers Instant Mode and the camera, that the other capture modes say they are coming soon, and that closing it returns to Caps. MainShellTest now grants the camera and microphone and looks for "Instant Mode" on the Record tab. RecordingNotificationsTest (1) is described under the review fixes below.
  • Instrumented, media, 28 new: GlFrameRendererTest (16) for orientation, mirroring, cropping, the encoder outliving the viewfinder and the capture clock; CameraCaptureTest (9) for 10 seconds of camera and microphone as 2 second segments, a flip mid-recording without a gap, a scene staying upright and unmirrored across a flip, interruptions and repeated open and close; MicrophoneCaptureTest (3).

Device pass

Pinned to one run at 13954befa, the screen recorder PR's tip, which contains this PR. Both emulators ran headless against a local fixture server. RecorderTest and the media camera tests ran once per API level.

API 37 (cap_cam_37) API 29 (cap_cam_29)
App instrumented 93 run, 90 passed, 3 failed 93 run, 93 passed
Media instrumented 41 run, 37 passed, 4 skipped 41 run, 35 passed, 6 skipped

The 3 API 37 failures are the known Cap detail ones, listed separately because they are not in this PR's code: CapDetailTest.playAndPause and aShareLinkWithATimeOpensTheCapThere (Compose did not go idle while the emulator decoded the video) and aChosenSpeedIsKeptAfterTheAppIsOpenedAgain (touch input could not be injected). The skipped tests are all in CameraCaptureTest, which skips what the emulator's cameras cannot do: two cameras, a flip, or the frame rate it asks for. The crash buffers were empty after every suite.

The front camera tests need an AVD with an emulated front camera. The cap_phone_* AVDs have hw.camera.front=none, so this run used cap_cam_37 and cap_cam_29, booted with -camera-front emulated and -camera-back emulated.

Fixed after review

  • The recorder is always dark, but in the light theme the status bar kept its dark icons, so the clock and signal were nearly invisible over it. The recorder now asks for light icons while it is showing and puts back the previous appearance when it closes (19807755e). The new RecorderTest.theRecorderShowsLightStatusBarIconsAndRestoresThemOnClose failed without the fix on the API 37 emulator in the light theme and passes with it.
  • The five minute limit was lifted only when the session knew the plan was upgraded, and the plan lived in memory only, so a Cap Pro account whose plan request failed was stopped at five minutes. The session now saves each plan it fetches and falls back to the saved one when the request fails (f68a4661b). The new RecordModelTest.capProKeepsNoLimitWhenThePlanCannotBeFetched fails without the fix.
  • A Cap Pro account confirmed during a recording was still stopped at five minutes, because the limit was settled from the plan known when the recording started. The recorder now waits the five minutes and then checks the plan, and the plan request reads the saved plan first (712104580). The new RecordModelTest.aProPlanConfirmedDuringARecordingLiftsTheFiveMinuteStop fails without the fix.
  • Someone who only recorded, without importing anything first, was never asked for notification permission on Android 13 and later, so the upload progress, completion and failure notifications were dropped. Closing the recorder now asks, as the import flows do, once there is a recording in the recent list (14cfec5ff). The new RecordingNotificationsTest.closingTheRecorderAfterARecordingAsksForNotifications (092644604) revokes the permission, records 2 seconds of camera through the test's loopback relay, which now serves the recording endpoints, closes the recorder and waits for the system permission dialog. 48d38ff0c makes it wait for the camera to be ready before it records. On the API 37 emulator it fails without the fix, as no dialog appears, and passes with it.
  • A video that finished playing under the recorder turned keepScreenOn off for the whole window, so the screen could sleep and stop a camera recording. The player and the recorder now each use Modifier.keepScreenOn(), which Compose counts per window, so neither can clear the other's request (15861a5e8). CapDetailTest.aVideoThatStopsUnderTheRecorderLeavesTheScreenOnForTheRecording plays a Cap, opens the recorder over it, starts a recording and pauses the video, then checks the screen is still kept on. It passes on the API 29 emulator and fails against the code before the fix (5c23ceaf3).
  • The recording engine now gives up on an encoder that never finishes draining and completes with an UNFINISHED failure that carries the seconds it kept (feat(mobile-android): add the recording engine #4764). The recorder already kept the segments on disk after a writer failure; it now also says "Couldn't finish saving, N s kept" (dfdb927d4). RecordModelTest.anEncoderThatNeverFinishesSavesWhatWasKeptAndSaysSo fails without the fix ("expected:<Couldn't finish saving, 3 s kept> but was:") and passes with it. The merge that brought in the deadline (effb7ce6f) met d45d50ed7 in SegmentWriter.finish. That fix holds a finishing writer in a static set so it cannot be finalised with its codecs while it waits for the end of stream. Both are kept: finish starts the deadline and adds the writer to the set, and releasing the writer, on success, failure or the deadline, removes it.

Checked

  • ./gradlew spotlessCheck :capkit:test :app:testDebugUnitTest :app:lintDebug :app:assembleDebug :app:assembleRelease :app:assembleDebugAndroidTest :media:testDebugUnitTest :media:lintDebug :media:assembleDebugAndroidTest passes on edc680317, on the merge, 91cadad00, on f68a4661b after the review fixes, with 269 capkit, 496 app and 61 media JVM tests, on the second merge, 1ed64d194, with 270 capkit, 505 app and 61 media JVM tests, on 712104580 with 270 capkit, 506 app and 61 media JVM tests, and on the third merge, 62a61d6fb, on 14cfec5ff, on 092644604 and on 48d38ff0c, with 272 capkit, 506 app and 61 media JVM tests, on the fourth merge, aae17d165, with 272 capkit, 513 app and 61 media JVM tests, and on the fifth merge, 759a73c8f, on 15861a5e8 and on 5c23ceaf3, each with 273 capkit, 520 app and 61 media JVM tests. With the drain deadline, the check line passes at the top of the Android stack, 276cfebaa, which contains dfdb927d4.

Not checked

  • RecorderTest 20 times in a row. It touches timing, and the device pass above ran it once per API level.
  • On a physical phone, which the emulator cannot stand in for:
    1. The camera in real time; the API 29 emulator never reaches the 29 fps the camera tests ask for.
    2. Real sensor orientation, and that the front camera's saved video is upright and not mirrored.
    3. The hardware encoder fed from OpenGL.
    4. A 15 second front camera recording with a flip in the middle, against a real Cap server: one recording with consecutive segments, upright on both sides of the flip, the link on the clipboard, and the Cap playing.
    5. Pressing Home while recording keeps the recording.
    6. Denying the camera shows the blocked view, and Open Settings opens the app's settings.
    7. Screenshots: ready, recording, the last 30 seconds warning, blocked and the recent list.
  • Releasing the renderer straight after the camera closes when leaving the recorder.
  • An activity recreated for a theme or locale change while recording discards the recording.
  • The title's date format against iOS.

Confidence Score: 0/5RetriggerView in Greptile

This PR still needs fixes before merging, especially for organization-only sharing and hidden recording upload failures.

Findings

  1. P1 Upgrades leave recordings limited ▶
  2. P1 Security Organization-only sharing can be public ▶
  3. P1 Upload failures lose their message ▶
  4. P1 Camera switching disappears during recording ▶
  5. P2 Help opens a missing page ▶
  6. P2 Audience controls disappear on failure ▶
  7. P2 Automatic stop has no warning ▶
  8. P2 Save message appears too early ▶
Fix with agent prompt
### Issue 1
apps/mobile-android/app/src/main/kotlin/so/cap/mobile/features/settings/SettingsScreen.kt:110-112
Removing the resume check means returning from a browser upgrade no longer refreshes the plan. `SessionModel` fetches it at sign-in, and `RecordModel.prepare()` fetches it only when `plan` is null. Someone who upgrades from Free to Pro therefore stays Free in the app and still gets stopped after five minutes until they restart the app. Restore a plan refresh when Settings resumes.

### Issue 2
apps/mobile-android/app/src/main/kotlin/so/cap/mobile/features/cap/CapManagement.kt:64-69
`loadSharingAudience()` reads the active organization's settings, not the Cap's organization. An owner can open an older Cap by link after switching organizations. If the active organization requires an email domain and disables public overrides, but the Cap's organization has no restriction, the sheet offers “Only people in your organization” and calls `setPublic(true)`. The server then publishes the Cap without limiting its viewers.

Load the audience rules for the Cap itself before offering this choice.

**How this was verified:** Owners can open their Caps across organizations, the settings request uses `user.activeOrganizationId`, and sharing writes apply the rules joined through the Cap's `orgId`.

### Issue 3
apps/mobile-android/app/src/main/kotlin/so/cap/mobile/features/record/RecordScreen.kt:357-358
The replacement page no longer renders `RecentRecordingsList`; it only reads the newest Cap's ID. This removes upload progress and failure messages from the recorder. `RecordingCoordinator` suppresses failure toasts while this page is visible and deletes failed Caps, so users can lose a share link without seeing why. Keep recent upload states visible or show failures another way.

### Issue 4
apps/mobile-android/app/src/main/kotlin/so/cap/mobile/features/record/RecordScreen.kt:undefined-382
The flip button is now inside `if (open)`, but `open` is false during live and paused recordings. `RecorderHome` also hides the accessory in those states. Users can no longer switch cameras mid-recording, even though `RecordModel.flip()` still supports it. Keep a flip control available while recording.

### Issue 5
apps/mobile-android/app/src/main/kotlin/so/cap/mobile/features/settings/SettingsScreen.kt:undefined-484
The Help & Support row now opens `https://cap.so/help`, but the web app has no page or redirect for `/help`. It falls through to the page that calls `notFound()` for unknown names, so users get a missing-page screen instead of help. Keep using `environment.supportUrl`, which points to `/docs`, or use another existing support page.

```suggestion
        onClick = { openInAppBrowser(context, "https://cap.so/docs") },
```

### Issue 6
apps/mobile-android/app/src/main/kotlin/so/cap/mobile/features/cap/MoreMenu.kt:229-230
A failed organization-settings request silently removes every audience choice, including “Only you and your team.” `sharingAudience` stays null, and the sheet shows neither an error nor a retry button. A temporary network or server failure therefore prevents the owner from changing visibility in this sheet.

Keep the private choice available and show a retry for the choices that need organization settings.

### Issue 7
apps/mobile-android/app/src/main/kotlin/so/cap/mobile/features/record/RecordScreen.kt:300-301
The new timer shows only elapsed time and no longer uses `model.limit` or `RecordTimer`. This drops the free-plan notice, “/ 5:00,” and the orange warning and haptic for the last 30 seconds, while the automatic stop remains. Carry those warnings into the new page so users can finish before it stops them.

### Issue 8
apps/mobile-android/app/src/main/kotlin/so/cap/mobile/features/record/RecordScreen.kt:346-349
Pressing Stop immediately sets `savedCapture` and displays “Stopped. The link is already copied.” Saving has not finished yet. Recordings under one second are then deleted, and slow Cap creation can delay copying the link. Set the saved state after a successful save, and show the copied message only after the link is copied.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

This update fixes four previously reported recorder problems:

  • Android users can record a Cap with their camera and microphone.
  • Stopped recordings upload in the background and appear in a recent list.
  • Android users can manage and watch Caps in a native app.
  • Mobile sign-in and organization settings return the fields the apps need.
  • CI checks the Android app when mobile code changes.

No new findings were accepted.

AatmanAJ acknowledged that copying the link on stop, or at creation if creation finishes later, is intentional because it matches iOS. The earlier link-copy finding was withdrawn.

Reviews (27) · Last reviewed commit: "test(mobile-android): use the camera mic..." · Reviewed by Greptile

@vercel

vercel Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

@AatmanAJ is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

Comment thread .github/workflows/ci.yml Resolved
@AatmanAJ

AatmanAJ commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

1 similar comment
@AatmanAJ

AatmanAJ commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

@AatmanAJ

AatmanAJ commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

@AatmanAJ

AatmanAJ commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

3 similar comments
@AatmanAJ

AatmanAJ commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

@AatmanAJ

AatmanAJ commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

@AatmanAJ

AatmanAJ commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

@AatmanAJ

AatmanAJ commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

4 similar comments
@AatmanAJ

AatmanAJ commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

@AatmanAJ

AatmanAJ commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

@AatmanAJ

AatmanAJ commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

@AatmanAJ

AatmanAJ commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

@AatmanAJ

AatmanAJ commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

clock = clock,
microphoneOn = model.microphoneOn,
cameraOn = cameraOn,
cameraVisible = false,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Camera preview stays hidden

RecordScreen passes cameraVisible = false to RecorderHome. This keeps the only camera preview at zero scale and opacity, before and during recording. Users cannot frame their shot or check which camera is recording. Show the preview for camera recordings.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/mobile-android/app/src/main/kotlin/so/cap/mobile/features/record/RecordScreen.kt
Line: 368

Comment:
**Camera preview stays hidden**

`RecordScreen` passes `cameraVisible = false` to `RecorderHome`. This keeps the only camera preview at zero scale and opacity, before and during recording. Users cannot frame their shot or check which camera is recording. Show the preview for camera recordings.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +132 to +133
BoxWithConstraints(
modifier.fillMaxSize().background(colors.background).pointerInput(modes, selected, open) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Camera errors are covered

Controls now draws an opaque, full-screen RecorderHome over Blocked and the loading indicator. Denying camera permission hides both the explanation and “Open Settings.” Camera startup failures are hidden too. Draw these states above the recorder page or include them inside it.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/mobile-android/app/src/main/kotlin/so/cap/mobile/features/record/RecorderHome.kt
Line: 132-133

Comment:
**Camera errors are covered**

`Controls` now draws an opaque, full-screen `RecorderHome` over `Blocked` and the loading indicator. Denying camera permission hides both the explanation and “Open Settings.” Camera startup failures are hidden too. Draw these states above the recorder page or include them inside it.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +162 to +164
private fun setMicrophone(enabled: Boolean) {
microphoneOn = enabled
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Unmuting records no voice

When a recording starts muted, job.hasAudio is false, so CameraRecorder creates neither a microphone capture nor an audio encoder. The new SetMicrophone command only changes a Boolean. Unmuting then shows the microphone as on, but the saved recording stays silent. Keep an audio track available for live unmuting, or prevent this unsupported action.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/mobile-android/app/src/main/kotlin/so/cap/mobile/features/record/CameraRecorder.kt
Line: 162-164

Comment:
**Unmuting records no voice**

When a recording starts muted, `job.hasAudio` is false, so `CameraRecorder` creates neither a microphone capture nor an audio encoder. The new `SetMicrophone` command only changes a Boolean. Unmuting then shows the microphone as on, but the saved recording stays silent. Keep an audio track available for live unmuting, or prevent this unsupported action.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +237 to +252
fun toggleRecordingPause() {
val recording = phase as? RecordPhase.Recording ?: return
val now = timeSource.markNow()
phase =
if (recording.paused) {
val pausedAt = checkNotNull(recording.pausedAt)
recording.copy(
pausedAt = null,
pausedBefore = recording.pausedBefore + pausedAt.elapsedNow(),
elapsedAtPause = null,
)
} else {
val elapsed = recording.startedAt.elapsedNow() - recording.pausedBefore
recording.copy(pausedAt = now, elapsedAtPause = elapsed)
}
send(RecorderCommand.SetPaused(!recording.paused))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Pauses consume recording time

The new pause action freezes the displayed time and cuts paused time from the video, but leaves limitJob running. A free user who records for one minute and pauses for four minutes is stopped with only one minute saved. Pause and resume the limit alongside the recording, while keeping the plan check when the limit is reached.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/mobile-android/app/src/main/kotlin/so/cap/mobile/features/record/RecordModel.kt
Line: 237-252

Comment:
**Pauses consume recording time**

The new pause action freezes the displayed time and cuts paused time from the video, but leaves `limitJob` running. A free user who records for one minute and pauses for four minutes is stopped with only one minute saved. Pause and resume the limit alongside the recording, while keeping the plan check when the limit is reached.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +357 to +358
val latest = coordinator.recent.firstOrNull()
RecorderHome(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Upload failures lose their message

The replacement page no longer renders RecentRecordingsList; it only reads the newest Cap's ID. This removes upload progress and failure messages from the recorder. RecordingCoordinator suppresses failure toasts while this page is visible and deletes failed Caps, so users can lose a share link without seeing why. Keep recent upload states visible or show failures another way.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/mobile-android/app/src/main/kotlin/so/cap/mobile/features/record/RecordScreen.kt
Line: 357-358

Comment:
**Upload failures lose their message**

The replacement page no longer renders `RecentRecordingsList`; it only reads the newest Cap's ID. This removes upload progress and failure messages from the recorder. `RecordingCoordinator` suppresses failure toasts while this page is visible and deletes failed Caps, so users can lose a share link without seeing why. Keep recent upload states visible or show failures another way.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

onClose = onClose,
cameraPreview = cameraPreview,
) {
if (open) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Camera switching disappears during recording

The flip button is now inside if (open), but open is false during live and paused recordings. RecorderHome also hides the accessory in those states. Users can no longer switch cameras mid-recording, even though RecordModel.flip() still supports it. Keep a flip control available while recording.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/mobile-android/app/src/main/kotlin/so/cap/mobile/features/record/RecordScreen.kt
Line: 382

Comment:
**Camera switching disappears during recording**

The flip button is now inside `if (open)`, but `open` is false during live and paused recordings. `RecorderHome` also hides the accessory in those states. Users can no longer switch cameras mid-recording, even though `RecordModel.flip()` still supports it. Keep a flip control available while recording.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +300 to +301
val liveSeconds = ticking.let { cameraRecording?.elapsedNow()?.inWholeSeconds ?: 0L }
val clock = recordingClock(liveSeconds)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Automatic stop has no warning

The new timer shows only elapsed time and no longer uses model.limit or RecordTimer. This drops the free-plan notice, “/ 5:00,” and the orange warning and haptic for the last 30 seconds, while the automatic stop remains. Carry those warnings into the new page so users can finish before it stops them.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/mobile-android/app/src/main/kotlin/so/cap/mobile/features/record/RecordScreen.kt
Line: 300-301

Comment:
**Automatic stop has no warning**

The new timer shows only elapsed time and no longer uses `model.limit` or `RecordTimer`. This drops the free-plan notice, “/ 5:00,” and the orange warning and haptic for the last 30 seconds, while the automatic stop remains. Carry those warnings into the new page so users can finish before it stops them.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +346 to +349
model.isRecording -> {
haptics.performHapticFeedback(HapticFeedbackType.ToggleOff)
savedCapture = SavedCapture(liveSeconds)
model.stop()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Save message appears too early

Pressing Stop immediately sets savedCapture and displays “Stopped. The link is already copied.” Saving has not finished yet. Recordings under one second are then deleted, and slow Cap creation can delay copying the link. Set the saved state after a successful save, and show the copied message only after the link is copied.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/mobile-android/app/src/main/kotlin/so/cap/mobile/features/record/RecordScreen.kt
Line: 346-349

Comment:
**Save message appears too early**

Pressing Stop immediately sets `savedCapture` and displays “Stopped. The link is already copied.” Saving has not finished yet. Recordings under one second are then deleted, and slow Cap creation can delay copying the link. Set the saved state after a successful save, and show the copied message only after the link is copied.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@AatmanAJ

AatmanAJ commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

@AatmanAJ

AatmanAJ commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

…id-design-system

# Conflicts:
#	apps/mobile-android/app/build.gradle.kts

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant