feat(web): remove circle video compose flow from web client
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
2026-03-08 21:35:58 +03:00
parent f3a00155d3
commit 119b423632
3 changed files with 5 additions and 32 deletions

View File

@@ -117,7 +117,6 @@ export function MessageComposer() {
const [uploadError, setUploadError] = useState<string | null>(null);
const [selectedFiles, setSelectedFiles] = useState<File[]>([]);
const [selectedType, setSelectedType] = useState<"file" | "image" | "video" | "audio">("file");
const [sendAsCircle, setSendAsCircle] = useState(false);
const [previewUrl, setPreviewUrl] = useState<string | null>(null);
const [showAttachMenu, setShowAttachMenu] = useState(false);
const [showFormatMenu, setShowFormatMenu] = useState(false);
@@ -546,11 +545,7 @@ export function MessageComposer() {
}
}
async function handleUpload(
file: File,
messageType: "file" | "image" | "video" | "audio" | "voice" | "circle_video" = "file",
waveformPoints?: number[] | null
) {
async function handleUpload(file: File, messageType: "file" | "image" | "video" | "audio" | "voice" = "file", waveformPoints?: number[] | null) {
if (!activeChatId || !me || !canSendInActiveChat) {
return;
}
@@ -827,7 +822,6 @@ export function MessageComposer() {
setShowAttachMenu(false);
const fileType = inferType(files[0]);
setSelectedType(fileType);
setSendAsCircle(false);
if (previewUrl) {
URL.revokeObjectURL(previewUrl);
}
@@ -842,12 +836,6 @@ export function MessageComposer() {
if (!selectedFiles.length || !activeChatId || !me) {
return;
}
const isCircleVideoFlow =
selectedFiles.length === 1 && inferType(selectedFiles[0]) === "video" && sendAsCircle;
if (isCircleVideoFlow) {
emitTypingStopIfActive();
sendRealtimeChatEvent("recording_video_start");
}
setIsUploading(true);
setUploadError(null);
setUploadProgress(0);
@@ -886,8 +874,7 @@ export function MessageComposer() {
} else if (kindSet.size === 1) {
inferredType = uploaded[0].kind;
}
const messageType =
inferredType === "video" && uploaded.length === 1 && sendAsCircle ? "circle_video" : inferredType;
const messageType = inferredType;
const caption = captionDraft.trim() || null;
const clientMessageId = makeClientMessageId();
addOptimisticMessage({
@@ -915,9 +902,6 @@ export function MessageComposer() {
} finally {
setIsUploading(false);
setUploadProgress(0);
if (isCircleVideoFlow) {
sendRealtimeChatEvent("recording_video_stop");
}
}
if (previewUrl) {
URL.revokeObjectURL(previewUrl);
@@ -926,7 +910,6 @@ export function MessageComposer() {
setPreviewUrl(null);
setCaptionDraft("");
setSelectedType("file");
setSendAsCircle(false);
}
function cancelSelectedFile() {
@@ -937,7 +920,6 @@ export function MessageComposer() {
setPreviewUrl(null);
setCaptionDraft("");
setSelectedType("file");
setSendAsCircle(false);
setUploadProgress(0);
setUploadError(null);
}
@@ -1452,17 +1434,6 @@ export function MessageComposer() {
value={captionDraft}
onChange={(event) => setCaptionDraft(event.target.value)}
/>
{selectedType === "video" && selectedFiles.length === 1 ? (
<label className="mb-2 flex items-center gap-2 text-xs text-slate-300">
<input
checked={sendAsCircle}
onChange={(event) => setSendAsCircle(event.target.checked)}
type="checkbox"
/>
Send as video message (circle)
</label>
) : null}
{isUploading ? (
<div className="mb-2">
<div className="mb-1 text-xs text-slate-300">Uploading: {uploadProgress}%</div>