cleanup folders and events, and condense changes
This commit is contained in:
@@ -20,9 +20,8 @@ import { ScreenSourcePicker } from '@/components/screen-source-picker';
|
||||
import { KeyHint } from '@/components/key-hint';
|
||||
import { TextComposeStep } from '@/features/compose/text-compose-step';
|
||||
import { TaskComposeStep } from '@/features/compose/task-compose-step';
|
||||
import { EventComposeStep } from '@/features/compose/event-compose-step';
|
||||
import { ConfigureContainerStep } from '@/features/compose/configure-container-step';
|
||||
import type { TaskProperties, EventProperties } from '@/api/types';
|
||||
import type { TaskProperties } from '@/api/types';
|
||||
import { apiClient } from '@/api/client';
|
||||
import { useMediaSettingsStore } from '@/stores/media-settings-store';
|
||||
import { useMediaDevicesStore } from '@/stores/media-devices-store';
|
||||
@@ -44,15 +43,13 @@ export type ComposeStep =
|
||||
| 'reviewing'
|
||||
| 'typing'
|
||||
| 'task'
|
||||
| 'event'
|
||||
| 'configuring'
|
||||
| 'submitting';
|
||||
|
||||
type RecordingSource = 'media' | 'screen';
|
||||
|
||||
type PendingArtifact =
|
||||
| { type: 'task'; properties: TaskProperties }
|
||||
| { type: 'event'; properties: EventProperties };
|
||||
| { type: 'task'; properties: TaskProperties };
|
||||
|
||||
interface ComposeOverlayProps {
|
||||
networkId: string;
|
||||
@@ -106,8 +103,7 @@ export function ComposeOverlay({
|
||||
const recordStartRef = useRef(0);
|
||||
const quotaExhaustedRef = useRef(quotaExhausted);
|
||||
const recordingSourceRef = useRef(recordingSource);
|
||||
// Task/event captured by their compose steps, created on submit. A ref (not
|
||||
// state) so submit handlers can set it and create in the same tick.
|
||||
|
||||
const pendingArtifactRef = useRef<PendingArtifact | null>(null);
|
||||
useEffect(() => {
|
||||
quotaExhaustedRef.current = quotaExhausted;
|
||||
@@ -501,12 +497,8 @@ export function ComposeOverlay({
|
||||
setStepSync('task');
|
||||
}, [guardIdle, setStepSync]);
|
||||
|
||||
const handleEventIntent = useCallback(() => {
|
||||
if (!guardIdle()) return;
|
||||
setStepSync('event');
|
||||
}, [guardIdle, setStepSync]);
|
||||
|
||||
// Task/event submit: capture the artifact, then reuse the standard flow —
|
||||
// Artifact submit: capture the artifact, then reuse the standard flow —
|
||||
// reply mode creates it under targetPath, root mode configures a stream
|
||||
// that will hold it as its first child.
|
||||
const handleArtifactSubmit = useCallback(
|
||||
@@ -577,9 +569,6 @@ export function ComposeOverlay({
|
||||
case 'task':
|
||||
handleTaskIntent();
|
||||
break;
|
||||
case 'event':
|
||||
handleEventIntent();
|
||||
break;
|
||||
case 'stop':
|
||||
handleStopIntent();
|
||||
break;
|
||||
@@ -596,7 +585,6 @@ export function ComposeOverlay({
|
||||
handleRecordIntent,
|
||||
handleTextIntent,
|
||||
handleTaskIntent,
|
||||
handleEventIntent,
|
||||
handleStopIntent,
|
||||
handleCancelIntent,
|
||||
handleSendIntent,
|
||||
@@ -612,7 +600,6 @@ export function ComposeOverlay({
|
||||
if (
|
||||
currentStep === 'typing' ||
|
||||
currentStep === 'task' ||
|
||||
currentStep === 'event' ||
|
||||
currentStep === 'configuring' ||
|
||||
currentStep === 'picking'
|
||||
) {
|
||||
@@ -649,9 +636,6 @@ export function ComposeOverlay({
|
||||
} else if (e.key === 'd' || e.key === 'D') {
|
||||
e.preventDefault();
|
||||
handleTaskIntent();
|
||||
} else if (e.key === 'e' || e.key === 'E') {
|
||||
e.preventDefault();
|
||||
handleEventIntent();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -720,7 +704,6 @@ export function ComposeOverlay({
|
||||
handleRecordIntent,
|
||||
handleTextIntent,
|
||||
handleTaskIntent,
|
||||
handleEventIntent,
|
||||
handleStopIntent,
|
||||
handleCancelIntent,
|
||||
handleSendIntent,
|
||||
@@ -838,14 +821,6 @@ export function ComposeOverlay({
|
||||
}
|
||||
/>
|
||||
)}
|
||||
{step === 'event' && (
|
||||
<EventComposeStep
|
||||
onCancel={cancel}
|
||||
onSubmit={(properties) =>
|
||||
handleArtifactSubmit({ type: 'event', properties })
|
||||
}
|
||||
/>
|
||||
)}
|
||||
{!targetPath && step === 'configuring' && (
|
||||
<ConfigureContainerStep
|
||||
networkId={networkId}
|
||||
|
||||
Reference in New Issue
Block a user