Repository navigation
feat(chat): Add full screen in-app camera and media preview with editing - #2746
Draft
ToteMeiSter wants to merge 6 commits into
Draft
ToteMeiSter wants to merge 6 commits into
ToteMeiSter wants to merge 6 commits into
Conversation
This was referenced Oct 4, 2026
Let the user switch the record button of the chat input between voice and video messages. Tapping the button toggles the mode (the choice is stored in the user defaults), holding it records, like for voice messages: slide to cancel, slide up to lock the recording, 60 seconds at most. Too short videos are dropped. The front and the back camera can be switched while recording. The video is recorded as H.264/AAC MP4 (1280x720 preset, portrait) with AVCaptureVideoDataOutput and AVCaptureAudioDataOutput feeding an AVAssetWriter. AVCaptureMovieFileOutput is not used: removing the video input to switch the camera tears down its connection and ends the recording, the writer is not part of the capture graph. The audio session is restored afterwards. The recording is uploaded as an ordinary file. The upload path of voice messages is shared (shareRecording), but without a temporary message and without the voice message type. File names do not clash within one second. The camera helpers (camera lookup, input replacement, rotation of the output, live preview, audio session restore) live in CameraCaptureHelpers.swift. The usage descriptions of camera and microphone mention the video recording. Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru> Assisted-by: Claude-Code:claude-opus-5-5
Replace UIImagePickerController in the chat with an in-app camera, and show the photos and videos to share in a full screen preview that can be edited. Camera (NextcloudTalk/Chat/Camera): - Full screen camera with photo (tap) and video (hold) from one shutter button, flash modes (the last one is remembered), front/back camera switch. - Photos are taken at the full size of the camera and the microphone is only used while a video is recorded. - The controls follow the orientation of the device and the shutter stays at the bottom edge of the device, also on an iPad and when the device lies flat (the last held orientation is used then). - The camera is not offered during a call or when none is available. - The result is uploaded through the same confirmation as before, with the text of the input field as the caption. All of UIImagePickerController is removed from the chat. Preview (ShareExtension): - The confirmation screen shows the items in a full screen preview with a caption field, a counter, "Add more" (camera, photo library, files), crop and rotate, and drawing (QuickLook markup). - At most 10 items can be added at once. - An edited photo is stored as JPEG (PNG stays PNG), its longest side is limited to 4096 pixels. Unit tests cover the flash modes, file names, durations and the orientation logic of the camera. Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru> Assisted-by: Claude-Code:claude-opus-5-5
The preview of a video message recording is placed by a pure function in the free space between the safe area and the recording panel: 9:16 in portrait and 16:9 in landscape, 16 pt from the edges, at most 75 % of the width. It is placed again on rotation, when the panel of a locked recording appears and after the camera was switched, and its frames follow the orientation of the interface. The recorded file keeps the orientation the recording started in. The chat is dimmed under the preview, which keeps the touches away from it, and VoiceOver does not read the chat while recording. Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru> Assisted-by: Claude-Code:claude-opus-5-5
A locked video recording no longer opens the tall panel of the voice message: it stays in the row of the inputbar, which shows the indicator and the time, and gets a cancel button in the row and a send button over the record button. The preview takes the freed height. Voice messages keep their panel, which loses the pause switch that only videos needed. Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru> Assisted-by: Claude-Code:claude-opus-5-5
Overlays that appear while recording (pinned message, out of office) are added below the dimming, VoiceOver gets its focus moved to the preview and does not read the record button under the send button of a locked recording, the send button uses the colors of the theme, the orientation of the start is read in one way, and the test of the centering has room for rounding. Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru> Assisted-by: Claude-Code:claude-opus-5-5
The handler of the record button gets one branch more with the locked video recording, which raised its cyclomatic complexity. The locking is its own function now, and the handler is as complex as before. Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru> Assisted-by: Claude-Code:claude-opus-5-5
ToteMeiSter
force-pushed
the
feat/in-app-camera
branch
from
October 11, 2026 13:54
0e95d4c to
7103fc4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #2745. The branch is stacked on it: until it is merged, the diff also shows its commit. Review only the last commit.
Refs #2744
Feature
An in-app camera replaces
UIImagePickerControllerin the chat. The photos and videos to share are shown in a full screen preview that can be edited, before they are sent.The same feature for Android: nextcloud/talk-android#6820 (issue nextcloud/talk-android#6815). Related: nextcloud/talk-android#6812 (video messages, shares the camera code).
Changes
One commit on top of the video message recording.
Camera (
NextcloudTalk/Chat/Camera):InAppCameraViewController: tap the shutter for a photo, hold it for a video (up to 300 s). Flash off/auto/on (the last mode is remembered), front/back camera.CameraCaptureHelpers: shared with the video message recorder, extended by the interface orientation and the layout update when a session starts.BaseChatViewController: the "Camera" action of the menu opens the in-app camera.UIImagePickerControllerDelegate,UINavigationControllerDelegateand the picker code are removed. The result goes through the upload confirmation, with the text of the input field as the caption.Preview (built into the existing
ShareConfirmationViewController, plusMediaPreviewViews.swift):ShareItemController: an edited photo is stored as JPEG 0.95 (a PNG stays a PNG), the longest side is limited to 4096 pixels.Tests:
UnitInAppCameraTest(flash modes, file names, durations, orientation logic).Strings: only the strings of this change (15 new, 2 plural rules).
Info.plist: the camera usage description is extended. No new dependencies.How to test
Not built or run locally. Build and unit tests: CI only. CI in the fork on the same commit: Build, SwiftLint and all 5 test jobs (main, stable23, stable32, stable33, stable34) passed, run https://github.com/ToteMeiSter/talk-ios/actions/runs/37227743324. SwiftLint: no new warnings or errors compared to
main.check-localizable-plurals.shpasses.Manual, on a device (expected results, not verified):
AI disclosure
This change was prepared with AI assistance (Claude Code, model claude-opus-5-5): code reading, the implementation, the tests and this description. Commits carry
Assisted-by: Claude-Code:claude-opus-5-5. The change was reviewed by the author. It was not built or tested on a device (no Xcode or iPhone available to the author).馃 Generated with Claude Code