Skip to content

Commit cc07d84

Browse files
fix(web): project memory is a standard thread details row
Project memory was a bare ghost button between the card's sections, so it had no icon, no row styling, and none of the section padding. It is now a row in the workspace section beside Code index and Conversation summaries, and it can be hidden from Choose what to show. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 6c2d72a commit cc07d84

3 files changed

Lines changed: 24 additions & 6 deletions

File tree

‎apps/web/src/components/chat/ThreadDetailsPanel.tsx‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ export function ThreadDetailsPanel(props: ThreadDetailsPanelProps) {
152152
environment: density === "full" && visible.environment,
153153
openIn: density !== "essential" && visible.openIn && props.showOpenInPicker,
154154
scripts: visible.scripts && props.activeProjectScripts !== undefined,
155+
memory: visible.memory,
155156
branch: props.gitCwd !== null && props.isGitRepo && visible.branch,
156157
git:
157158
props.gitCwd !== null &&
@@ -162,7 +163,7 @@ export function ThreadDetailsPanel(props: ThreadDetailsPanelProps) {
162163
return (
163164
<>
164165
<div className="group/details-items">
165-
{show.environment || show.openIn || show.scripts || showIndexRows ? (
166+
{show.environment || show.openIn || show.scripts || show.memory || showIndexRows ? (
166167
<ThreadDetailsSection
167168
headingId="thread-details-workspace-heading"
168169
title="Workspace"
@@ -224,6 +225,13 @@ export function ThreadDetailsPanel(props: ThreadDetailsPanelProps) {
224225
threadId={props.threadId}
225226
/>
226227
) : null}
228+
229+
{show.memory ? (
230+
<ProjectMemoryPanel
231+
environmentId={props.environmentId}
232+
projectId={props.projectId}
233+
/>
234+
) : null}
227235
</div>
228236
</ThreadDetailsSection>
229237
) : null}
@@ -254,8 +262,6 @@ export function ThreadDetailsPanel(props: ThreadDetailsPanelProps) {
254262
</ThreadDetailsSection>
255263
) : null}
256264

257-
<ProjectMemoryPanel environmentId={props.environmentId} projectId={props.projectId} />
258-
259265
{density === "full" && !props.draftId && visible.servers ? (
260266
<ThreadServersPanel environmentId={props.environmentId} threadId={props.threadId} />
261267
) : null}

‎apps/web/src/components/chat/threadDetailsItems.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const THREAD_DETAILS_ITEMS = [
55
{ id: "environment", label: "Environment and worktree", defaultVisible: true },
66
{ id: "openIn", label: "Open in editor", defaultVisible: true },
77
{ id: "scripts", label: "Project scripts", defaultVisible: true },
8+
{ id: "memory", label: "Project memory", defaultVisible: true },
89
{ id: "branch", label: "Branch and pull request", defaultVisible: true },
910
{ id: "gitActions", label: "Git actions", defaultVisible: true },
1011
{ id: "changes", label: "Changes", defaultVisible: true },

‎apps/web/src/components/projectKnowledge/ProjectMemoryPanel.tsx‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ import {
2222
import { projectKnowledgeContextRecord } from "@t3tools/client-runtime/projectKnowledge";
2323
import { scopedThreadKey } from "@t3tools/client-runtime/environment";
2424
import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
25+
import { BrainIcon } from "lucide-react";
2526
import { Button } from "../ui/button";
27+
import { ThreadDetailsControl } from "../chat/ThreadDetailsControl";
28+
import {
29+
THREAD_DETAILS_PANEL_ICON_CLASS,
30+
THREAD_DETAILS_PANEL_LABEL_CLASS,
31+
} from "../chat/threadDetailsPanelStyles";
2632
import { Checkbox } from "../ui/checkbox";
2733
import { Input } from "../ui/input";
2834
import { ScrollArea } from "../ui/scroll-area";
@@ -120,15 +126,19 @@ export function ProjectMemoryPanel(props: ProjectScope) {
120126
const open = useOpenProjectMemory();
121127
if (!available) return null;
122128
return (
123-
<Button variant="ghost" size="sm" onClick={() => open(props)}>
124-
Project memory
125-
</Button>
129+
<ThreadDetailsControl onClick={() => open(props)}>
130+
<BrainIcon aria-hidden className={THREAD_DETAILS_PANEL_ICON_CLASS} />
131+
<span className={`min-w-0 flex-1 truncate ${THREAD_DETAILS_PANEL_LABEL_CLASS}`}>
132+
Project memory
133+
</span>
134+
</ThreadDetailsControl>
126135
);
127136
}
128137

129138
export function ProjectMemoryDialogHost(props: Scope) {
130139
const available = useProjectMemoryAvailable(props.environmentId);
131140
const [request, setRequest] = useAtom(openRequestAtom);
141+
// oxlint-disable-next-line t3code/no-unreasoned-state-sync -- releases the shared open request this host holds until unmount
132142
useEffect(() => () => setRequest(null), [setRequest]);
133143
const active =
134144
available &&
@@ -226,6 +236,7 @@ function MemoryContents(
226236
} | null>(null);
227237
const rootRef = useRef<HTMLDivElement>(null);
228238
const selectionVersion = useRef(0);
239+
// oxlint-disable-next-line t3code/no-unreasoned-state-sync -- invalidates in-flight selection work when the dialog unmounts
229240
useEffect(
230241
() => () => {
231242
selectionVersion.current += 1;

0 commit comments

Comments
 (0)