Repository navigation
Conversation
|
@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. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
|
@greptileai review |
1 similar comment
|
@greptileai review |
|
@greptileai review |
|
@greptileai review |
3 similar comments
|
@greptileai review |
|
@greptileai review |
|
@greptileai review |
|
@greptileai review |
4 similar comments
|
@greptileai review |
|
@greptileai review |
|
@greptileai review |
|
@greptileai review |
|
@greptileai review |
| clock = clock, | ||
| microphoneOn = model.microphoneOn, | ||
| cameraOn = cameraOn, | ||
| cameraVisible = false, |
There was a problem hiding this comment.
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.| BoxWithConstraints( | ||
| modifier.fillMaxSize().background(colors.background).pointerInput(modes, selected, open) { |
There was a problem hiding this comment.
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.| private fun setMicrophone(enabled: Boolean) { | ||
| microphoneOn = enabled | ||
| } |
There was a problem hiding this comment.
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.| 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)) |
There was a problem hiding this comment.
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.| val latest = coordinator.recent.firstOrNull() | ||
| RecorderHome( |
There was a problem hiding this 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.
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) { |
There was a problem hiding this 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.
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.| val liveSeconds = ticking.let { cameraRecording?.elapsedNow()?.inWholeSeconds ?: 0L } | ||
| val clock = recordingClock(liveSeconds) |
There was a problem hiding this comment.
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.| model.isRecording -> { | ||
| haptics.performHapticFeedback(HapticFeedbackType.ToggleOff) | ||
| savedCapture = SavedCapture(liveSeconds) | ||
| model.stop() |
There was a problem hiding this 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.
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.|
@greptileai review |
|
@greptileai review |
…id-design-system # Conflicts: # apps/mobile-android/app/build.gradle.kts
…oid-recording-engine
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 (
b0ed15449toedc680317), 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 in48d38ff0c) 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.
GlFrameRendererdraws 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.MicrophoneCapturerecords 48 kHz mono on the capture clock.CameraCaptureopens, flips and closes the camera with Camera2.RecordModelis a port of the iOSRecordModel: preparing, camera denied, unavailable, ready, recording and finishing. It drives the camera throughRecorderCommandvalues, whichCameraRecordercarries 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.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 inRecordingCoordinator.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.RecordingUploadFeed, with the same throttle, stale state and dismissal as other uploads.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.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.
Where it differs from iOS, on purpose
RecordModel, not the shared recording limits, so it is tested with the recorder's transitions.Tests
:capkit:test: 269 tests, 1 new: the wait for unfinished jobs ends while something else collects the recording events.:app:testDebugUnitTest: 489 tests onedc680317and 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:testDebugUnitTest: 61 tests, 31 of them new: FrameGeometryTest 9, PcmConverterTest 8, CameraChoiceTest 7 and FrameClockTest 7.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.cap_cam_37)cap_cam_29)The 3 API 37 failures are the known Cap detail ones, listed separately because they are not in this PR's code:
CapDetailTest.playAndPauseandaShareLinkWithATimeOpensTheCapThere(Compose did not go idle while the emulator decoded the video) andaChosenSpeedIsKeptAfterTheAppIsOpenedAgain(touch input could not be injected). The skipped tests are all inCameraCaptureTest, 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 havehw.camera.front=none, so this run usedcap_cam_37andcap_cam_29, booted with-camera-front emulatedand-camera-back emulated.Fixed after review
19807755e). The newRecorderTest.theRecorderShowsLightStatusBarIconsAndRestoresThemOnClosefailed without the fix on the API 37 emulator in the light theme and passes with it.f68a4661b). The newRecordModelTest.capProKeepsNoLimitWhenThePlanCannotBeFetchedfails without the fix.712104580). The newRecordModelTest.aProPlanConfirmedDuringARecordingLiftsTheFiveMinuteStopfails without the fix.14cfec5ff). The newRecordingNotificationsTest.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.48d38ff0cmakes 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.Modifier.keepScreenOn(), which Compose counts per window, so neither can clear the other's request (15861a5e8).CapDetailTest.aVideoThatStopsUnderTheRecorderLeavesTheScreenOnForTheRecordingplays 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).UNFINISHEDfailure 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.anEncoderThatNeverFinishesSavesWhatWasKeptAndSaysSofails 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) metd45d50ed7inSegmentWriter.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:finishstarts 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:assembleDebugAndroidTestpasses onedc680317, on the merge,91cadad00, onf68a4661bafter 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, on712104580with 270 capkit, 506 app and 61 media JVM tests, and on the third merge,62a61d6fb, on14cfec5ff, on092644604and on48d38ff0c, 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, on15861a5e8and on5c23ceaf3, 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 containsdfdb927d4.Not checked
Confidence Score: 0/5

This PR still needs fixes before merging, especially for organization-only sharing and hidden recording upload failures.
Findings
Fix with agent prompt
Summary
This update fixes four previously reported recorder problems:
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