Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix(site/src/pages/AgentsPage): keep memory add action in the header …
…as a subtle icon
  • Loading branch information
f0ssel committed Sep 11, 2026
commit ccdbdf9cb544541ac38e439a95117ab097a37372
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ describe("ProjectMemorySection", () => {
</Wrapper>,
);

await user.click(
await screen.findByRole("button", { name: "Add memory manually" }),
);
await user.click(await screen.findByRole("button", { name: "Add memory" }));
await user.type(screen.getByLabelText("Name"), "durable-fact");
await user.type(screen.getByLabelText("Description"), "A durable fact");
await user.type(screen.getByLabelText("Body"), "Project memory body");
Expand Down
35 changes: 21 additions & 14 deletions site/src/pages/AgentsPage/components/ProjectMemorySection.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cn } from "cn";
import { ChevronRightIcon } from "lucide-react";
import { ChevronRightIcon, PlusIcon } from "lucide-react";
import { type FC, useState } from "react";
import { useMutation, useQuery, useQueryClient } from "react-query";
import {
Expand Down Expand Up @@ -53,11 +53,26 @@ export const ProjectMemorySection: FC<ProjectMemorySectionProps> = ({

return (
<section className="mt-10 border-t border-border-default pt-8">
<h2 className="m-0 text-lg font-semibold text-content-primary">Memory</h2>
<p className="mb-0 mt-1 text-sm text-content-secondary">
Facts the agent saved while working in this project. Every chat in the
project can read them.
</p>
<div className="flex items-start justify-between gap-4">
<div>
<h2 className="m-0 text-lg font-semibold text-content-primary">
Memory
</h2>
<p className="mb-0 mt-1 text-sm text-content-secondary">
Facts the agent saved while working in this project. Every chat in
the project can read them.
</p>
</div>
<Button
variant="subtle"
size="icon"
aria-label="Add memory"
className="text-content-secondary"
onClick={() => setEditingMemory(null)}
>
<PlusIcon />
</Button>
</div>
{memories.length === 0 ? (
<p className="mt-6 text-sm text-content-secondary">
No memories yet. The agent saves them as it learns durable facts about
Expand Down Expand Up @@ -129,14 +144,6 @@ export const ProjectMemorySection: FC<ProjectMemorySectionProps> = ({
})}
</ul>
)}
<Button
variant="subtle"
size="sm"
className="mt-3 text-content-secondary"
onClick={() => setEditingMemory(null)}
>
Add memory manually
</Button>
<ChatProjectMemoryDialog
open={editingMemory !== undefined}
memory={editingMemory}
Expand Down