Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion .github/workflows/closura-arc-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ jobs:
'packages/contracts/src/speech.ts': ['assemblyai'],
'apps/web/src/components/settings/CloudVoiceConfiguration.tsx': ['assemblyai'],
'packages/contracts/src/threadInbox.ts': ['matchesInboxView', 'agent-only'],
'apps/web/src/components/sidebar/SidebarInboxBar.tsx': ['All threads', 'Jeff', 'Kameron'],
'apps/web/src/components/sidebar/SidebarThreadFilterMenu.tsx': ['Kameron', 'Jeff', 'Agents', 'Environments'],
'apps/web/src/components/sidebar/threadListFilter.logic.ts': ['matchesInboxFilter', 'hiddenEnvironmentIds'],
};
for (const [file, needles] of Object.entries(required)) {
const source = readFileSync(file, 'utf8');
Expand Down Expand Up @@ -147,6 +148,7 @@ jobs:
packages/contracts/src/threadInbox.test.ts \
packages/contracts/src/threadMetadataMcp.test.ts \
apps/web/src/components/threadActionMenu.logic.test.ts \
apps/web/src/components/sidebar/threadListFilter.logic.test.ts \
apps/server/src/orchestration-v2/ThreadLaunchService.test.ts \
apps/server/src/orchestration-v2/SubagentProjection.test.ts \
packages/shared/src/threadPlacement.test.ts \
Expand Down
29 changes: 19 additions & 10 deletions apps/web/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { effectiveInboxView, matchesInboxView } from "@t3tools/contracts";
import { SidebarInboxBar } from "./sidebar/SidebarInboxBar";
import { SidebarThreadFilterMenu } from "./sidebar/SidebarThreadFilterMenu";
import { matchesThreadListFilter, threadListFilterOf } from "./sidebar/threadListFilter.logic";
import { threadRoutingUpdateFromMenuAction } from "./threadActionMenu.logic";
import { attachSidebarTree } from "../lib/sidebarTree";
import { type EnvironmentId, type ScopedProjectRef } from "@t3tools/contracts";
Expand Down Expand Up @@ -1103,13 +1103,12 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
);
const threads = useQuietThreadShells();
const promotingDraftThreadKeys = usePromotingDraftThreadKeys();
const inboxView = useClientSettings(effectiveInboxView);
const inboxThreads = threads.filter(
(thread) =>
threadSearchQuery.trim().length > 0 ||
matchesInboxView(thread.source.inbox, inboxView) ||
(inboxView === "agents" && thread.source.createdBy === "agent"),
);
const threadListFilter = useClientSettings(threadListFilterOf);
// Search always looks across every inbox and environment.
const inboxThreads =
threadSearchQuery.trim().length > 0
? threads
: threads.filter((thread) => matchesThreadListFilter(thread, threadListFilter));
const listedThreads =
promotingDraftThreadKeys.length === 0
? inboxThreads
Expand Down Expand Up @@ -2992,6 +2991,17 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
<SidebarGroup className="z-[1]">
<SidebarThreadHeader
hasProjects={projectGroups.length > 0}
threadFilter={
<SidebarThreadFilterMenu
countedThreads={() =>
filterSidebarV2VisibleThreads(
threads,
scopedProjectKeys,
delegatedUnderParent,
).filter((thread) => thread.settledOverride !== "settled")
}
/>
}
projectScope={
<Combobox
items={projectScopeItems}
Expand Down Expand Up @@ -3217,7 +3227,6 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
activeSearchResultIndex={activeSearchResultIndex}
onClearSearch={clearThreadSearch}
/>
<SidebarInboxBar />
</SidebarGroup>
}
>
Expand Down
13 changes: 10 additions & 3 deletions apps/web/src/components/ThreadNotificationCoordinator.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { effectiveInboxView, matchesInboxView } from "@t3tools/contracts";
import {
type EnvironmentThreadShell,
type PendingSubagentRequest,
Expand All @@ -21,6 +20,7 @@ import {

import { getClientSettings, subscribeClientSettings } from "../hooks/useSettings";
import { isWindowsPlatform } from "../lib/utils";
import { matchesThreadListFilter, threadListFilterOf } from "./sidebar/threadListFilter.logic";
import { environmentSummaries } from "../state/presentation";
import { environmentShell } from "../state/shell";
import { environmentThreadShells } from "../state/threads";
Expand Down Expand Up @@ -114,9 +114,10 @@ export function startThreadNotifications(
? new Set(registry.get(environmentThreadShells.threadRefsAtom).map(threadKey))
: null;
const outsideInbox = new Set<string>();
const filter = threadListFilterOf(getClientSettings());
for (const [environmentId, state] of watched) {
for (const [threadId, entry] of state.previous) {
if (!matchesInboxView(entry.thread.source.inbox, effectiveInboxView(getClientSettings())))
if (!matchesThreadListFilter({ environmentId, source: entry.thread.source }, filter))
outsideInbox.add(threadKey({ environmentId, threadId }));
}
}
Expand All @@ -143,7 +144,13 @@ export function startThreadNotifications(
kind: ThreadNotificationKind,
) => {
const { thread, status } = state;
if (!matchesInboxView(thread.source.inbox, effectiveInboxView(getClientSettings()))) return;
if (
!matchesThreadListFilter(
{ environmentId, source: thread.source },
threadListFilterOf(getClientSettings()),
)
)
return;
if (
registry
.get(environmentThreadShells.hiddenThreadKeysAtom)
Expand Down
36 changes: 36 additions & 0 deletions apps/web/src/components/settings/NewThreadInboxSettings.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { updateClientSettings, useClientSettings } from "../../hooks/useSettings";
import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "../ui/select";
import { SettingsRow } from "./settingsLayout";
import { searchableSetting } from "./settingsSearch";

const OWNER_LABELS = { kameron: "Kameron", jeff: "Jeff" } as const;

/** Which founder new threads from this device are filed under; the sidebar filter only views. */
export function NewThreadInboxRow() {
const owner = useClientSettings((settings) => settings.founderInboxOwner);
return (
<SettingsRow
{...searchableSetting("new-thread-inbox")}
description="Threads you start on this device go to this inbox. Until you choose, they stay unfiled."
control={
<div className="w-full sm:w-40">
<Select
value={owner ?? null}
onValueChange={(value) => {
if (value === "kameron" || value === "jeff")
void updateClientSettings({ founderInboxOwner: value });
}}
>
<SelectTrigger size="sm" className="w-full min-w-0" aria-label="New threads belong to">
<SelectValue>{owner ? OWNER_LABELS[owner] : "Not set"}</SelectValue>
</SelectTrigger>
<SelectPopup align="end" alignItemWithTrigger={false}>
<SelectItem value="kameron">Kameron</SelectItem>
<SelectItem value="jeff">Jeff</SelectItem>
</SelectPopup>
</Select>
</div>
}
/>
);
}
7 changes: 7 additions & 0 deletions apps/web/src/components/settings/SettingsPanels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import { scopedIdleCompaction } from "./scopedSettings";
import { ProjectDefaultsSettings } from "./ProjectDefaultsSettings";
import { ThreadTitleInstructionsSettings } from "./ThreadTitleInstructionsSettings";
import { SnoozePresetsRow } from "./SnoozePresetsSettings";
import { NewThreadInboxRow } from "./NewThreadInboxSettings";
import { useDesktopUpdateState } from "../../state/desktopUpdate";
import { managedTelemetryOffMessage, usePrimaryManagedPolicy } from "../../state/managedPolicy";
import {
Expand Down Expand Up @@ -1840,6 +1841,12 @@ export function ThreadsSettingsPanel() {

<ProjectDefaultsSettings category="general" />

{!isProjectScope ? (
<SettingsSection id="inbox" title="Inbox">
<NewThreadInboxRow />
</SettingsSection>
) : null}

{!isProjectScope ? (
<SettingsSection id="snooze" title="Snooze">
<SnoozePresetsRow />
Expand Down
6 changes: 6 additions & 0 deletions apps/web/src/components/settings/settingsSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,12 @@ export const SETTINGS_SEARCH_ITEMS = [
scope: "project-defaults",
searchTerms: ["new worktrees start remote origin latest fetched branch local"],
},
{
id: "new-thread-inbox",
title: "New threads belong to",
to: "/settings/threads",
searchTerms: ["inbox owner founder kameron jeff attribute filed"],
},
{
id: "add-project-starts-in",
title: "Add project starts in",
Expand Down
54 changes: 0 additions & 54 deletions apps/web/src/components/sidebar/SidebarInboxBar.tsx

This file was deleted.

Loading
Loading