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 |
|
@greptileai review |
|
@greptileai review |
|
@greptileai review |
3 similar comments
|
@greptileai review |
|
@greptileai review |
|
@greptileai review |
| primary = CapColorTokens.Blue, | ||
| onPrimary = CapColorTokens.White, |
There was a problem hiding this comment.
Small blue text loses contrast
LightColorScheme.primary now uses #4785FF against #FCFCFC, giving about 3.4:1 contrast instead of the previous colour’s roughly 4.8:1. Links, transcript timestamps, and text buttons use this colour. Selected library chips also put white text on this blue. This makes these labels harder to read, especially for people with low vision.
Keep the brand blue for decoration, but use a darker text colour in light mode and a readable foreground for filled chips.
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/designsystem/Color.kt
Line: 159-160
Comment:
**Small blue text loses contrast**
`LightColorScheme.primary` now uses `#4785FF` against `#FCFCFC`, giving about 3.4:1 contrast instead of the previous colour’s roughly 4.8:1. Links, transcript timestamps, and text buttons use this colour. Selected library chips also put white text on this blue. This makes these labels harder to read, especially for people with low vision.
Keep the brand blue for decoration, but use a darker text colour in light mode and a readable foreground for filled chips.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| CapRadioRow( | ||
| stringResource(R.string.cap_audience_organization), | ||
| selected = cap.isPublic && restricted, | ||
| onClick = { | ||
| management.setAudience(isPublic = true, LinkAccess.RESTRICTED) | ||
| }, |
There was a problem hiding this comment.
Organization-only sharing can expose recordings
If the organization has no email restriction, choosing “Only people in your organization” publishes a private recording to anyone with its link. This row always sends LinkAccess.RESTRICTED, but the server enforces that choice only when allowedEmailDomain is nonempty.
Only offer this choice when the server reports that organization restrictions are available; otherwise keep the recording private.
How this was verified: The organization row publishes the recording, while VideosPolicy checks email access only when the organization has a nonempty email restriction.
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/cap/MoreMenu.kt
Line: 237-242
Comment:
**Organization-only sharing can expose recordings**
If the organization has no email restriction, choosing “Only people in your organization” publishes a private recording to anyone with its link. This row always sends `LinkAccess.RESTRICTED`, but the server enforces that choice only when `allowedEmailDomain` is nonempty.
Only offer this choice when the server reports that organization restrictions are available; otherwise keep the recording private.
**How this was verified:** The organization row publishes the recording, while `VideosPolicy` checks email access only when the organization has a nonempty email restriction.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| if (showsLibraryChrome) { | ||
| LibraryHeader(session, library, onAdd, showsDetails = !showsDesignedEmpty) |
There was a problem hiding this comment.
Empty spaces hide library navigation
Opening an empty shared space sets showsDesignedEmpty to true. Passing showsDetails = false then removes ScopeBar, which contains the only controls for switching to My Caps or another space. The selected space is saved across launches, so restarting does not restore those controls.
Keep the scope controls visible when the current collection is empty.
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/home/LibraryContent.kt
Line: 124-125
Comment:
**Empty spaces hide library navigation**
Opening an empty shared space sets `showsDesignedEmpty` to true. Passing `showsDetails = false` then removes `ScopeBar`, which contains the only controls for switching to My Caps or another space. The selected space is saved across launches, so restarting does not restore those controls.
Keep the scope controls visible when the current collection is empty.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| val countdownJob = remember { SupervisorJob() } | ||
| val countdown = | ||
| remember(countdownJob) { | ||
| RecordingCountdown(CoroutineScope(countdownJob + Dispatchers.Default)) | ||
| } | ||
| DisposableEffect(countdownJob) { onDispose { countdownJob.cancel() } } |
There was a problem hiding this comment.
Countdown survives leaving Cap
The countdown job is cancelled only when the recorder leaves composition. ON_STOP pauses RecordModel but leaves the countdown running. If the user backgrounds Cap or locks the phone during a screen or Studio countdown, the delayed action still starts the foreground service. On Android versions that restrict background camera and microphone starts, this can throw instead of starting the recording.
Cancel pending starts when the activity stops, or wait until it is foregrounded again.
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: 139-144
Comment:
**Countdown survives leaving Cap**
The countdown job is cancelled only when the recorder leaves composition. `ON_STOP` pauses `RecordModel` but leaves the countdown running. If the user backgrounds Cap or locks the phone during a screen or Studio countdown, the delayed action still starts the foreground service. On Android versions that restrict background camera and microphone starts, this can throw instead of starting the recording.
Cancel pending starts when the activity stops, or wait until it is foregrounded again.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| when { | ||
| showsDesignedEmpty -> { | ||
| LibraryEmptyState(Modifier.fillMaxSize()) | ||
| } | ||
| loadedEmpty -> { | ||
| Box(Modifier.fillMaxSize(), Alignment.Center) { | ||
| EmptyState( | ||
| icon = R.drawable.ic_video_library, | ||
| title = stringResource(R.string.home_folder_empty_title), | ||
| modifier = Modifier.padding(horizontal = CapTheme.pageMargin), | ||
| description = stringResource(R.string.home_empty_space), | ||
| ) | ||
| } | ||
| } | ||
| else -> { |
There was a problem hiding this comment.
Empty libraries hide upload feedback
The new empty-page branches skip UploadBanner. A first upload stays invisible while Cap prepares the file. If preparation fails, the library remains empty, so the error and dismiss action stay hidden too.
Render the upload banner outside the empty/nonempty choice.
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/home/LibraryContent.kt
Line: 141-155
Comment:
**Empty libraries hide upload feedback**
The new empty-page branches skip `UploadBanner`. A first upload stays invisible while Cap prepares the file. If preparation fails, the library remains empty, so the error and dismiss action stay hidden too.
Render the upload banner outside the empty/nonempty choice.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Stacked on the polish PR (#4768), which sits on the earlier Android PRs. The 15 commits from
176485cbeto5dd38f373are new here, followed by43667eb6dandf0d3e38b52, which merge the polish branch at0ba4261deand then atfe5ddde9b5. Then come a merge of the polish branch (d7a3a93f0), two test fixes (c46ae7b51,5252ddf87), three more merges of the polish branch (1dc41e251,f39befdc9,bb2708697), the last of which brings in the recording engine's drain deadline, and a fix that keeps a Studio recording whose saving could not finish (80c259aa3). A last merge of the polish branch (5515305bc) 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.Studio Mode for the Android app: record the screen, the camera and the microphone as separate tracks on the phone, then trim, style and export the result before anything uploads, in the same way as desktop Cap's Studio Mode.
What is in it
StudioRecordingServicereuses the screen recording engine from feat(mobile-android): add screen recording #4767 and writes the screen with the microphone, plus the camera when it is on, as fragmented MP4 segments into a project undernoBackupFilesDir/studio. The foreground service types aremediaProjection, plusmicrophoneandcameraon API 30 and later (they do not exist on API 29). It records from the front camera, or the back camera when a phone has no front one. When recording stops,TrackFilesjoins each track's segments and muxes screen and microphone together. The camera's start offset against the screen is stored so the two line up. The notification reads "Tap to stop and edit it in Studio".StudioProjectmirrors desktop Cap's project configuration: clips, background (wallpaper, gradient or colour), padding, rounding, shadow, camera position, size, shape and mirroring, and zoom segments. The desktop gradient presets and eight of its wallpapers are included.StudioLayoutlays out the frame the same way for the live preview and the export, including the eased zoom and the camera shrinking while zoomed in.UndoHistorykeeps 100 steps.PreviewPlaybackinterface instead of a fork. The camera track plays muted alongside the screen.cache/exports, or save to Movies/Cap through MediaStore. A failed export shows an error saying what went wrong, for example that the phone's encoder could not handle it, and the recording is left untouched.Dependencies and size
androidx.media3:media3-transformerandmedia3-effect1.11.1, from the existingmedia3version catalogue entry. With what they bring in, the release runtime classpath goes from 195 to 203 artefacts:media3-transformer,media3-effect,media3-muxer,kotlinx-coroutines-guava, JSR 305, Error Prone annotations and J2ObjC annotations, all Apache 2.0, and Checker Framework qualifiers 3.43.0, MIT, each read from its POM. The README licence table is updated.app-release-unsigned.apk, R8 on): 6,971,541 bytes at327fd2925, the base of this PR, and 7,993,102 bytes at4f015387b, so 1,021,561 bytes more (7,994,030 bytes at5dd38f373, after the review fixes, and at43667eb6dandf0d3e38b52, after merging the polish branch). DEX grows by 381,140 bytes, for Media3 Transformer and Effect plus the new code, and compressed resources by 610,401 bytes, mostly the wallpapers. The wallpapers are already WebP at 1280 by 800 and about quality 75, eight of them totalling 567,534 bytes. Re-encoding them from the desktop originals saved 2 per cent at the same quality, so they are unchanged.:app:testReleaseShrunkUnitTestpasses with the new dependencies.Security
StudioRecordingServiceis not exported and only starts from the app after the system screen capture consent.${applicationId}.files) is not exported, grants read access per share intent only, and exposes onlycache/exports.noBackupFilesDir, so they are not part of cloud backups, and are removed on sign-out. Saving to Movies/Cap uses MediaStore withIS_PENDINGand needs no storage permission.FOREGROUND_SERVICE_CAMERA.CAMERAwas already there and is now also declared by the app, which lint requires for the camera service type.Screenshots
API 35 phone emulator, dark, from the debug gallery at
4f015387b. The last two are frames from a real export made on the emulator: a red background, then a zoom with the camera bubble shrunk on top.Fixed after review
079305824,cee19bf0d). Every edit started its own save, and all of them wrote through the same temporary file, so two quick edits could overwrite each other or leave an older one on disk. Edits now go through one queue that saves them in order, and a failed save shows "Cap couldn't save your changes." instead of being dropped. The queue belongs to the app's Studio projects rather than the editor, so closing the editor straight after an edit cannot cancel its save, and an edit still waiting to be written is what the project loads as if it is opened again. Tests:StudioProjectsTest.editsSaveInTheOrderTheyWereMadeAndTheLastOneWins,aProjectOpenedAgainBeforeItsLastEditIsWrittenShowsThatEditandaFailedSaveIsReportedAndTheNextEditStillSaves.ac90f47ac,0c4ea2426). Joining and muxing the tracks deleted the recorded segments even when it failed, for example on a full disk, and then deleted the project. The service now writes the recording's details next to its segments before assembling them, and keeps both if assembly fails, with a notification asking to free up space and open Cap. Each time Cap comes to the foreground it finishes any such recording and opens it in the editor. Tests:StudioTest.aRecordingThatCannotBeSavedKeepsItsTracksUntilCapCanFinishIt, which makes the real muxer fail on the device by putting a folder wherescreen.mp4goes, then sends Cap to the background and back, andStudioProjectsTest.aRecordingWithADraftButNoProjectIsUnfinishedUntilItIsFinished. If even the small details file cannot be written, the tracks are still kept, but Cap cannot finish that recording by itself.5dd38f373). Opening one, for example after signing out while its saved notice was pending, left the editor on a loading spinner. It now closes and returns to the library. Test:StudioTest.aStudioProjectThatIsGoneClosesInsteadOfLoadingForever.b24ce21d41retries it instead, and this PR includes that fix through the merge in43667eb6d.5d4081dc15marks it first, and this PR includes that fix through the merge inf0d3e38b52.4eabbf8c4). When the camera started after the screen, the preview clamped the camera clip to its start and played it early, while the export put a gap before it. The preview now waits out that gap clip by clip and hides the camera bubble until it starts. Reading the export path again for the same mismatch found the camera cutout skipped for the first seconds of the output whatever had been trimmed; it now follows the same per clip rule. Tests:CameraClipsTest, 6 cases.80c259aa3). The recording engine now gives up on an encoder that never finishes draining and completes with anUNFINISHEDfailure that carries the seconds it kept (feat(mobile-android): add the recording engine #4764). Studio treated any screen failure as a lost recording and deleted the project. It now saves the kept screen track, drops a camera track that did not finish as it does for other camera failures, and the saved notification says "Couldn't finish saving, N s kept". An encoder that stops answering cannot be forced on the emulator, so this has no test of its own.Each new test fails with its fix taken out and passes with it in place.
Tests
At
f0d3e38b52, after merging the polish branch atfe5ddde9b5:spotlessCheck :capkit:test :app:testDebugUnitTest :app:lintDebug :app:assembleDebug :app:assembleRelease :app:assembleDebugAndroidTest :media:testDebugUnitTest :media:lintDebug :app:testReleaseShrunkUnitTestpasses, with lint reporting no errors or warnings.:app:testDebugUnitTest: 567 tests. New: StudioProjectsTest (8: a saved project loads back, projects list newest first and skip unreadable folders, deleting a project removes its tracks and export, removing everything removes shared exports, and the four above) and CameraClipsTest (6).With the drain deadline, the check line passes at the top of the Android stack,
276cfebaa, which contains80c259aa3, and StudioTest passed 14 of 14 on API 35 there.Device runs
Against the fixture server, with emulators booted with an emulated front and back camera. The merge in
f0d3e38b52changes only the recording coordinator and its JVM test, so these runs were not repeated after it.4f015387b). At5dd38f373, all four classes pass 23 of 23, including the two new StudioTest cases. At43667eb6d, after merging the final polish branch, 23 of 23 again, with nothing in the crash buffer.c2.android.aac.decoderandc2.goldfish.h264.decoderboth logFailed to send buffer with BufferPool. Error: 4and thenqueueCSDInputBuffer failed w/ error 14. This is the same decoder failure seen on this image in feat(mobile-android): polish large screens, accessibility and release builds #4768, where fixture video could not play. Encoding works. At43667eb6d, on a freshly wiped emulator: 21 of 23. The review fixes pass here too, including the recording kept when it cannot be saved and finished when Cap comes back, and the project that no longer exists. The 2 failures are the same two exports, with the same decoder errors in the log and nothing in the crash buffer. Export on Android 17 still needs checking on a real phone.Left out
Captions, zooms driven by taps, scene and layout segments, and editing a project on another device. Desktop Cap has these, but none fits this first version. Screenshot Mode follows in the next PR.
Confidence Score: 1/5

Do not merge until organization-only sharing, empty-library navigation, and background countdown starts are fixed.
Findings
Fix with agent prompt
Summary
Adds Android Studio recording, local editing, and export, along with recording defaults and redesigned library, playback, sharing, and settings pages.
Reviews (15) · Last reviewed commit: "style(mobile-android): format the studio..." · Reviewed by Greptile