diff --git a/README.md b/README.md index 11d2ffb3778dd..85b8486a014a9 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ This is a personal fork of [pingdotgg/t3code](https://github.com/pingdotgg/t3cod - **Open threads from links.** The desktop app opens `t3code://app//` links (`t3code-dev://` for Dev builds) from other apps and from pages in the built-in browser, whether it is already running or starts from the link. Use `primary` as the environment ID for the desktop's own environment. When tag hiding is off, archived threads open too, with an archived notice and an Unarchive button above the composer. A link to an unknown environment or thread shows a short error instead. Upstream's prompt links (`t3code://new`, `t3code://threads/…`) follow the same rules: each build answers only its own scheme, and a thread link opens in the active split pane. -- **Archive when done.** Archiving a working thread, from its menu, the command palette, the archive shortcut, mobile, or the `/t3-archive` composer command, waits until the turn, its checkpoint, any subagents, and any commands or monitors the agent waits on finish. Automatic follow-ups such as subagent results don't cancel it; a new message does. A pending archive shows an archive icon on the thread's row, and the same actions cancel it. Archiving an idle thread that has queued messages, including messages held by Stop, always asks first and names the count, even with archive confirmation off; confirming archives it now and discards them. Agents can archive their own thread, or pass `threadId` to archive another one they have read and no longer need, with `archive_thread` (inspected or cancelled with `archive_thread_status` and `cancel_thread_archive`), optionally removing its clean worktree while keeping the branch (never an SP Labs lab). Requests survive restarts. Like a manual archive, it also archives the thread's side chats, and sending a message to an archived thread unarchives it and those side chats first. Agents can use `archive_thread` with `includeDescendants: true` to archive finished child and subagent threads in the same call; active descendants are skipped and reported. Shared-worktree refusals report the blocker count and up to ten thread ids, titles, and states. +- **Archive when done.** Archiving a working thread, from its menu, the command palette, the archive shortcut, or mobile, waits until the turn, its checkpoint, any subagents, and any commands or monitors the agent waits on finish. Automatic follow-ups such as subagent results don't cancel it; a new message does. A pending archive shows an archive icon on the thread's row, and the same actions cancel it. Archiving discards queued messages, including messages held by Stop: the thread's own when it archives now, and those of the side chats it takes either way. It always asks first and names the count, even with archive confirmation off. Agents can archive their own thread, or pass `threadId` to archive another one they have read and no longer need, with `archive_thread` (inspected or cancelled with `archive_thread_status` and `cancel_thread_archive`), optionally removing its clean worktree while keeping the branch (never an SP Labs lab). Requests survive restarts. Like a manual archive, it also archives the thread's side chats, and sending a message to an archived thread unarchives it and those side chats first. Agents can use `archive_thread` with `includeDescendants: true` to archive finished child and subagent threads in the same call; active descendants are skipped and reported. Shared-worktree refusals report the blocker count and up to ten thread ids, titles, and states. - **Thread tools for agents.** Agents can list custom thread groups with their thread counts, create a group, and move a thread into a group or back to Active with `t3_thread_groups`, and can start new threads directly in a group by passing `groupId` to `t3_thread_launch` or `create_threads`; renaming, deleting, and reordering groups stay with you. `t3_thread_drain_status` tells an agent whether a thread is fully quiet (no active or queued run, no subagents, monitors, or background commands left), for example before handing its session to another machine. `t3_thread_list` can list every project at once and find the threads bound to a worktree path. When a thread an agent started with `t3_thread_launch` fails workspace preparation on the same machine (a branch already in use, a reserved lab), that agent gets a message with the error so it can launch again. diff --git a/apps/mobile/src/features/home/threadArchive.ts b/apps/mobile/src/features/home/threadArchive.ts index 02d807f810e36..b866da813beab 100644 --- a/apps/mobile/src/features/home/threadArchive.ts +++ b/apps/mobile/src/features/home/threadArchive.ts @@ -3,25 +3,37 @@ import { type ThreadRuntimeSummary, } from "@t3tools/client-runtime/state/models"; +import type { ArchiveQueuedMessageDiscard } from "@t3tools/client-runtime/state/thread-settled"; + import * as Dialog from "../../components/ui/Dialog"; export function threadCanArchive(runtime: ThreadRuntimeSummary | null | undefined): boolean { return threadRuntimeCanArchive(runtime); } -/** Fork: asks before archiving now discards a thread's queued messages. */ +/** Fork: asks before an archive discards queued messages of a thread or its side chats. */ export function confirmQueuedMessageDiscard(input: { readonly title: string; - readonly count: number; + readonly discarded: ArchiveQueuedMessageDiscard; + readonly whenDone: boolean; readonly onConfirm: () => void; - readonly onCancel?: () => void; }): void { + const { total, inSideChats } = input.discarded; + const waiting = + inSideChats === 0 + ? `“${input.title}” has` + : inSideChats === total + ? `Side chats of “${input.title}” have` + : `“${input.title}” and its side chats have`; Dialog.confirm({ - title: `Archive and discard ${input.count} queued ${input.count === 1 ? "message" : "messages"}?`, - message: `“${input.title}” has messages waiting to run. Archiving discards them.`, + title: `Archive${input.whenDone ? " when done" : ""} and discard ${total} queued ${total === 1 ? "message" : "messages"}?`, + message: `${waiting} messages waiting to run. Archiving discards them.${ + inSideChats === 0 + ? "" + : " A side chat still running a delegated task stays open and keeps its messages." + }`, confirmText: "Archive", destructive: true, onConfirm: input.onConfirm, - ...(input.onCancel === undefined ? {} : { onCancel: input.onCancel }), }); } diff --git a/apps/mobile/src/features/home/useThreadListActions.test.ts b/apps/mobile/src/features/home/useThreadListActions.test.ts index e662f303c0fcb..8a505b1c7f8e4 100644 --- a/apps/mobile/src/features/home/useThreadListActions.test.ts +++ b/apps/mobile/src/features/home/useThreadListActions.test.ts @@ -739,6 +739,30 @@ describe("thread archive guard", () => { ]); }); + it("re-reads side chat queues after the discard confirmation", async () => { + const sideChat = (queuedMessageCount: number) => + makeThread({ + id: ThreadId.make("side"), + lineage: { + parentThreadId: ThreadId.make("thread"), + relationshipToParent: "fork", + rootThreadId: ThreadId.make("thread"), + sideChat: true, + }, + queuedMessageCount, + }); + state.shells = [makeThread(), sideChat(1)]; + expect(await useThreadListActions().archiveThread(makeThread())).toBe(false); + // A queue that grew while the dialog was open asks again instead of archiving. + state.shells = [makeThread(), sideChat(2)]; + state.dialogs[0]?.onConfirm(); + expect(state.dialogs).toHaveLength(2); + state.dialogs[1]?.onConfirm(); + await vi.waitFor(() => + expect(state.requests).toEqual([expect.objectContaining({ action: "archive" })]), + ); + }); + it("archives when done from a row held from before the run started", async () => { state.shells = [ makeThread({ diff --git a/apps/mobile/src/features/home/useThreadListActions.ts b/apps/mobile/src/features/home/useThreadListActions.ts index 5dc991488d816..f081a8bffa239 100644 --- a/apps/mobile/src/features/home/useThreadListActions.ts +++ b/apps/mobile/src/features/home/useThreadListActions.ts @@ -4,7 +4,10 @@ import type { EnvironmentThreadShell } from "@t3tools/client-runtime/state/shell import * as ThreadUndo from "@t3tools/client-runtime/state/thread-undo"; import { showThreadUndoNotice } from "./thread-undo-notice"; import { - archiveDiscardedQueuedMessageCount, + type ArchiveQueuedMessageDiscard, + type ArchiveToggleAction, + archiveDiscardedQueuedMessages, + discardExceedsConfirmed, canSnooze, resolveArchiveToggleAction, } from "@t3tools/client-runtime/state/thread-settled"; @@ -454,21 +457,36 @@ export function useThreadListActions( const titleRegenerationInFlightThreadKeys = useRef(new Set()); /** - * The archive toggle: archives, archives when done, or cancels a pending archive. Archiving - * now discards queued messages, so that always confirms first, offline from the cached shell. + * The archive toggle: archives, archives when done, or cancels a pending archive. Discarding + * queued messages, the thread's or its side chats', always confirms first, offline from cache. */ - const archiveThread = (thread: EnvironmentThreadShell, discardConfirmed = false) => { - const discardedCount = archiveDiscardedQueuedMessageCount(thread); - if (discardedCount > 0 && !discardConfirmed) { + const archiveThread = ( + thread: EnvironmentThreadShell, + confirmed?: { + readonly toggle: ArchiveToggleAction; + readonly discarded: ArchiveQueuedMessageDiscard; + }, + ): Promise => { + const toggle = resolveArchiveToggleAction(thread); + // The thread can change while the dialog is open: a changed action does nothing. + if (confirmed !== undefined && confirmed.toggle !== toggle) return Promise.resolve(false); + const discarded = archiveDiscardedQueuedMessages( + thread, + appAtomRegistry.get(environmentThreadShells.threadShellsAtom), + ); + if ( + confirmed === undefined + ? discarded.total > 0 + : discardExceedsConfirmed(discarded, confirmed.discarded) + ) { confirmQueuedMessageDiscard({ title: thread.title, - count: discardedCount, - // The thread can change while the dialog is open (a resumed turn must not be archived). - onConfirm: () => void archiveThread(liveThread(thread), true), + discarded, + whenDone: toggle === "schedule", + onConfirm: () => void archiveThread(liveThread(thread), { toggle, discarded }), }); return Promise.resolve(false); } - const toggle = resolveArchiveToggleAction(thread); return executeAction( toggle === "cancel" ? "cancel-archive" @@ -478,7 +496,8 @@ export function useThreadListActions( thread, undefined, undefined, - discardConfirmed && discardedCount > 0, + // Replay may archive now only over the thread's own confirmed queue. + confirmed !== undefined && discarded.total > discarded.inSideChats, ); }; const offerUndo = ( diff --git a/apps/mobile/src/features/settings/lib/extras-settings.test.ts b/apps/mobile/src/features/settings/lib/extras-settings.test.ts index b0f82aefdec93..c5da767f4e808 100644 --- a/apps/mobile/src/features/settings/lib/extras-settings.test.ts +++ b/apps/mobile/src/features/settings/lib/extras-settings.test.ts @@ -1,41 +1,6 @@ -import { - MAX_ACCENT_TINT_INTENSITY_PERCENT, - MAX_STEER_GRACE_WINDOW_MS, - MIN_ACCENT_TINT_INTENSITY_PERCENT, - MIN_STEER_GRACE_WINDOW_MS, -} from "@t3tools/contracts/settings"; import { describe, expect, it } from "vite-plus/test"; -import { - formatAccentTintIntensityPercent, - formatSteerGraceWindowSeconds, - toStoredAccentTintIntensityPercent, - toStoredArchivedSectionVisibleCount, - toStoredSteerGraceWindowMs, -} from "./extras-settings"; - -describe("formatSteerGraceWindowSeconds", () => { - it("reads the stored milliseconds as seconds with one decimal", () => { - expect(formatSteerGraceWindowSeconds(5_000)).toBe("5.0s"); - expect(formatSteerGraceWindowSeconds(2_500)).toBe("2.5s"); - expect(formatSteerGraceWindowSeconds(MIN_STEER_GRACE_WINDOW_MS)).toBe("0.0s"); - expect(formatSteerGraceWindowSeconds(MAX_STEER_GRACE_WINDOW_MS)).toBe("15.0s"); - }); -}); - -describe("toStoredArchivedSectionVisibleCount", () => { - it("rounds and clamps the archived count", () => { - expect(toStoredArchivedSectionVisibleCount(10.4)).toBe(10); - expect(toStoredArchivedSectionVisibleCount(-5)).toBe(1); - expect(toStoredArchivedSectionVisibleCount(100)).toBe(50); - }); -}); - -describe("formatAccentTintIntensityPercent", () => { - it("reads the stored intensity as a percentage", () => { - expect(formatAccentTintIntensityPercent(12)).toBe("12%"); - }); -}); +import { toStoredSteerGraceWindowMs } from "./extras-settings"; describe("toStoredSteerGraceWindowMs", () => { it("snaps to the half-second step the slider moves in", () => { @@ -43,21 +8,4 @@ describe("toStoredSteerGraceWindowMs", () => { expect(toStoredSteerGraceWindowMs(2_749)).toBe(2_500); expect(toStoredSteerGraceWindowMs(2_751)).toBe(3_000); }); - - it("clamps to the contract bounds rather than storing an out-of-range window", () => { - expect(toStoredSteerGraceWindowMs(-1_000)).toBe(MIN_STEER_GRACE_WINDOW_MS); - expect(toStoredSteerGraceWindowMs(60_000)).toBe(MAX_STEER_GRACE_WINDOW_MS); - }); -}); - -describe("toStoredAccentTintIntensityPercent", () => { - it("stores whole percentages", () => { - expect(toStoredAccentTintIntensityPercent(12.4)).toBe(12); - expect(toStoredAccentTintIntensityPercent(12.6)).toBe(13); - }); - - it("clamps to the contract bounds", () => { - expect(toStoredAccentTintIntensityPercent(0)).toBe(MIN_ACCENT_TINT_INTENSITY_PERCENT); - expect(toStoredAccentTintIntensityPercent(99)).toBe(MAX_ACCENT_TINT_INTENSITY_PERCENT); - }); }); diff --git a/apps/mobile/src/features/threads/use-composer-command-menu.test.ts b/apps/mobile/src/features/threads/use-composer-command-menu.test.ts index a30821609e2a9..26dd3992047f5 100644 --- a/apps/mobile/src/features/threads/use-composer-command-menu.test.ts +++ b/apps/mobile/src/features/threads/use-composer-command-menu.test.ts @@ -71,22 +71,6 @@ describe("resolveComposerMenuSelection", () => { }); describe("mobile slash commands", () => { - it("offers archive only for an existing thread and inserts it for submission", () => { - const input = { query: "t3-arch", atMessageStart: true, selectedProviderStatus: null }; - expect(buildComposerSlashCommandItems({ ...input, hasThread: false })).toEqual([]); - const items = buildComposerSlashCommandItems({ ...input, hasThread: true }); - expect(items).toHaveLength(1); - const item = items[0]; - if (!item) throw new Error("Expected archive command"); - expect( - resolveComposerCommandSelection({ - draftMessage: "/t3-arch", - trigger: { rangeStart: 0, rangeEnd: 8 }, - item, - }), - ).toEqual({ text: "/t3-archive ", cursor: 12 }); - }); - it("keeps a provider's native /plan", () => { const items = buildComposerSlashCommandItems({ query: "pl", diff --git a/apps/mobile/src/features/threads/use-composer-command-menu.ts b/apps/mobile/src/features/threads/use-composer-command-menu.ts index 164a760b6c562..ac01618f2455f 100644 --- a/apps/mobile/src/features/threads/use-composer-command-menu.ts +++ b/apps/mobile/src/features/threads/use-composer-command-menu.ts @@ -122,27 +122,17 @@ export function buildComposerSlashCommandItems( resolve: MessageResolver = m, ): ComposerCommandItem[] { const query = input.query.toLowerCase(); - const builtIn = [ - { - id: "cmd:model", - type: "slash-command", - command: "model", - label: "/model", - description: resolve(msg("Switch model")), - }, - ...(input.hasThread - ? [ - { - id: "cmd:t3-archive", - type: "slash-command" as const, - command: "t3-archive", - label: "/t3-archive", - description: "Archive now or when done; send again to cancel", - }, - ] - : []), - ] satisfies ComposerCommandItem[]; - const items: ComposerCommandItem[] = builtIn.filter((item) => item.command.includes(query)); + const items: ComposerCommandItem[] = "model".includes(query) + ? [ + { + id: "cmd:model", + type: "slash-command", + command: "model", + label: "/model", + description: resolve(msg("Switch model")), + }, + ] + : []; // Providers expand commands only at the start of a message. T3 commands // change local state and do not have this restriction, except `/clear`. diff --git a/apps/mobile/src/persistence/mobile-preferences.ts b/apps/mobile/src/persistence/mobile-preferences.ts index fe9fe8c8baf7f..e77ff6e46fe7e 100644 --- a/apps/mobile/src/persistence/mobile-preferences.ts +++ b/apps/mobile/src/persistence/mobile-preferences.ts @@ -181,14 +181,6 @@ export interface Preferences { readonly sidebarSnoozedShelfExpanded?: boolean; readonly sidebarSettledShelfExpanded?: boolean; readonly sidebarArchivedShelfExpanded?: boolean; - /** - * Upstream's shelf keys. The fork's `sidebar*ShelfExpanded` keys above own - * settled/snoozed fold state; these stay decoded for upstream compatibility. - * Only the Working shelf reads its own key. - */ - readonly threadListSettledShelfExpanded?: boolean; - readonly threadListSnoozedShelfExpanded?: boolean; - readonly threadListWorkingShelfExpanded?: boolean; readonly toolCallVisibility?: ToolCallVisibility; readonly workingShelfEnabled?: boolean; readonly useLastProjectForNewThreads?: boolean; @@ -197,6 +189,9 @@ export interface Preferences { readonly provider: ProviderInstanceId; readonly model: string; }>; + readonly threadListSettledShelfExpanded?: boolean; + readonly threadListSnoozedShelfExpanded?: boolean; + readonly threadListWorkingShelfExpanded?: boolean; /** * Device-local mirror of the web fork's Extras settings. Numbers are stored * raw and clamped on read (see `state/use-mobile-preferences`), because the @@ -291,6 +286,8 @@ export function sanitizePreferences(parsed: Preferences): Preferences { microphones?: ReadonlyArray; projectGroupingEnabled?: boolean; projectGroupingMode?: SidebarProjectGroupingMode; + toolCallVisibility?: ToolCallVisibility; + workingShelfEnabled?: boolean; sidebarPinnedShelfExpanded?: boolean; sidebarActiveShelfExpanded?: boolean; sidebarSnoozedShelfExpanded?: boolean; @@ -298,12 +295,10 @@ export function sanitizePreferences(parsed: Preferences): Preferences { sidebarArchivedShelfExpanded?: boolean; useLastProjectForNewThreads?: boolean; lastThreadProject?: typeof ThreadProject.Type; + modelFavorites?: Preferences["modelFavorites"]; threadListSettledShelfExpanded?: boolean; threadListSnoozedShelfExpanded?: boolean; threadListWorkingShelfExpanded?: boolean; - toolCallVisibility?: ToolCallVisibility; - workingShelfEnabled?: boolean; - modelFavorites?: Preferences["modelFavorites"]; steerGraceWindowMs?: number; accentTintsEnabled?: boolean; accentTintIntensityPercent?: number; @@ -455,12 +450,6 @@ export function sanitizePreferences(parsed: Preferences): Preferences { if (typeof parsed.sidebarArchivedShelfExpanded === "boolean") { preferences.sidebarArchivedShelfExpanded = parsed.sidebarArchivedShelfExpanded; } - if (typeof parsed.threadListSettledShelfExpanded === "boolean") { - preferences.threadListSettledShelfExpanded = parsed.threadListSettledShelfExpanded; - } - if (typeof parsed.threadListSnoozedShelfExpanded === "boolean") { - preferences.threadListSnoozedShelfExpanded = parsed.threadListSnoozedShelfExpanded; - } if (isToolCallVisibility(parsed.toolCallVisibility)) { preferences.toolCallVisibility = parsed.toolCallVisibility; } @@ -484,6 +473,12 @@ export function sanitizePreferences(parsed: Preferences): Preferences { favorite.model.trim().length > 0, ); } + if (typeof parsed.threadListSettledShelfExpanded === "boolean") { + preferences.threadListSettledShelfExpanded = parsed.threadListSettledShelfExpanded; + } + if (typeof parsed.threadListSnoozedShelfExpanded === "boolean") { + preferences.threadListSnoozedShelfExpanded = parsed.threadListSnoozedShelfExpanded; + } if (typeof parsed.steerGraceWindowMs === "number") { preferences.steerGraceWindowMs = parsed.steerGraceWindowMs; } diff --git a/apps/mobile/src/state/thread-lifecycle-outbox-model.ts b/apps/mobile/src/state/thread-lifecycle-outbox-model.ts index a1f152f299c69..548a592e3c3ee 100644 --- a/apps/mobile/src/state/thread-lifecycle-outbox-model.ts +++ b/apps/mobile/src/state/thread-lifecycle-outbox-model.ts @@ -1,4 +1,4 @@ -import { archiveDiscardedQueuedMessageCount } from "@t3tools/client-runtime/state/thread-settled"; +import { archiveDiscardedQueuedMessages } from "@t3tools/client-runtime/state/thread-settled"; import { scopeThreadShell, type EnvironmentShellStatus, @@ -195,6 +195,8 @@ export function resolveThreadLifecycleOutboxAction(input: { readonly thread: | Pick< EnvironmentThreadShell, + | "environmentId" + | "id" | "archivedAt" | "archiveRequest" | "runtime" @@ -226,7 +228,8 @@ export function resolveThreadLifecycleOutboxAction(input: { const archivePending = !archived && thread.archiveRequest?.status === "pending"; if (input.desiredArchived) { if ((archived || archivePending) && !input.requiresDispatch) return "remove"; - return input.discardQueuedMessages && archiveDiscardedQueuedMessageCount(thread) > 0 + // Only the thread's own queue refuses archive-when-done; side chat queues never do. + return input.discardQueuedMessages && archiveDiscardedQueuedMessages(thread).total > 0 ? "archive-now" : "archive"; } diff --git a/apps/mobile/src/state/thread-lifecycle-outbox.test.ts b/apps/mobile/src/state/thread-lifecycle-outbox.test.ts index 02777bdc566e6..7108954719c9f 100644 --- a/apps/mobile/src/state/thread-lifecycle-outbox.test.ts +++ b/apps/mobile/src/state/thread-lifecycle-outbox.test.ts @@ -80,8 +80,17 @@ const live = { requiresDispatch: false, discardQueuedMessages: false, } as const; -const idle = { archivedAt: null, archiveRequest: null, runtime: null, pendingBackgroundTasks: [] }; +const idle = { + environmentId, + id: threadId, + archivedAt: null, + archiveRequest: null, + runtime: null, + pendingBackgroundTasks: [], +}; const pendingArchive = { + environmentId, + id: threadId, runtime: null, pendingBackgroundTasks: [], archivedAt: null, diff --git a/apps/mobile/src/state/thread-steer-pending.ts b/apps/mobile/src/state/thread-steer-pending.ts index b217c87e121ec..87111ed3f90bd 100644 --- a/apps/mobile/src/state/thread-steer-pending.ts +++ b/apps/mobile/src/state/thread-steer-pending.ts @@ -1,14 +1,15 @@ import { + revealedSteerMessageIds, STEER_PENDING_REVEAL_DELAY_MS, - unreadSteerMessageIds, + steerRevealPending, + unreadSteerKey, + unreadSteerSet, type SteerPendingThreadSnapshot, } from "@t3tools/client-runtime/state/thread-steer-pending"; -import { MessageId } from "@t3tools/contracts"; -import { useEffect, useMemo, useState } from "react"; +import type { MessageId } from "@t3tools/contracts"; +import { useEffect, useState } from "react"; -// Mirror of apps/web/src/state/threadSteerPending.ts. Keep in sync. -const NO_PENDING_MESSAGE_IDS: ReadonlySet = new Set(); -const UNREAD_KEY_SEPARATOR = "\u0000"; +const NO_REVEALED_MESSAGE_IDS: ReadonlySet = new Set(); /** * Derived from the thread projection so the answer survives reloads, devices and navigation. The @@ -18,53 +19,21 @@ const UNREAD_KEY_SEPARATOR = "\u0000"; export function useSteerPendingMessageIds( snapshot: SteerPendingThreadSnapshot | null, ): ReadonlySet { - // Keyed by content, and the Set rebuilt from the key rather than the array, - // so projection updates that leave the unread set unchanged neither restart - // the reveal timer nor need a ref to keep Set identity stable. - const unreadKey = useMemo( - () => (snapshot === null ? "" : unreadSteerMessageIds(snapshot).join(UNREAD_KEY_SEPARATOR)), - [snapshot], - ); - const unread = useMemo( - () => - unreadKey === "" - ? NO_PENDING_MESSAGE_IDS - : new Set(unreadKey.split(UNREAD_KEY_SEPARATOR).map((id) => MessageId.make(id))), - [unreadKey], - ); - const [revealed, setRevealed] = useState>(NO_PENDING_MESSAGE_IDS); + return useRevealedSteerMessageIds(unreadSteerKey(snapshot)); +} + +// Takes the string key so the compiler caches the set on content, not on each projection +// update; a new set identity would restart the reveal timer while a turn streams. +function useRevealedSteerMessageIds(unreadKey: string): ReadonlySet { + const unread = unreadSteerSet(unreadKey); + const [revealed, setRevealed] = useState>(NO_REVEALED_MESSAGE_IDS); - // A steer that resolves drops out of `unread` at once; one that stays is - // revealed once the delay passes. A second steer arriving before the first - // is revealed delays both; one arriving after does not hide the first. - // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- reveal-delay timer + // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- reveals held steers after the delay useEffect(() => { - let allRevealed = true; - for (const messageId of unread) { - if (!revealed.has(messageId)) { - allRevealed = false; - break; - } - } - if (allRevealed) { - return; - } - const timer = setTimeout(() => { - setRevealed(unread); - }, STEER_PENDING_REVEAL_DELAY_MS); + if (!steerRevealPending(unread, revealed)) return; + const timer = setTimeout(() => setRevealed(unread), STEER_PENDING_REVEAL_DELAY_MS); return () => clearTimeout(timer); }, [revealed, unread]); - return useMemo(() => { - if (unread.size === 0 || revealed.size === 0) { - return NO_PENDING_MESSAGE_IDS; - } - const visible = new Set(); - for (const messageId of unread) { - if (revealed.has(messageId)) { - visible.add(messageId); - } - } - return visible.size === 0 ? NO_PENDING_MESSAGE_IDS : visible; - }, [revealed, unread]); + return revealedSteerMessageIds(unread, revealed); } diff --git a/apps/mobile/src/state/use-thread-composer-state.ts b/apps/mobile/src/state/use-thread-composer-state.ts index ceea68fa7dc71..a02847cb05407 100644 --- a/apps/mobile/src/state/use-thread-composer-state.ts +++ b/apps/mobile/src/state/use-thread-composer-state.ts @@ -46,16 +46,6 @@ import { type CodexFeedbackSubmission, } from "@t3tools/client-runtime/state/threads"; import { resolveThreadWorkingStartedAt } from "@t3tools/client-runtime/state/models"; -import { - isAtomCommandInterrupted, - settlePromise, - squashAtomCommandFailure, -} from "@t3tools/client-runtime/state/runtime"; -import { - archiveDiscardedQueuedMessageCount, - hasPendingArchive, -} from "@t3tools/client-runtime/state/thread-settled"; -import { parseComposerArchiveCommand } from "@t3tools/shared/composerTrigger"; import { deriveThreadTitleSeed } from "@t3tools/client-runtime/operations"; import { upgradeLegacyContextMessage } from "@t3tools/shared/composerContextLegacy"; import { restoreAttachmentOnlyBootstrapPrompt } from "@t3tools/shared/composerContextReferences"; @@ -93,7 +83,6 @@ import { threadAllowsProviderSwitch } from "./thread-provider-switching"; import { appAtomRegistry } from "./atom-registry"; import { pendingThreadCreationMessage } from "./pending-thread-creation"; import type { SideChatMessage } from "../features/threads/useStartSideChat"; -import { confirmQueuedMessageDiscard } from "../features/home/threadArchive"; import { composerAttachmentUploadBlockReason, composerAttachmentUploadsAtom, @@ -109,7 +98,6 @@ import { isFreshSessionPending, mergeComposerDraftContent, removeComposerDraftAttachment, - sameComposerDraftState, scheduleUnusedComposerAttachmentCleanup, setComposerDraftText, setFreshSessionPending, @@ -133,6 +121,7 @@ import { } from "@t3tools/client-runtime/state/composer-dispatch"; import { Atom } from "effect/reactivity"; import { AsyncResult } from "effect/reactivity"; +import { settlePromise, squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime"; import { prepareTurnAttachments } from "../lib/attachmentUpload"; import { DEFAULT_FOLLOW_UP_BEHAVIOR } from "../lib/followUpBehavior"; import { mobilePreferencesAtom } from "./preferences"; @@ -277,13 +266,6 @@ export function useThreadComposerState(input: { const uploadThreadFeedback = useAtomCommand(threadEnvironment.uploadFeedback, { reportFailure: false, }); - const archiveThread = useAtomCommand(threadEnvironment.archive, { reportFailure: false }); - const scheduleThreadArchive = useAtomCommand(threadEnvironment.scheduleArchive, { - reportFailure: false, - }); - const cancelThreadArchive = useAtomCommand(threadEnvironment.cancelArchive, { - reportFailure: false, - }); const editQueuedRun = useAtomCommand(threadEnvironment.editQueuedRun, { label: "edit queued message", reportFailure: false, @@ -845,72 +827,6 @@ export function useThreadComposerState(input: { return null; } - // Fork: `/t3-archive` archives now or when done; sent again, it cancels. - // Attachments or context mean a real prompt, which goes to the provider. - const archiveCommand = - attachments.length === 0 && (draft.context?.records.length ?? 0) === 0 - ? parseComposerArchiveCommand(text) - : null; - if (archiveCommand) { - if (archiveCommand.action === null) { - Dialog.alert( - "Unable to archive thread", - "Usage: /t3-archive (send again to cancel a pending archive)", - ); - return null; - } - const environmentId = thread.environmentId; - const input = { threadId: thread.id }; - const cancelArchive = archiveCommand.action === "cancel" || hasPendingArchive(thread); - // Archive-when-done is refused while messages are queued; archiving now discards them. - const discardedCount = cancelArchive ? 0 : archiveDiscardedQueuedMessageCount(thread); - if ( - discardedCount > 0 && - !(await new Promise((resolve) => - confirmQueuedMessageDiscard({ - title: thread.title, - count: discardedCount, - onConfirm: () => resolve(true), - onCancel: () => resolve(false), - }), - )) - ) { - return null; - } - const result = await (cancelArchive - ? cancelThreadArchive({ environmentId, input }) - : discardedCount > 0 - ? archiveThread({ environmentId, input }) - : scheduleThreadArchive({ environmentId, input: { ...input, afterTurn: true } })); - if (result._tag === "Failure") { - if (!isAtomCommandInterrupted(result)) { - const error = squashAtomCommandFailure(result); - Dialog.alert( - "Unable to update thread archive", - error instanceof Error ? error.message : "An error occurred.", - ); - } - return null; - } - Dialog.alert( - cancelArchive - ? "Archive cancelled" - : discardedCount > 0 - ? "Thread archived" - : "Archive requested", - cancelArchive - ? "This thread will stay open." - : discardedCount > 0 - ? "Its queued messages were discarded." - : "Archives when the current turn and background work finish. Send /t3-archive again to cancel.", - ); - // Clear only an unchanged draft: the user may have typed on meanwhile. - if (sameComposerDraftState(getComposerDraftSnapshot(threadKey), draft)) { - clearComposerDraftContent(threadKey); - } - return null; - } - if (modelUnavailable) { alertModelUnavailable(); return null; diff --git a/apps/web/src/components/ChatView.logic.test.ts b/apps/web/src/components/ChatView.logic.test.ts index d5ecba5556a48..3a0da016d8317 100644 --- a/apps/web/src/components/ChatView.logic.test.ts +++ b/apps/web/src/components/ChatView.logic.test.ts @@ -74,7 +74,6 @@ import { deriveLockedProvider, hasCompactableConversation, hasServerAcknowledgedLocalDispatch, - hasStandaloneComposerCommandContext, isComposerEmptyForQueuedMessageRecall, resolveDraftCreationGroup, startNewThreadForProject, @@ -155,44 +154,6 @@ describe("deriveComposerSendState", () => { }); }); -describe("hasStandaloneComposerCommandContext", () => { - it("accepts a bare standalone command with no attachments or contexts", () => { - expect( - hasStandaloneComposerCommandContext({ - imageCount: 0, - fileCount: 0, - terminalContextCount: 0, - previewAnnotationCount: 0, - reviewCommentCount: 0, - }), - ).toBe(true); - }); - - it("rejects an expired terminal context even though it is not sendable", () => { - expect( - hasStandaloneComposerCommandContext({ - imageCount: 0, - fileCount: 0, - terminalContextCount: 1, - previewAnnotationCount: 0, - reviewCommentCount: 0, - }), - ).toBe(false); - }); - - it("rejects a file attachment so /t3-archive never consumes it", () => { - expect( - hasStandaloneComposerCommandContext({ - imageCount: 0, - fileCount: 1, - terminalContextCount: 0, - previewAnnotationCount: 0, - reviewCommentCount: 0, - }), - ).toBe(false); - }); -}); - describe("startNewThreadForProject", () => { it("starts a thread through the supplied shared handler for the active project", () => { const calls: Array<[{ environmentId: EnvironmentId; projectId: ProjectId }, unknown]> = []; diff --git a/apps/web/src/components/ChatView.logic.ts b/apps/web/src/components/ChatView.logic.ts index fc2fde80fd22c..6a578efb47ac5 100644 --- a/apps/web/src/components/ChatView.logic.ts +++ b/apps/web/src/components/ChatView.logic.ts @@ -894,22 +894,6 @@ export function isComposerEmptyForQueuedMessageRecall(options: { ); } -export function hasStandaloneComposerCommandContext(input: { - imageCount: number; - fileCount: number; - terminalContextCount: number; - previewAnnotationCount: number; - reviewCommentCount: number; -}): boolean { - return ( - input.imageCount === 0 && - input.fileCount === 0 && - input.terminalContextCount === 0 && - input.previewAnnotationCount === 0 && - input.reviewCommentCount === 0 - ); -} - export function buildExpiredTerminalContextToastCopy( expiredTerminalContextCount: number, variant: "omitted" | "empty", diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 9a46f5f7e0edc..36b4f3c41585c 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -4010,7 +4010,6 @@ export default function ChatView(props: ChatViewProps) { activeThreadShell={activeThreadShell} activeThreadRuns={serverProjection?.runs ?? EMPTY_RUNS} promptHistoryEntries={timelineEntries} - isServerThread={isServerThread} forceExpandedOnMobile={ forceExpandedMobileComposer && isDraftHeroState } diff --git a/apps/web/src/components/chat/ChatComposer.tsx b/apps/web/src/components/chat/ChatComposer.tsx index 8e2f2ac5318a0..fe3469b838617 100644 --- a/apps/web/src/components/chat/ChatComposer.tsx +++ b/apps/web/src/components/chat/ChatComposer.tsx @@ -417,8 +417,6 @@ export interface ChatComposerProps { activeThreadShell: ThreadShell | null; activeThreadRuns: ReadonlyArray; promptHistoryEntries: ReadonlyArray; - /** Fork: the thread exists on the server (offers /t3-archive). */ - isServerThread: boolean; forceExpandedOnMobile: boolean; projectSelectionRequired: boolean; @@ -567,7 +565,6 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps) activeThread, activeThreadRuns, promptHistoryEntries, - isServerThread, forceExpandedOnMobile, projectSelectionRequired, phase, @@ -1299,7 +1296,6 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps) freshSessionAvailable: props.onFreshSession !== undefined, compactSlashCommandAvailable, savedPromptsAvailable: savedPrompts.length > 0, - isServerThread, selectedProvider, selectedProviderSkills, selectedProviderSlashCommands, @@ -2146,24 +2142,6 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps) return; } if (item.type === "slash-command") { - if (item.command === "t3-archive") { - const replacement = `/${item.command} `; - const replacementRangeEnd = extendReplacementRangeForTrailingSpace( - snapshot.value, - trigger.rangeEnd, - replacement, - ); - const applied = applyPromptReplacement( - trigger.rangeStart, - replacementRangeEnd, - replacement, - { expectedText: snapshot.value.slice(trigger.rangeStart, replacementRangeEnd) }, - ); - if (applied) { - setComposerHighlightedItemId(null); - } - return; - } if (item.command === "prompt") { const applied = applyPromptReplacement(trigger.rangeStart, trigger.rangeEnd, "", { expectedText: snapshot.value.slice(trigger.rangeStart, trigger.rangeEnd), diff --git a/apps/web/src/components/chat/useComposerMenuItems.ts b/apps/web/src/components/chat/useComposerMenuItems.ts index 789f4df068372..aabdb80b9c94e 100644 --- a/apps/web/src/components/chat/useComposerMenuItems.ts +++ b/apps/web/src/components/chat/useComposerMenuItems.ts @@ -77,7 +77,6 @@ export function useComposerMenuItems({ freshSessionAvailable, compactSlashCommandAvailable, savedPromptsAvailable, - isServerThread, selectedProvider, selectedProviderSkills, selectedProviderSlashCommands, @@ -100,8 +99,6 @@ export function useComposerMenuItems({ readonly compactSlashCommandAvailable: boolean; /** Fork: /prompt shows only when there is a saved prompt to insert. */ readonly savedPromptsAvailable: boolean; - /** Fork: /t3-archive needs a thread that exists on the server. */ - readonly isServerThread: boolean; readonly selectedProvider: ProviderDriverKind; readonly selectedProviderSkills: ServerProvider["skills"]; readonly selectedProviderSlashCommands: ServerProvider["slashCommands"]; @@ -278,17 +275,6 @@ export function useComposerMenuItems({ }, ] as const) : []), - ...(isServerThread - ? ([ - { - id: "slash:t3-archive", - type: "slash-command", - command: "t3-archive", - label: "/t3-archive", - description: "Archive now or when done; send again to cancel", - }, - ] as const) - : []), ...(sideChatAvailable ? ([ { diff --git a/apps/web/src/components/chat/useComposerSend.ts b/apps/web/src/components/chat/useComposerSend.ts index 83bf1f7d876b1..99fde92bf7202 100644 --- a/apps/web/src/components/chat/useComposerSend.ts +++ b/apps/web/src/components/chat/useComposerSend.ts @@ -17,7 +17,6 @@ import { snapshotComposerSend, withMessageContext, makeThreadErrorSetter, - hasStandaloneComposerCommandContext, resolveDraftCreationGroup, } from "../ChatView.logic"; import { isUsageLimitsCommand } from "@t3tools/shared/usageLimits"; @@ -62,10 +61,7 @@ import { import { type ComposerSubmissionIntent, collapseExpandedComposerCursor, - parseComposerArchiveCommand, } from "../../composer-logic"; -import { hasPendingArchive } from "@t3tools/client-runtime/state/thread-settled"; -import { useThreadActions } from "../../hooks/useThreadActions"; import { useThreadGroupCatalog } from "../../hooks/useThreadGroups"; import { useKeepFullHistoryOverrideStore } from "../../keepFullHistoryOverrideStore"; import { draftSubmissionTracker } from "../../draftSubmissionState"; @@ -397,7 +393,6 @@ export function useComposerSend(input: ComposerSendInput) { const navigate = useNavigate(); const clientSettingsHydrated = useClientSettingsHydrated(); const steerGraceWindowMs = useSteerGraceWindowMs(); - const { attemptArchiveThread } = useThreadActions(); const customGroupCatalog = useThreadGroupCatalog(); const setKeepFullHistoryOverride = useKeepFullHistoryOverrideStore((state) => state.setOverride); const startThreadTurn = useOrchestrationCommand(threadEnvironment.startTurn, { @@ -761,64 +756,6 @@ export function useComposerSend(input: ComposerSendInput) { onAdvanceActivePendingUserInput(); return; } - // Fork: `/t3-archive` archives now or when done; sent again, it cancels. - // Attachments or contexts mean a real prompt, which goes to the provider. - const archiveCommand = - !directAnnotation && - !queuedRunEdit.isEditing && - sendCtx !== undefined && - sendCtx.threadContexts.length === 0 && - hasStandaloneComposerCommandContext({ - imageCount: sendCtx.images.length, - fileCount: sendCtx.files.length, - terminalContextCount: sendCtx.terminalContexts.length, - previewAnnotationCount: sendCtx.previewAnnotations.length, - reviewCommentCount: sendCtx.reviewComments.length, - }) - ? parseComposerArchiveCommand(promptRef.current) - : null; - if (archiveCommand) { - if (archiveCommand.action === null) { - toastManager.add({ - type: "error", - title: "Unable to archive thread", - description: "Usage: /t3-archive (send again to cancel a pending archive)", - }); - return; - } - if (!isServerThread) { - toastManager.add({ type: "error", title: "No thread to archive yet" }); - return; - } - if (activeThread.archivedAt !== null) { - toastManager.add({ type: "error", title: "This thread is already archived" }); - return; - } - if (archiveCommand.action === "cancel" && !hasPendingArchive(activeThread)) { - toastManager.add({ type: "error", title: "No archive is pending for this thread" }); - return; - } - // The shared archive path: archive now (with its confirmation and - // Undo), archive when done, or cancel a pending archive. - const promptForArchive = promptRef.current; - const draftTargetForArchive = composerDraftTarget; - sendInFlightRef.current = true; - // A promise `finally`: the React Compiler cannot compile try/finally. - await attemptArchiveThread(scopeThreadRef(environmentId, activeThread.id), { - ...(archiveCommand.action === "cancel" ? { expectedAction: "cancel" as const } : {}), - scheduledHint: "Send /t3-archive again to cancel.", - // Clear only an unchanged draft: the user may have typed on meanwhile. - onApplied: () => { - if (promptRef.current !== promptForArchive) return; - promptRef.current = ""; - clearComposerDraftContent(draftTargetForArchive); - composerRef.current?.resetCursorState(); - }, - }).finally(() => { - sendInFlightRef.current = false; - }); - return; - } if (!sendCtx?.providerAvailable) { notifyDirectAnnotationAttached(); return; diff --git a/apps/web/src/composer-logic.ts b/apps/web/src/composer-logic.ts index a946d3a2e084f..b0c9d9b42d6bd 100644 --- a/apps/web/src/composer-logic.ts +++ b/apps/web/src/composer-logic.ts @@ -25,10 +25,8 @@ import { type ShortcutMatchContext, } from "./keybindings"; -export { parseComposerArchiveCommand } from "@t3tools/shared/composerTrigger"; - export type ComposerTriggerKind = "path" | "pull-request" | "slash-command" | "skill"; -export type ComposerSlashCommand = "model" | "prompt" | "t3-archive" | "side" | "btw" | "clear"; +export type ComposerSlashCommand = "model" | "prompt" | "side" | "btw" | "clear"; export type ComposerSubmissionIntent = "foreground" | "background" | "alternate"; export interface ComposerTrigger { diff --git a/apps/web/src/hooks/useThreadActions.ts b/apps/web/src/hooks/useThreadActions.ts index 3451845c7ed45..455bbb4f928ee 100644 --- a/apps/web/src/hooks/useThreadActions.ts +++ b/apps/web/src/hooks/useThreadActions.ts @@ -11,7 +11,9 @@ import { squashAtomCommandFailure, } from "@t3tools/client-runtime/state/runtime"; import { - archiveDiscardedQueuedMessageCount, + archiveDiscardedQueuedMessages, + type ArchiveQueuedMessageDiscard, + discardExceedsConfirmed, type ArchiveToggleAction, canSnooze, effectiveSnoozed, @@ -410,6 +412,27 @@ function threadOperationFailure(target: ScopedThreadRef) { ); } +/** Fork: names how many queued messages an archive discards and where they wait. */ +function queuedMessageDiscardPrompt( + title: string, + action: ArchiveToggleAction, + discarded: ArchiveQueuedMessageDiscard, +): string { + const messages = `${discarded.total} queued ${discarded.total === 1 ? "message" : "messages"}`; + const where = + discarded.inSideChats === 0 + ? "" + : discarded.inSideChats === discarded.total + ? " in its side chats" + : `, including ${discarded.inSideChats} in its side chats`; + const question = `Archive "${title}"${action === "schedule" ? " when done" : ""} and discard ${messages}${where}?`; + return discarded.inSideChats === 0 ? question : `${question}\n\n${SIDE_CHAT_DISCARD_CAVEAT}`; +} + +/** Fork: the side chat count is an upper bound the client cannot narrow (see the server cascade). */ +const SIDE_CHAT_DISCARD_CAVEAT = + "A side chat still running a delegated task stays open and keeps its messages."; + export function useThreadActions() { const archiveThreadMutation = useOrchestrationCommand(threadEnvironment.archive, { reportFailure: false, @@ -954,28 +977,51 @@ export function useThreadActions() { /** * Fork: the one user-facing archive path: archive now, when done, or cancel - * (`resolveArchiveToggleAction`). A changed `expectedAction` does nothing; archiving - * now confirms when set or when it discards queued messages, and toasts failures. Concurrent attempts collapse into one; - * `onApplied` runs once the request lands, before an archive's navigation. + * (`resolveArchiveToggleAction`). A changed `expectedAction` does nothing; archiving now + * confirms when set, any discard of queued messages confirms, and failures toast. Concurrent + * attempts collapse into one; `onApplied` runs once the request lands, before navigation. */ const attemptArchiveThread = async ( target: ScopedThreadRef, opts: { expectedAction?: ArchiveToggleAction; onApplied?: () => void; - /** Appended to the "Archive when done" notice. */ - scheduledHint?: string; } = {}, ) => { const threadKey = scopedThreadKey(target); if (archivingThreadKeys.has(threadKey)) return; - const resolved = resolveThreadTarget(target); - if (!resolved || resolved.thread.archivedAt !== null) return; - const run = async () => { + // Re-reads after a confirmation: a changed action does nothing; a larger discard asks again. + const run = async (confirmed?: { + readonly action: ArchiveToggleAction; + readonly discarded: ArchiveQueuedMessageDiscard; + }): Promise => { + const resolved = resolveThreadTarget(target); + if (!resolved || resolved.thread.archivedAt !== null) return; const toggleAction = resolveArchiveToggleAction(resolved.thread); if (opts.expectedAction !== undefined && opts.expectedAction !== toggleAction) return; + if (confirmed !== undefined && confirmed.action !== toggleAction) return; + // Discarding queued messages, including those of side chats the archive takes, always + // confirms; otherwise only archiving now does, when set. + const discarded = archiveDiscardedQueuedMessages(resolved.thread, readThreadShells()); + if ( + confirmed === undefined + ? discarded.total > 0 || (toggleAction === "archive" && confirmThreadArchive) + : discardExceedsConfirmed(discarded, confirmed.discarded) + ) { + const localApi = readLocalApi(); + if (!localApi) return; + const answer = await settlePromise(() => + localApi.dialogs.confirm( + discarded.total > 0 + ? queuedMessageDiscardPrompt(resolved.thread.title, toggleAction, discarded) + : `Archive thread "${resolved.thread.title}"?`, + ), + ); + if (answer._tag === "Failure" || !answer.value) return; + return run({ action: toggleAction, discarded }); + } if (toggleAction !== "archive") { - // Scheduling and cancelling are reversible, so they skip the confirmation. + // Scheduling and cancelling are reversible, so only discards confirm them. const input = { threadId: target.threadId }; const result = await (toggleAction === "cancel" ? cancelThreadArchiveMutation({ environmentId: target.environmentId, input }) @@ -1004,29 +1050,11 @@ export function useThreadActions() { description: toggleAction === "cancel" ? "This thread will stay open." - : `Archives when the current turn and background work finish.${ - opts.scheduledHint === undefined ? "" : ` ${opts.scheduledHint}` - }`, + : "Archives when the current turn and background work finish.", }), ); return; } - // Archiving now discards queued messages, so that always confirms. - const discardedCount = archiveDiscardedQueuedMessageCount(resolved.thread); - if (confirmThreadArchive || discardedCount > 0) { - const localApi = readLocalApi(); - if (!localApi) return; - const confirmed = await settlePromise(() => - localApi.dialogs.confirm( - discardedCount > 0 - ? `Archive "${resolved.thread.title}" and discard ${discardedCount} queued ${ - discardedCount === 1 ? "message" : "messages" - }?` - : `Archive thread "${resolved.thread.title}"?`, - ), - ); - if (confirmed._tag === "Failure" || !confirmed.value) return; - } let didArchive = false; const result = await archiveThread(target, { onArchived: () => { diff --git a/apps/web/src/hooks/useThreadActions.undo.test.ts b/apps/web/src/hooks/useThreadActions.undo.test.ts index b2ed7de4f2cc3..5748dbff5a256 100644 --- a/apps/web/src/hooks/useThreadActions.undo.test.ts +++ b/apps/web/src/hooks/useThreadActions.undo.test.ts @@ -12,6 +12,7 @@ const commands = vi.hoisted(() => ({ pin: vi.fn(), unpin: vi.fn(), archive: vi.fn(), + scheduleArchive: vi.fn(), unarchive: vi.fn(), delete: vi.fn(), settle: vi.fn(), @@ -77,6 +78,7 @@ vi.mock("../archiveUndo", () => ({ readEmptyNewThreadDraftId: () => emptyDraft.ids.shift() ?? null, })); const threadShell = vi.hoisted(() => ({ + id: "thread", title: "Thread", archivedAt: null as string | null, archiveRequest: null, @@ -95,11 +97,12 @@ const threadShell = vi.hoisted(() => ({ environmentId: "undo-env", session: null, })); -const shellLookup = vi.hoisted(() => ({ missing: false })); +const shellLookup = vi.hoisted(() => ({ missing: false, sideChats: [] as Array })); vi.mock("../state/entities", async (original) => ({ ...(await original()), readEnvironmentServerConfigLoaded: () => true, readThreadShell: () => (shellLookup.missing ? null : threadShell), + readThreadShells: () => shellLookup.sideChats, })); const visitAfterPark = vi.hoisted(() => ({ target: null as { kind: "server"; threadRef: { environmentId: string; threadId: string } } | null, @@ -116,6 +119,8 @@ vi.mock("../state/use-atom-command", () => ({ return commands.unpin; case threadEnvironment.archive: return commands.archive; + case threadEnvironment.scheduleArchive: + return commands.scheduleArchive; case threadEnvironment.unarchive: return commands.unarchive; case threadEnvironment.delete: @@ -157,6 +162,7 @@ beforeEach(() => { visitAfterPark.target = null; emptyDraft.ids = []; shellLookup.missing = false; + shellLookup.sideChats = []; threadShell.pinnedAt = null; threadShell.snoozedAt = null; threadShell.activeOrderKey = null; @@ -323,6 +329,37 @@ describe("attemptArchiveThread", () => { expect(commands.archive).not.toHaveBeenCalled(); }); + it("asks again when the queue grew while the confirmation was open", async () => { + threadShell.queuedMessageCount = 1; + dialogs.confirm + .mockImplementationOnce(async () => { + threadShell.queuedMessageCount = 2; + return true; + }) + .mockResolvedValueOnce(false); + await useThreadActions().attemptArchiveThread(target); + expect(dialogs.confirm).toHaveBeenCalledTimes(2); + expect(commands.archive).not.toHaveBeenCalled(); + }); + + it("counts side chat queues, and confirms an archive when done that discards them", async () => { + threadShell.pendingBackgroundTasks = [{ taskId: "agent", kind: "subagent" }]; + shellLookup.sideChats = [ + { + environmentId: "undo-env", + lineage: { parentThreadId: "thread", sideChat: true }, + archivedAt: null, + queuedMessageCount: 2, + }, + ]; + dialogs.confirm.mockResolvedValue(true); + await useThreadActions().attemptArchiveThread(target); + expect(dialogs.confirm).toHaveBeenCalledWith( + expect.stringContaining("2 queued messages in its side chats"), + ); + expect(commands.scheduleArchive).toHaveBeenCalledOnce(); + }); + it("keeps the thread when the confirmation is declined", async () => { clientSettings.confirmThreadArchive = true; dialogs.confirm.mockResolvedValue(false); diff --git a/apps/web/src/state/threadSteerPending.ts b/apps/web/src/state/threadSteerPending.ts index a2e7cfd8fdefc..898b3f7b11403 100644 --- a/apps/web/src/state/threadSteerPending.ts +++ b/apps/web/src/state/threadSteerPending.ts @@ -1,14 +1,15 @@ import { + revealedSteerMessageIds, STEER_PENDING_REVEAL_DELAY_MS, - unreadSteerMessageIds, + steerRevealPending, + unreadSteerKey, + unreadSteerSet, type SteerPendingThreadSnapshot, } from "@t3tools/client-runtime/state/thread-steer-pending"; -import { MessageId } from "@t3tools/contracts"; +import type { MessageId } from "@t3tools/contracts"; import { useEffect, useState } from "react"; -// Mirror of apps/mobile/src/state/thread-steer-pending.ts. Keep in sync. -const NO_PENDING_MESSAGE_IDS: ReadonlySet = new Set(); -const UNREAD_KEY_SEPARATOR = "\u0000"; +const NO_REVEALED_MESSAGE_IDS: ReadonlySet = new Set(); /** * Derived from the thread projection so it holds after reload, on other devices, and @@ -18,53 +19,21 @@ const UNREAD_KEY_SEPARATOR = "\u0000"; export function useSteerPendingMessageIds( snapshot: SteerPendingThreadSnapshot | null, ): ReadonlySet { - // Keyed by content, and the Set rebuilt from the key rather than the array, - // so projection updates that leave the unread set unchanged neither restart - // the reveal timer nor need a ref to keep Set identity stable. - const unreadKey = - snapshot === null ? "" : unreadSteerMessageIds(snapshot).join(UNREAD_KEY_SEPARATOR); - const unread = - unreadKey === "" - ? NO_PENDING_MESSAGE_IDS - : new Set(unreadKey.split(UNREAD_KEY_SEPARATOR).map((id) => MessageId.make(id))); - const [revealed, setRevealed] = useState>(NO_PENDING_MESSAGE_IDS); + return useRevealedSteerMessageIds(unreadSteerKey(snapshot)); +} + +// Takes the string key so the compiler caches the set on content, not on each projection +// update; a new set identity would restart the reveal timer while a turn streams. +function useRevealedSteerMessageIds(unreadKey: string): ReadonlySet { + const unread = unreadSteerSet(unreadKey); + const [revealed, setRevealed] = useState>(NO_REVEALED_MESSAGE_IDS); - // A steer that resolves drops out of `unread` at once; one that stays is - // revealed once the delay passes. A second steer arriving before the first - // is revealed delays both; one arriving after does not hide the first. // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- reveals held steers after the delay useEffect(() => { - let allRevealed = true; - for (const messageId of unread) { - if (!revealed.has(messageId)) { - allRevealed = false; - break; - } - } - if (allRevealed) { - return; - } - const timer = setTimeout(() => { - setRevealed(unread); - }, STEER_PENDING_REVEAL_DELAY_MS); + if (!steerRevealPending(unread, revealed)) return; + const timer = setTimeout(() => setRevealed(unread), STEER_PENDING_REVEAL_DELAY_MS); return () => clearTimeout(timer); }, [revealed, unread]); return revealedSteerMessageIds(unread, revealed); } - -function revealedSteerMessageIds( - unread: ReadonlySet, - revealed: ReadonlySet, -): ReadonlySet { - if (unread.size === 0 || revealed.size === 0) { - return NO_PENDING_MESSAGE_IDS; - } - const visible = new Set(); - for (const messageId of unread) { - if (revealed.has(messageId)) { - visible.add(messageId); - } - } - return visible.size === 0 ? NO_PENDING_MESSAGE_IDS : visible; -} diff --git a/docs/user/composer.md b/docs/user/composer.md index 5f47f734bf2a0..6d5350b766c96 100644 --- a/docs/user/composer.md +++ b/docs/user/composer.md @@ -399,11 +399,6 @@ once the provider reports usage. Claude instances can also compact idle threads for you. See [compact long conversations](./providers-claude.md#compact-long-conversations). -Send `/t3-archive` by itself, without attachments or context, to archive the current -thread on web, desktop, or mobile. A working thread -[archives when done](./thread-sidebar.md#archive-when-done); an idle one archives right -away. Send `/t3-archive` again before it runs to cancel the pending archive. - ## Goals With Codex, Claude, and OpenCode 2.2.5 or later, send `/goal` followed by what "done" means, for example diff --git a/docs/user/thread-sidebar.md b/docs/user/thread-sidebar.md index 7872198193879..cc5f128b8f2a7 100644 --- a/docs/user/thread-sidebar.md +++ b/docs/user/thread-sidebar.md @@ -297,16 +297,17 @@ already settled threads. Archiving a thread that is still working schedules the archive for when it is done. The thread menus (and swipe-right on mobile), plus the row's hover archive button, the command palette and -the archive keybinding on web and desktop, offer **Archive when done** while a turn runs. On any client, send -[`/t3-archive`](./composer.md#commands-and-skills) in the thread. An agent can also schedule +the archive keybinding on web and desktop, offer **Archive when done** while a turn runs. An agent can also schedule its own thread, for example when you ask it to "archive this thread when you're done", or another thread, such as one whose results it has just read. The archive waits for the turn and its checkpoint, for subagents, and for commands or monitors the agent waits on. Other background commands, such as dev servers, do not hold it and keep running -after the thread archives. An idle thread archives right away. +after the thread archives. An idle thread archives right away. Archiving discards queued +messages: the thread's own when it archives right away, and those of its side chats either way. +It asks first and names the count. A thread with a pending archive shows an archive icon in its row. Choose **Cancel pending -archive** from its menu or hover archive button, use the archive keybinding again, or send `/t3-archive` again to keep +archive** from its menu or hover archive button, or use the archive keybinding again, to keep it. Sending a new message, stopping the turn it waits on, a failed turn, or a workspace change also cancels it. Automatic follow-ups, such as subagent results or background notifications that wake the thread, don't: the archive waits for them too. If the turn's final checkpoint fails, the diff --git a/packages/client-runtime/src/state/threadSettled.test.ts b/packages/client-runtime/src/state/threadSettled.test.ts index 16beefb1091b6..8ef96ed62df66 100644 --- a/packages/client-runtime/src/state/threadSettled.test.ts +++ b/packages/client-runtime/src/state/threadSettled.test.ts @@ -1,13 +1,19 @@ import { CommandId, + EnvironmentId, type OrchestrationV2PendingBackgroundTask, ProviderInstanceId, RunId, + ThreadId, } from "@t3tools/contracts"; import { describe, expect, it } from "vite-plus/test"; import type { ThreadRuntimeSummary } from "./models.ts"; -import { archiveDiscardedQueuedMessageCount, resolveArchiveToggleAction } from "./threadSettled.ts"; +import { + archiveDiscardedQueuedMessages, + discardExceedsConfirmed, + resolveArchiveToggleAction, +} from "./threadSettled.ts"; function runtime(status: ThreadRuntimeSummary["status"]): ThreadRuntimeSummary { return { @@ -73,14 +79,68 @@ describe("resolveArchiveToggleAction", () => { }); }); -describe("archiveDiscardedQueuedMessageCount", () => { +describe("archiveDiscardedQueuedMessages", () => { + const environmentId = EnvironmentId.make("env"); + const parent = { ...idle, environmentId, id: ThreadId.make("parent") }; + const sideChat = (queuedMessageCount: number, overrides: object = {}) => ({ + environmentId, + lineage: { + parentThreadId: parent.id, + relationshipToParent: "fork" as const, + rootThreadId: parent.id, + sideChat: true, + }, + archivedAt: null, + queuedMessageCount, + ...overrides, + }); + it("counts queued messages, held ones included, only when archiving now", () => { // A Stop-held queue presents the interrupted run, so the runtime alone would hide it. - const held = { ...idle, runtime: runtime("interrupted"), queuedMessageCount: 2 }; - expect(archiveDiscardedQueuedMessageCount(held)).toBe(2); - expect(archiveDiscardedQueuedMessageCount({ ...idle, queuedMessageCount: 0 })).toBe(0); - expect(archiveDiscardedQueuedMessageCount(idle)).toBe(0); - // Archive-when-done on a working thread discards nothing. - expect(archiveDiscardedQueuedMessageCount({ ...held, runtime: runtime("running") })).toBe(0); + const held = { ...parent, runtime: runtime("interrupted"), queuedMessageCount: 2 }; + expect(archiveDiscardedQueuedMessages(held)).toEqual({ total: 2, inSideChats: 0 }); + expect(archiveDiscardedQueuedMessages({ ...parent, queuedMessageCount: 0 }).total).toBe(0); + expect(archiveDiscardedQueuedMessages(parent).total).toBe(0); + // Archive-when-done on a working thread discards nothing of its own. + expect(archiveDiscardedQueuedMessages({ ...held, runtime: runtime("running") }).total).toBe(0); + }); + + it("adds the queues of the side chats the archive takes, now or when done", () => { + const threads = [ + sideChat(1), + sideChat(2), + sideChat(4, { archivedAt: "2026-10-04T10:00:00.000Z" }), + sideChat(8, { environmentId: EnvironmentId.make("other") }), + sideChat(16, { lineage: { ...sideChat(0).lineage, sideChat: undefined } }), + ]; + const withQueue = { ...parent, queuedMessageCount: 1 }; + expect(archiveDiscardedQueuedMessages(withQueue, threads)).toEqual({ + total: 4, + inSideChats: 3, + }); + expect( + archiveDiscardedQueuedMessages({ ...withQueue, runtime: runtime("running") }, threads), + ).toEqual({ total: 3, inSideChats: 3 }); + const pendingArchive = { + requestId: CommandId.make("archive-1"), + runId: null, + worktreePath: null, + requestedAt: "2026-10-04T10:00:00.000Z", + status: "pending" as const, + }; + expect( + archiveDiscardedQueuedMessages({ ...withQueue, archiveRequest: pendingArchive }, threads), + ).toEqual({ total: 0, inSideChats: 0 }); + }); + + it("asks again when the side chat or the thread's own queue grew past what was confirmed", () => { + const confirmed = { total: 3, inSideChats: 2 }; + expect(discardExceedsConfirmed({ total: 3, inSideChats: 2 }, confirmed)).toBe(false); + expect(discardExceedsConfirmed({ total: 1, inSideChats: 0 }, confirmed)).toBe(false); + // The same total moved to the side chats: the prompt named fewer there. + expect(discardExceedsConfirmed({ total: 3, inSideChats: 3 }, confirmed)).toBe(true); + expect(discardExceedsConfirmed({ total: 4, inSideChats: 3 }, confirmed)).toBe(true); + // The same total moved from a side chat to the thread itself. + expect(discardExceedsConfirmed({ total: 3, inSideChats: 1 }, confirmed)).toBe(true); }); }); diff --git a/packages/client-runtime/src/state/threadSettled.ts b/packages/client-runtime/src/state/threadSettled.ts index 9689496486c89..edbaec68e2872 100644 --- a/packages/client-runtime/src/state/threadSettled.ts +++ b/packages/client-runtime/src/state/threadSettled.ts @@ -74,18 +74,63 @@ export function resolveArchiveToggleAction( : "schedule"; } +export interface ArchiveQueuedMessageDiscard { + readonly total: number; + /** The part of `total` queued in side chats, which follow their parent's archive. */ + readonly inSideChats: number; +} + +const NO_QUEUED_MESSAGE_DISCARD: ArchiveQueuedMessageDiscard = { total: 0, inSideChats: 0 }; + /** - * Fork: queued messages the archive control would discard. Archiving now cancels every queued - * run, held ones included (Stop holds the queue), so every surface confirms while this is - * positive. Archive-when-done and cancel discard nothing. + * Fork: queued messages the archive control would discard, so every surface confirms while + * `total` is positive. Archiving now cancels the thread's queued runs, held ones included (Stop + * holds the queue). The archive, now or when done, also takes the thread's unarchived side chats + * from `threads` with their queues. Cancel discards nothing. */ -export function archiveDiscardedQueuedMessageCount( +export function archiveDiscardedQueuedMessages( shell: Pick< EnvironmentThreadShell, - "archivedAt" | "archiveRequest" | "runtime" | "pendingBackgroundTasks" | "queuedMessageCount" + | "environmentId" + | "id" + | "archivedAt" + | "archiveRequest" + | "runtime" + | "pendingBackgroundTasks" + | "queuedMessageCount" >, -): number { - return resolveArchiveToggleAction(shell) === "archive" ? (shell.queuedMessageCount ?? 0) : 0; + threads: ReadonlyArray< + Pick + > = [], +): ArchiveQueuedMessageDiscard { + const action = resolveArchiveToggleAction(shell); + if (action === "cancel") return NO_QUEUED_MESSAGE_DISCARD; + let inSideChats = 0; + for (const thread of threads) { + if ( + thread.environmentId === shell.environmentId && + thread.lineage.sideChat === true && + thread.lineage.parentThreadId === shell.id && + thread.archivedAt === null + ) { + inSideChats += thread.queuedMessageCount ?? 0; + } + } + const own = action === "archive" ? (shell.queuedMessageCount ?? 0) : 0; + return own + inSideChats === 0 + ? NO_QUEUED_MESSAGE_DISCARD + : { total: own + inSideChats, inSideChats }; +} + +/** Fork: whether a re-read discard exceeds what the user confirmed, so it must ask again. */ +export function discardExceedsConfirmed( + next: ArchiveQueuedMessageDiscard, + confirmed: ArchiveQueuedMessageDiscard, +): boolean { + return ( + next.inSideChats > confirmed.inSideChats || + next.total - next.inSideChats > confirmed.total - confirmed.inSideChats + ); } export interface ThreadSnoozeShell extends QueuedThreadShell { diff --git a/packages/client-runtime/src/state/threadSteerPending.ts b/packages/client-runtime/src/state/threadSteerPending.ts index 3661e48441e4e..1102e270c07c9 100644 --- a/packages/client-runtime/src/state/threadSteerPending.ts +++ b/packages/client-runtime/src/state/threadSteerPending.ts @@ -1,8 +1,8 @@ -import type { +import { MessageId, - OrchestrationV2Run, - OrchestrationV2TurnItem, - RunId, + type OrchestrationV2Run, + type OrchestrationV2TurnItem, + type RunId, } from "@t3tools/contracts"; import type { ThreadStructureTurnItem } from "./models.ts"; @@ -104,3 +104,47 @@ export function unreadSteerMessageIds( .map((steer) => steer.messageId) ); } + +const NO_STEER_MESSAGE_IDS: ReadonlySet = new Set(); +const UNREAD_KEY_SEPARATOR = "\u0000"; + +/** + * The unread steers as a content key. Client hooks cache the set on it, so projection updates + * that leave the unread set unchanged neither restart the reveal timer nor change its identity. + */ +export function unreadSteerKey(snapshot: SteerPendingThreadSnapshot | null): string { + return snapshot === null ? "" : unreadSteerMessageIds(snapshot).join(UNREAD_KEY_SEPARATOR); +} + +export function unreadSteerSet(key: string): ReadonlySet { + return key === "" + ? NO_STEER_MESSAGE_IDS + : new Set(key.split(UNREAD_KEY_SEPARATOR).map((id) => MessageId.make(id))); +} + +/** + * Whether the reveal timer should run: some unread steer is not revealed yet. A steer arriving + * before the first is revealed delays both; one arriving after does not hide the first. + */ +export function steerRevealPending( + unread: ReadonlySet, + revealed: ReadonlySet, +): boolean { + for (const messageId of unread) { + if (!revealed.has(messageId)) return true; + } + return false; +} + +/** The steers that show a marker: still unread and revealed. A resolved steer drops out at once. */ +export function revealedSteerMessageIds( + unread: ReadonlySet, + revealed: ReadonlySet, +): ReadonlySet { + if (unread.size === 0 || revealed.size === 0) return NO_STEER_MESSAGE_IDS; + const visible = new Set(); + for (const messageId of unread) { + if (revealed.has(messageId)) visible.add(messageId); + } + return visible.size === 0 ? NO_STEER_MESSAGE_IDS : visible; +} diff --git a/packages/shared/src/composerTrigger.test.ts b/packages/shared/src/composerTrigger.test.ts index d783b26d31a77..c65bb6bfa88fc 100644 --- a/packages/shared/src/composerTrigger.test.ts +++ b/packages/shared/src/composerTrigger.test.ts @@ -4,7 +4,6 @@ import { describe, expect, it } from "vite-plus/test"; import { detectComposerTrigger, - parseComposerArchiveCommand, formatForkedThreadTitle, parseSideChatCommand, serializeComposerFileLink, @@ -188,23 +187,6 @@ describe("formatForkedThreadTitle", () => { }); }); -describe("parseComposerArchiveCommand", () => { - it.each(["/t3-archive", " /T3-ARCHIVE \n"])("toggles %s", (text) => { - expect(parseComposerArchiveCommand(text)).toEqual({ action: "toggle" }); - }); - - it("accepts cancellation and rejects unsupported arguments", () => { - expect(parseComposerArchiveCommand(" /t3-archive CANCEL ")).toEqual({ action: "cancel" }); - expect(parseComposerArchiveCommand("/t3-archive now")).toEqual({ action: null }); - expect(parseComposerArchiveCommand("/t3-archive cancel extra")).toEqual({ action: null }); - }); - - it.each(["Discuss /t3-archive", "/t3-archivex", "/archive", "/t3-archive/cancel"])( - "leaves ordinary prompt %s alone", - (text) => expect(parseComposerArchiveCommand(text)).toBeNull(), - ); -}); - describe("parseSideChatCommand", () => { it("reads an optional prompt after /side or /btw", () => { expect(parseSideChatCommand("/side")).toEqual({ prompt: "" }); diff --git a/packages/shared/src/composerTrigger.ts b/packages/shared/src/composerTrigger.ts index 3d6d70e290c61..134cdf8c1a526 100644 --- a/packages/shared/src/composerTrigger.ts +++ b/packages/shared/src/composerTrigger.ts @@ -125,19 +125,6 @@ export function detectComposerTrigger( }; } -/** - * Matches standalone archive commands so ordinary prompts remain provider input. - * The bare command toggles a pending archive; `cancel` is kept as an explicit alias. - */ -export function parseComposerArchiveCommand( - text: string, -): { action: "toggle" | "cancel" | null } | null { - const match = /^\/t3-archive(?:\s+([\s\S]*))?$/i.exec(text.trim()); - if (!match) return null; - const argument = match[1]?.trim().toLowerCase() ?? ""; - return { action: argument === "" ? "toggle" : argument === "cancel" ? "cancel" : null }; -} - // The three RGI subdivision flags: England, Scotland, and Wales. const SUBDIVISION_FLAG_PATTERN = "\\u{1F3F4}\\u{E0067}\\u{E0062}(?:\\u{E0065}\\u{E006E}\\u{E0067}|\\u{E0073}\\u{E0063}\\u{E0074}|\\u{E0077}\\u{E006C}\\u{E0073})\\u{E007F}"; diff --git a/patches/expo-image-picker@58.0.10.patch b/patches/expo-image-picker@58.0.10.patch index 58a0c2e03a9ea..451dcc013c293 100644 --- a/patches/expo-image-picker@58.0.10.patch +++ b/patches/expo-image-picker@58.0.10.patch @@ -1,26 +1,8 @@ diff --git a/ios/ImagePickerHandler.swift b/ios/ImagePickerHandler.swift -index 476910ded2a9f53ce18563b3f8c005717cb451e4..ff9260a8e0c5b73e55afb083315bae5efcfb105a 100644 +index 476910ded2a9f53ce18563b3f8c005717cb451e4..b21861673964d98ad95b8ef37a2b48aa6d73efdc 100644 --- a/ios/ImagePickerHandler.swift +++ b/ios/ImagePickerHandler.swift -@@ -52,25 +52,33 @@ internal class ImagePickerHandler: NSObject, - // MARK: - UIImagePickerControllerDelegate - - func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: MediaInfo) { -- handlePickedMedia(mediaInfo: info) -- picker.dismiss(animated: true) -+ picker.dismiss(animated: true) { [weak self] in -+ self?.handlePickedMedia(mediaInfo: info) -+ } - } - - func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { -- handlePickingCancellation() -- picker.dismiss(animated: true) -+ picker.dismiss(animated: true) { [weak self] in -+ self?.handlePickingCancellation() -+ } - } - +@@ -64,13 +64,19 @@ internal class ImagePickerHandler: NSObject, // MARK: - PHPickerViewControllerDelegate func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) { @@ -47,10 +29,10 @@ index 476910ded2a9f53ce18563b3f8c005717cb451e4..ff9260a8e0c5b73e55afb083315bae5e // MARK: - UIAdaptivePresentationControllerDelegate diff --git a/ios/ImagePickerModule.swift b/ios/ImagePickerModule.swift -index 6d413603b378ee4b70cdd37bd48bb020ffc49755..f643d04f7cd13505a9f5a8c2e86c4bdc364aa5ed 100644 +index bc19e0525a1ab36e394f3609235daacb794888e3..29419cb493707024142324e9135575ffb8b560aa 100644 --- a/ios/ImagePickerModule.swift +++ b/ios/ImagePickerModule.swift -@@ -163,6 +163,13 @@ public class ImagePickerModule: Module, OnMediaPickingResultHandler { +@@ -169,6 +169,13 @@ public class ImagePickerModule: Module, OnMediaPickingResultHandler { } private func presentPickerUI(_ picker: PickerUIController, pickingContext context: PickingContext) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 748ff25596b17..87dfc3ce1d623 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -380,7 +380,7 @@ patchedDependencies: dbus-next@0.10.2: cfff57561b0ee59b5addb3b2e6c6f20906e967507a530ab67e8db8108e520ba4 electron-updater@6.8.9: 91b5648a7eed42761523ef542ebb7e548b037eda41d66533c8152ac65ac72155 expo-audio@58.0.11: 92414572bf24ffd0c45de44c45f11f6c48bc0af13b8b9a56f77a67bc0e915c1e - expo-image-picker@58.0.10: 14695f23a28ddaf690584c26af6b3da56fde32223414d806642f099b07c29be2 + expo-image-picker@58.0.10: 88fc761c6cf48f5b7be5bd07936c461d01205d2a0c21583a97dc263a0ac6381b expo-modules-core@58.0.30: 71ef37c8b95c45d2f453d85e707b65764734aac1ba546e30ac636cbbea3b3f7a expo-network@58.0.4: 159c2d760d1cd5102e95df51c20600111e7a72096ef0daea8215d50cae48bd98 expo-notifications@58.1.8: 36541a7e5f22b7a7b6f78f51d839a812fc012434c48fc10093985628f413b8a8 @@ -694,7 +694,7 @@ importers: version: 58.0.16(expo@58.0.23)(react-native@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0) expo-image-picker: specifier: 58.0.10 - version: 58.0.10(patch_hash=14695f23a28ddaf690584c26af6b3da56fde32223414d806642f099b07c29be2)(expo@58.0.23) + version: 58.0.10(patch_hash=88fc761c6cf48f5b7be5bd07936c461d01205d2a0c21583a97dc263a0ac6381b)(expo@58.0.23) expo-keep-awake: specifier: ~58.0.3 version: 58.0.3(expo@58.0.23)(react@19.3.0) @@ -19431,7 +19431,7 @@ snapshots: react: 19.3.0 react-native: 0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6) - expo-image-picker@58.0.10(patch_hash=14695f23a28ddaf690584c26af6b3da56fde32223414d806642f099b07c29be2)(expo@58.0.23): + expo-image-picker@58.0.10(patch_hash=88fc761c6cf48f5b7be5bd07936c461d01205d2a0c21583a97dc263a0ac6381b)(expo@58.0.23): dependencies: expo: 58.0.23(d226faf1ca90e630d8c56a2108dee32d) expo-image-loader: 58.0.3(expo@58.0.23)