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 |
1 similar comment
|
@greptileai review |
|
@greptileai review |
| endDistance <= slop && endDistance <= startDistance -> ArrowEnd.END | ||
| startDistance <= slop -> ArrowEnd.START |
There was a problem hiding this comment.
Arrow handles miss nearby presses
distance() returns a squared distance, but arrowEndAt() compares it with the unsquared slop. This shrinks the handles’ touch area from slop to its square root. On a full-size screenshot shown in the small preview, pressing near a visible handle can move the whole arrow instead of resizing its end.
Compare with slop * slop, or return the actual distance.
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/screenshot/ScreenshotEditorModel.kt
Line: 321-322
Comment:
**Arrow handles miss nearby presses**
`distance()` returns a squared distance, but `arrowEndAt()` compares it with the unsquared `slop`. This shrinks the handles’ touch area from `slop` to its square root. On a full-size screenshot shown in the small preview, pressing near a visible handle can move the whole arrow instead of resizing its end.
Compare with `slop * slop`, or return the actual distance.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| if (job != null) { | ||
| scope.launch { | ||
| val outcome = snapshotFlow { | ||
| job.shareUrl to job.phase | ||
| } | ||
| .first { (link, phase) -> | ||
| !link.isNullOrBlank() || phase is UploadPhase.Failed | ||
| } | ||
| val link = outcome.first | ||
| if (!link.isNullOrBlank()) copyLink(context, link, toasts) |
There was a problem hiding this comment.
Closing the editor cancels copying
The promised link copy runs in ScreenshotSession’s rememberCoroutineScope(). If the user taps Upload and closes the editor before createUpload returns, removing the route cancels this wait. The upload continues, but its link is never copied.
Keep the copy request with the upload job rather than the editor’s lifetime.
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/screenshot/ScreenshotRoute.kt
Line: 192-201
Comment:
**Closing the editor cancels copying**
The promised link copy runs in `ScreenshotSession`’s `rememberCoroutineScope()`. If the user taps Upload and closes the editor before `createUpload` returns, removing the route cancels this wait. The upload continues, but its link is never copied.
Keep the copy request with the upload job rather than the editor’s lifetime.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.|
@greptileai review |
|
@greptileai review |
| val appearance by settings.appearance.collectAsState(initial = Appearance.System) | ||
| val shareAnalytics by settings.shareUsageAnalytics.collectAsState(initial = false) | ||
| var confirmSignOut by remember { mutableStateOf(false) } | ||
| val context = LocalContext.current |
There was a problem hiding this comment.
Paid recordings still stop early
Returning from a web upgrade no longer refreshes session.plan. RecordModel.prepare() retries only when the plan is null, so an existing Free plan stays Free after payment. Camera recordings still stop after five minutes until the session restarts. Restore the refresh when Settings resumes.
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/settings/SettingsScreen.kt
Line: 111
Comment:
**Paid recordings still stop early**
Returning from a web upgrade no longer refreshes `session.plan`. `RecordModel.prepare()` retries only when the plan is null, so an existing Free plan stays Free after payment. Camera recordings still stop after five minutes until the session restarts. Restore the refresh when Settings resumes.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| ) | ||
| QuietRow( | ||
| label = stringResource(R.string.settings_help), | ||
| onClick = { openInAppBrowser(context, "https://cap.so/help") }, |
There was a problem hiding this comment.
The Help & Support row now opens https://cap.so/help, but the web app has no matching page or redirect. The fallback page also has no help entry, so users reach a not-found page instead of help. Keep using environment.supportUrl, which points to /docs.
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/settings/SettingsScreen.kt
Line: 484
Comment:
**Help opens a missing page**
The Help & Support row now opens `https://cap.so/help`, but the web app has no matching page or redirect. The fallback page also has no `help` entry, so users reach a not-found page instead of help. Keep using `environment.supportUrl`, which points to `/docs`.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.|
@greptileai review |
| val settings = api.organizationSettings() | ||
| val restricted = !settings.allowedEmailDomain.isNullOrBlank() | ||
| sharingAudience = | ||
| SharingAudience( | ||
| hasOrganizationRestriction = restricted, | ||
| canOpenToAnyone = restricted && settings.allowPublicLinkOverride, |
There was a problem hiding this comment.
Organization-only sharing can publish publicly
loadSharingAudience() reads the active organization's settings, not the organization that owns the Cap. Users can open a link to their own Cap in another organization without switching organizations.
If the active organization requires email access but the Cap's organization does not, the sheet offers “Only people in your organization” and calls setPublic(true). Anyone with the link can then watch. Return the sharing choices for this Cap from the server instead of using the active organization's settings.
How this was verified: Cap links do not switch organizations, owners can open their Caps across organizations, and the server applies link restrictions using the Cap's orgId.
Knowledge Base Used: Web application routes and components
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/CapManagement.kt
Line: 64-69
Comment:
**Organization-only sharing can publish publicly**
`loadSharingAudience()` reads the active organization's settings, not the organization that owns the Cap. Users can open a link to their own Cap in another organization without switching organizations.
If the active organization requires email access but the Cap's organization does not, the sheet offers “Only people in your organization” and calls `setPublic(true)`. Anyone with the link can then watch. Return the sharing choices for this Cap from the server instead of using the active organization's settings.
**How this was verified:** Cap links do not switch organizations, owners can open their Caps across organizations, and the server applies link restrictions using the Cap's `orgId`.
**Knowledge Base Used:** [Web application routes and components](https://app.greptile.com/-/switch-tenant?tenant=cap&next=%2Fcustom-context%2Fknowledge-base%2Fcapsoftware%2Fcap%2F-%2Fdocs%2Fweb-application-routes.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| val audience = management.sharingAudience | ||
| if (audience != null) { |
There was a problem hiding this comment.
Failed requests hide sharing choices
A failed settings request now hides every audience choice, including “Only you and your team.” loadSharingAudience() silently catches the error, and the sheet renders the choices only when sharingAudience is non-null.
After a temporary failure, owners see no explanation or retry and must close and reopen the sheet. Keep the private choice available and show an error with a retry for the other choices.
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: 229-230
Comment:
**Failed requests hide sharing choices**
A failed settings request now hides every audience choice, including “Only you and your team.” `loadSharingAudience()` silently catches the error, and the sheet renders the choices only when `sharingAudience` is non-null.
After a temporary failure, owners see no explanation or retry and must close and reopen the sheet. Keep the private choice available and show an error with a retry for the other choices.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.… feat/mobile-android-studio
…into feat/mobile-android-screenshot
|
@greptileai review |
| .drawBehind { | ||
| if (highlighted) { | ||
| drawRoundRect( |
There was a problem hiding this comment.
Camera video covers its outline
The new camera outline uses drawBehind, underneath the video that fills the same box. The video covers the dashed outline when a frame is shown, so selecting the Camera tool does not show the intended highlight. Draw the outline after the camera content instead.
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/studio/StudioStage.kt
Line: 223-225
Comment:
**Camera video covers its outline**
The new camera outline uses `drawBehind`, underneath the video that fills the same box. The video covers the dashed outline when a frame is shown, so selecting the Camera tool does not show the intended highlight. Draw the outline after the camera content instead.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.…android-recording-engine
…ndroid-screen-recorder
|
@greptileai review |
| model.updateMicrophonePermission( | ||
| RuntimeAppPermission.Microphone.granted(context) | ||
| ) | ||
| if (outcome == PermissionOutcome.Granted) model.toggleScreenMicrophone() |
There was a problem hiding this comment.
Granting access leaves sound off
With the default microphoneOn = true, granting access calls updateMicrophonePermission(true), which enables screenMicrophone. The next call to toggleScreenMicrophone() immediately disables it. Users who tap the muted microphone and grant access must tap again to record sound. Set the requested state explicitly after granting access instead of toggling the restored default.
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: 737-740
Comment:
**Granting access leaves sound off**
With the default `microphoneOn = true`, granting access calls `updateMicrophonePermission(true)`, which enables `screenMicrophone`. The next call to `toggleScreenMicrophone()` immediately disables it. Users who tap the muted microphone and grant access must tap again to record sound. Set the requested state explicitly after granting access instead of toggling the restored default.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| private fun completeFirstRun() { | ||
| compose.onNode(hasText("Allow what you'll use.")).performScrollTo().assertIsDisplayed() | ||
| compose.onNode(hasText("Screen capture")).performScrollTo().assertIsDisplayed() | ||
| compose.onNode(hasText("Continue")).performScrollTo().performClick() |
There was a problem hiding this comment.
Sign-in tests share onboarding state
The new completeFirstRun() calls always require onboarding to appear, but completing onboarding saves firstRun = true. SignInTest clears only the credential vault between tests. Later sign-in tests therefore skip onboarding and fail when this helper requires its title. Reset firstRun in the test setup so each test starts from the state it expects.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/mobile-android/app/src/androidTest/kotlin/so/cap/mobile/SignInTest.kt
Line: 123-126
Comment:
**Sign-in tests share onboarding state**
The new `completeFirstRun()` calls always require onboarding to appear, but completing onboarding saves `firstRun = true`. `SignInTest` clears only the credential vault between tests. Later sign-in tests therefore skip onboarding and fail when this helper requires its title. Reset `firstRun` in the test setup so each test starts from the state it expects.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| PermissionRow( | ||
| title = stringResource(R.string.first_run_overlay), | ||
| detail = stringResource(R.string.first_run_overlay_detail), | ||
| allowed = overlayGranted, | ||
| first = true, | ||
| onAllow = { openOverlaySettings(context) }, |
There was a problem hiding this comment.
Overlay access cannot be enabled
The new “Show over other apps” action asks users to grant a permission that no app manifest declares. Settings.canDrawOverlays(context) cannot become true through this flow, so returning from Settings leaves the row showing Allow. Remove the row until overlays are supported, or declare and implement the permission it offers.
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/auth/FirstRunScreen.kt
Line: 106-111
Comment:
**Overlay access cannot be enabled**
The new “Show over other apps” action asks users to grant a permission that no app manifest declares. `Settings.canDrawOverlays(context)` cannot become true through this flow, so returning from Settings leaves the row showing Allow. Remove the row until overlays are supported, or declare and implement the permission it offers.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Stacked on the Studio Mode PR (#4774), which sits on the polish PR (#4768) and the earlier Android PRs. The commits from
da656493atod106f6ea47are new here: the feature in four commits, a merge of the Studio branch at43667eb6d(538d08f6a), seven fixes from review, and a second merge of the Studio branch atf0d3e38b52(d106f6ea47), which brings in the fix that marks a recording's link as copied before it reaches the clipboard (5d4081dc15). A last merge of the Studio branch (681fdcb21) 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.Screenshot Mode for the Android app: take a screenshot of the phone after a short countdown, or import one, then frame it and mark it up the way desktop Cap's screenshot editor does, and copy, share, save or upload the result.
What is in it
ScreenshotServiceis a foreground service of typemediaProjection. After the system screen capture consent, Cap moves to the background and shows a countdown notification. When it ends, the service creates a virtual display at the screen's full resolution, takes its first frame from anImageReader, stops the projection and saves the frame as a PNG. A notification says the screenshot is ready, and Cap opens the editor the next time it is in front, in the same way a finished Studio recording opens. The notification carries the screenshot's ID, so tapping it opens the screenshot even after the editor was closed or Android stopped Cap. If no frame arrives within 3 seconds, or the projection cannot start, a notification says the screenshot failed.PickVisualMedia, images only), so no storage permission is needed. Images longer than 4,096 pixels are scaled down, the same limit as photo uploads.ScreenshotProjectkeeps the image size, the background, padding, rounding and shadow shared with Studio, an optional crop and the annotations. Field and enum names follow desktop Cap's screenshot editor: arrow, rectangle, circle, text, draw, highlight and mask, with blur or pixelate masks.UndoHistoryfrom feat(mobile-android): Studio Mode, record separate tracks, edit and export on the phone #4774. The Style tool reuses Studio's background panel and aspect ratios. A shape is saved when the finger lifts. A crop smaller than 32 pixels and text left blank change nothing.Fixed after review
Each fix has a test that failed before it.
4d5f1186bb). Signing out deleted screenshots but leftScreenshotServicerunning, so a countdown or save could write a capture after the clean-up for the next account to open. Signing out now stops the capture and waits for it first.6d6c5aa408). A new capture or import deleted the previous screenshot before writing its own files, so a failed write lost both.a15a7fe3c3). The notification only opened Cap and relied on state held in memory, so it did nothing once that state was gone.52b25b7381). Resizing the canvas to the crop during the drag restarted the gesture and saved the crop at its first usable size. The canvas now keeps the uncropped layout with the crop outlined until the finger lifts.7c0755e443). Text labels were saved with no size, so only taps near their start reached them. A label now takes the size of its measured text.4f9fd3b17d). Every Done overwrote the same file, so a later Done changed what an earlier Copy would paste.68752a1a71). The ready notification's tap intent matched the one the playback media session points at Cap, so creating that one replaced the screenshot's ID and the tap no longer reopened it. The notification intent now has its own action.Dependencies and size
app-release-unsigned.apk, R8 on): 7,994,030 bytes at43667eb6d, the base of this PR, and 8,119,906 bytes atd106f6ea47, so 125,876 bytes more.Security
ScreenshotServiceis not exported, only starts from the app after the system screen capture consent, and stops the projection as soon as it has one frame.cache/exports. Rendered screenshots go tocache/exports/screenshots.noBackupFilesDir, so they are not part of cloud backups. Nothing reaches shared storage until the user chooses Save: a device test takes a screenshot, renders it and copies it, and checks that MediaStore has no new image from Cap and that Cap's external storage folders are unchanged.IS_PENDINGand needs no storage permission.Screenshots
API 35 phone emulator, dark, from the debug gallery, using a drawn sample screen signed in as sam@example.com. The first five are at
8459c0665, before the review fixes. The last two are at4f9fd3b17dand show what the fixes changed: during a crop drag the whole screenshot stays in view with the crop outlined, and a selected label's outline wraps its text. That label was typed in with the Text tool and then selected. The share sheet sample shows the plain sample image; in the app it shows the rendered result.Tests
At
d106f6ea47: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: 588 tests, 21 of them for Screenshot Mode. ScreenshotEditorModelTest (13: each tool, a drag too short to see, saving only on release, freehand points, blur and pixelate, moving with Select, recolouring, highlight colours, text, editing text, taps across a whole label, cropping, deleting) and ScreenshotProjectsTest (8: a new screenshot loads back, replaces the previous one, keeps the previous one when its replacement cannot be written, leaves nothing behind when its source cannot be written, edits save in order and show before they are written, an edit for a replaced screenshot is dropped, every export is its own file, and removing everything removes exports). Two of the model tests found bugs that are fixed here: a tiny crop drag was turned into a 32 pixel crop, and blank text triggered a save that changed nothing.Device runs
Against the fixture server, at
68752a1a71, with RecorderTest, MainShellTest, ScreenRecordingTest, StudioTest, ScreenshotTest and ScreenshotEditorTest. The later merge ind106f6ea47changes only the recording coordinator and its JVM test, so these runs were not repeated after it.Left out
Annotations can be moved with Select but have no resize handles, so a shape is redrawn to change its size. Uploads are JPEG because they reuse the existing photo upload path. Only one screenshot is kept on the phone, and there is no list of past screenshots.
Confidence Score: 0/5

Do not merge yet: sharing can still expose a Cap publicly, screenshot capture and import remain broken, and the updated sign-in tests share saved onboarding state.
Findings
Fix with agent prompt
Summary
Adds Android Screenshot Mode with capture, editing, saved projects and export actions.
The latest changes also:
Several earlier findings are fixed. The new findings cover sign-in test isolation, microphone enablement and an unavailable overlay permission.
AatmanAJ manually resolved the retained-camera-footage, original sharing-choice, foreground-countdown, narrow-clip, panel-playback, camera-accessibility, slider-label and zoom-instruction threads without explanatory replies. Their current code was checked; the panel-playback thread remains manually resolved and is not scored.
Reviews (30) · Last reviewed commit: "Merge branch 'feat/mobile-android-cascad..." · Reviewed by Greptile