Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
cacf444
Refine archived settings panel UX
Quicksaver Jun 24, 2026
57a1e76
Move archived project actions into context menu
Quicksaver Jun 25, 2026
67a0477
Add archive thread search and ranked filtering
Quicksaver Jun 25, 2026
da19562
Scope archive bulk actions to visible threads
Quicksaver Jun 25, 2026
5d9ac5a
Fix archive project bulk actions during search
Quicksaver Jun 25, 2026
d8cb38b
Scope archive bulk actions to visible rows
Quicksaver Jun 25, 2026
1b02962
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jun 25, 2026
74fcff2
Respect archive delete confirmation setting
Quicksaver Jun 25, 2026
6167a3d
Clarify archived bulk failure toasts
Quicksaver Jun 25, 2026
9653b5b
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jun 25, 2026
5455c7e
Port archive settings review fix
Quicksaver Jun 25, 2026
b6ad57b
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jun 25, 2026
e493576
Address archive settings review follow-ups
Quicksaver Jun 26, 2026
8405c06
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jun 26, 2026
7d9e19f
Refactor archived settings logic
Quicksaver Jun 26, 2026
8fb00f4
Fix archived project bulk action errors
Quicksaver Jun 26, 2026
a5b1b97
Fix archived settings review issues
Quicksaver Jun 26, 2026
0c08df9
Fix archived confirmation fallback
Quicksaver Jun 26, 2026
a579f7e
Fix archived project grouping keys
Quicksaver Jun 26, 2026
5ff0c25
Fix archived project UI keys
Quicksaver Jun 26, 2026
5d8b2f3
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jun 27, 2026
b07ae41
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jun 27, 2026
6ae2079
Move archived settings into a dedicated panel
Quicksaver Jun 27, 2026
39e2452
Fix archived project action access
Quicksaver Jun 27, 2026
19e1ffa
Align archived thread rows with headers
Quicksaver Jun 27, 2026
9ccfdce
Fix archived settings review issues
Quicksaver Jun 27, 2026
3c509f3
Fix archive action confirmation fallback
Quicksaver Jun 27, 2026
0d07f3a
Handle archive bulk action exceptions
Quicksaver Jun 27, 2026
10632e1
Fetch archive settings across all environments
Quicksaver Jun 27, 2026
26eea31
Clarify filtered archive bulk menu actions
Quicksaver Jun 27, 2026
5c7e395
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jun 29, 2026
c8e2721
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jul 1, 2026
c7dacda
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jul 3, 2026
69785d4
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jul 4, 2026
26733f7
Merge remote-tracking branch 'refs/remotes/upstream/main' into split/…
Quicksaver Jul 5, 2026
e27d68a
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jul 10, 2026
ee7557c
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jul 13, 2026
0cfc5ee
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jul 15, 2026
d6355b5
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jul 16, 2026
9d1de46
Add archive settings branch details
Quicksaver Jul 17, 2026
7e60c51
Remove unrelated archive behavior claim
Quicksaver Jul 17, 2026
d13a277
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jul 18, 2026
7c4995d
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jul 19, 2026
f5e2450
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jul 19, 2026
89256c8
Expand native archived threads management
Quicksaver Jul 19, 2026
5fe8242
Document native archive settings UX behavior
Quicksaver Jul 19, 2026
4c4555c
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jul 19, 2026
d8f7c59
Configure pnpm virtual store and Effect Vitest peers
Quicksaver Jul 19, 2026
5629fc9
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jul 20, 2026
556df7c
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jul 20, 2026
0babd24
Fix archive sorting and failure feedback
Quicksaver Jul 20, 2026
7aa53f0
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jul 20, 2026
bf242fd
Fix archive review regressions
Quicksaver Jul 20, 2026
7e257a4
Surface mobile archive bulk failure details
Quicksaver Jul 20, 2026
6f38d10
Merge remote-tracking branch 'upstream/main' into split/archive-setti…
Quicksaver Jul 21, 2026
fd6316d
Show environment labels in archived project headers
Quicksaver Jul 21, 2026
8463f78
Add multi-environment archive label coverage
Quicksaver Jul 21, 2026
30e519e
Distinguish skipped archive actions
Quicksaver Jul 21, 2026
2485e27
Preserve archive search ranking tiers
Quicksaver Jul 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions BRANCH_DETAILS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Archive Settings UX

The settings Archive panel uses a dense layout so large archives remain scannable. The native mobile Archived Threads screen mirrors the same information hierarchy and behavior with mobile-native project sections, swipe actions, long-press menus, and header controls.

Expected behavior:

- Archived conversations are grouped by project, and each project group is collapsed by default.
- The Archive panel fetches archived thread snapshots from all configured environments, not only environments that currently have active projects, so archived-only workspaces remain visible, while active rows returned in those snapshots remain excluded from archive content and empty-state counts.
- Web project headers show environment labels whenever multiple environments are configured and keep a sole remote environment labeled, while a sole primary environment remains implicit.
- The page includes a search box that filters archived thread titles across all projects case-insensitively. Multi-word searches match any term, rank exact phrase matches first, rank titles matching every term ahead of partial term matches, and auto-open matching project groups while search is active.
- Expanded project headers include sortable `Archived` and `Created` columns; clicking either header toggles ascending/descending order for the conversations inside each group, with `Archived` descending as the default.
- Native project-section ordering follows the selected archive sort field and direction. Invalid archived timestamps fall back to the conversation's created timestamp for sorting and display on both surfaces.
- Native bulk actions distinguish rows skipped because the same thread action is already in progress from commands that actually fail, and report both outcomes accurately.
- Conversation rows show only the relative archived and created ages inline with the title by default. On web row hover or keyboard focus, those age labels fade out and icon-only unarchive/delete actions appear as a right-side overlay with tooltips, matching the sidebar and source-control list-row action pattern. Native rows keep both age columns visible and expose the same actions through swipe gestures and the standard long-press context menu.
- Archived conversations can be deleted directly from the Archive panel without unarchiving first. Web delete actions respect the shared `confirmThreadDelete` client setting, while native keeps its standard guarded delete flow.
- Project group context menus expose `unarchive all` and `delete all` actions. While search is active, those bulk actions apply to the visible matching archived conversations and use matching-specific menu labels; otherwise they apply to all archived conversations in the project. Delete confirmations respect `confirmThreadDelete` on web and remain explicitly guarded on native; unarchive bulk actions remain guarded on both surfaces, and partial failures surface as not-fully-completed feedback instead of implying every archived thread failed.
- Archive grouping, search ranking, sort state, and project bulk-action concurrency live in `apps/web/src/components/settings/SettingsPanels.logic.ts` on web and `apps/mobile/src/features/archive/archivedThreadList.ts` on native so the dense Archive behavior stays covered without growing the React components. Project groups expose and reuse collision-safe keys so project ids containing separator characters do not collapse expansion state or React row identity. Bulk actions stop scheduling new work after thrown failures, wait for active workers to settle, show incomplete-operation feedback, and surface the underlying exception messages instead of only a generic aggregate error. The Archive surfaces refresh archived threads after bulk unarchive/delete attempts even when the action runner throws.

Primary files:

- `apps/web/src/components/settings/ArchiveSettings.tsx`
- `apps/web/src/components/settings/SettingsPanels.tsx`
- `apps/web/src/components/settings/SettingsPanels.logic.ts`
- `apps/mobile/src/features/archive/ArchivedThreadsRouteScreen.tsx`
- `apps/mobile/src/features/archive/ArchivedThreadsScreen.tsx`
- `apps/mobile/src/features/archive/archivedThreadList.ts`

## Development Ports

- Web: `5734`
- Server/WebSocket: `13774`
146 changes: 129 additions & 17 deletions apps/mobile/src/features/archive/ArchivedThreadsRouteScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,70 @@ import * as Arr from "effect/Array";
import * as Order from "effect/Order";
import { useFocusEffect } from "@react-navigation/native";
import { useCallback, useMemo, useState } from "react";
import { Alert, Platform } from "react-native";

import { showConfirmDialog } from "../../components/ConfirmDialogHost";
import { useSavedRemoteConnections } from "../../state/use-remote-environment-registry";
import { useClerkSettingsSheetDetent } from "../cloud/ClerkSettingsSheetDetent";
import { useArchivedThreadListActions } from "../home/useThreadListActions";
import {
ArchivedThreadsScreen,
type ArchivedThreadsHeaderEnvironment,
} from "./ArchivedThreadsScreen";
import { buildArchivedThreadGroups, type ArchivedThreadSortOrder } from "./archivedThreadList";
import {
archivedThreadActionExceptionDescription,
archivedThreadActionSummaryDescription,
buildArchivedThreadGroups,
parseArchivedThreadSearchInput,
runArchivedThreadActions,
type ArchivedThreadSortState,
} from "./archivedThreadList";
import {
refreshArchivedThreadsForEnvironment,
useArchivedThreadSnapshots,
} from "./useArchivedThreadSnapshots";
import type { EnvironmentThreadShell } from "@t3tools/client-runtime/state/shell";
import { scopedThreadKey } from "../../lib/scopedEntities";

function confirmArchivedProjectAction(input: {
readonly title: string;
readonly message: string;
readonly confirmText: string;
readonly destructive?: boolean;
}): Promise<boolean> {
return new Promise((resolve) => {
if (Platform.OS === "ios") {
Alert.alert(input.title, input.message, [
{ text: "Cancel", style: "cancel", onPress: () => resolve(false) },
{
text: input.confirmText,
style: input.destructive ? "destructive" : "default",
onPress: () => resolve(true),
},
]);
return;
}
showConfirmDialog({
title: input.title,
message: input.message,
confirmText: input.confirmText,
destructive: input.destructive,
onCancel: () => resolve(false),
onConfirm: () => resolve(true),
});
});
}

export function ArchivedThreadsRouteScreen() {
const { expand } = useClerkSettingsSheetDetent();
const { savedConnectionsById } = useSavedRemoteConnections();
const [searchQuery, setSearchQuery] = useState("");
const [selectedEnvironmentId, setSelectedEnvironmentId] = useState<EnvironmentId | null>(null);
const [sortOrder, setSortOrder] = useState<ArchivedThreadSortOrder>("newest");
const [sort, setSort] = useState<ArchivedThreadSortState>({
field: "archivedAt",
direction: "desc",
});
const [busyThreadKeys, setBusyThreadKeys] = useState<ReadonlySet<string>>(() => new Set());
const environments = useMemo<ReadonlyArray<ArchivedThreadsHeaderEnvironment>>(
() =>
Arr.sort(
Expand All @@ -40,33 +84,97 @@ export function ArchivedThreadsRouteScreen() {
() => environments.map((environment) => environment.environmentId),
[environments],
);
const environmentLabels = useMemo(
() =>
Object.fromEntries(
environments.map((environment) => [environment.environmentId, environment.label]),
),
[environments],
);
const { error, isLoading, refresh, snapshots } = useArchivedThreadSnapshots(environmentIds);
const search = useMemo(() => parseArchivedThreadSearchInput(searchQuery), [searchQuery]);
const groups = useMemo(
() =>
buildArchivedThreadGroups({
snapshots,
environmentLabels,
environmentId: selectedEnvironmentId,
searchQuery,
sortOrder,
search,
sort,
}),
[environmentLabels, searchQuery, selectedEnvironmentId, snapshots, sortOrder],
[search, selectedEnvironmentId, snapshots, sort],
);
const refreshChangedEnvironment = useCallback(
(thread: { readonly environmentId: EnvironmentId }) => {
refreshArchivedThreadsForEnvironment(thread.environmentId);
},
[],
);
const { unarchiveThread, confirmDeleteThread } =
const { unarchiveThread, deleteThread, confirmDeleteThread } =
useArchivedThreadListActions(refreshChangedEnvironment);
const updateBusyThreads = useCallback(
(threads: ReadonlyArray<EnvironmentThreadShell>, busy: boolean) => {
setBusyThreadKeys((current) => {
const next = new Set(current);
for (const thread of threads) {
const key = scopedThreadKey(thread.environmentId, thread.id);
if (busy) next.add(key);
else next.delete(key);
}
return next;
});
},
[],
);
const handleUnarchiveThread = useCallback(
async (thread: EnvironmentThreadShell) => {
updateBusyThreads([thread], true);
try {
await unarchiveThread(thread);
} finally {
updateBusyThreads([thread], false);
}
},
[unarchiveThread, updateBusyThreads],
);
const handleProjectAction = useCallback(
async (
projectTitle: string,
threads: ReadonlyArray<EnvironmentThreadShell>,
scope: "all" | "matching",
action: "unarchive" | "delete",
) => {
const scopeLabel =
scope === "matching" ? "matching archived conversations" : "all archived conversations";
const actionLabel = action === "unarchive" ? "Unarchive" : "Delete";
const confirmed = await confirmArchivedProjectAction({
title: `${actionLabel} ${scopeLabel}?`,
message:
action === "unarchive"
? `Restore ${threads.length} conversation${threads.length === 1 ? "" : "s"} from “${projectTitle}”?`
: `Permanently delete ${threads.length} conversation${threads.length === 1 ? "" : "s"} from “${projectTitle}”? This also clears their terminal history.`,
confirmText: actionLabel,
destructive: action === "delete",
});
if (!confirmed) return;

updateBusyThreads(threads, true);
try {
const summary = await runArchivedThreadActions(threads, (thread) =>
action === "unarchive"
? unarchiveThread(thread, { reportFailure: false })
: deleteThread(thread, { reportFailure: false }),
);
if (summary.failed > 0 || summary.skipped > 0) {
Alert.alert(
`Archived threads not fully ${action === "unarchive" ? "unarchived" : "deleted"}`,
archivedThreadActionSummaryDescription(summary),
);
}
} catch (error) {
Alert.alert(
`Archived threads not fully ${action === "unarchive" ? "unarchived" : "deleted"}`,
archivedThreadActionExceptionDescription(error),
);
Comment thread
Quicksaver marked this conversation as resolved.
} finally {
updateBusyThreads(threads, false);
refresh();
}
},
[deleteThread, refresh, unarchiveThread, updateBusyThreads],
);

useFocusEffect(
useCallback(() => {
Expand All @@ -83,13 +191,17 @@ export function ArchivedThreadsRouteScreen() {
isLoading={isLoading}
onDeleteThread={confirmDeleteThread}
onEnvironmentChange={setSelectedEnvironmentId}
onProjectAction={(projectTitle, threads, scope, action) =>
void handleProjectAction(projectTitle, threads, scope, action)
}
onRefresh={refresh}
onSearchQueryChange={setSearchQuery}
onSortOrderChange={setSortOrder}
onUnarchiveThread={unarchiveThread}
onSortChange={setSort}
onUnarchiveThread={(thread) => void handleUnarchiveThread(thread)}
searchQuery={searchQuery}
selectedEnvironmentId={selectedEnvironmentId}
sortOrder={sortOrder}
sort={sort}
busyThreadKeys={busyThreadKeys}
/>
);
}
Loading
Loading