Skip to content
Python

fix(memhub): simplify memory note copy

kristinhe47bbfb4b27bf
diff --git a/memhub/apps/web/src/MemoryNoteComposer.test.tsx b/memhub/apps/web/src/MemoryNoteComposer.test.tsx
index 7d9ec98..d1fe94d 100644
--- a/memhub/apps/web/src/MemoryNoteComposer.test.tsx
+++ b/memhub/apps/web/src/MemoryNoteComposer.test.tsx
@@ -26,7 +26,7 @@ it("opens a Spanish composer without saving, processing or enabling anything", a
screen.getByRole("textbox", { name: "¿Qué quieres recordar?" }),
).toBeTruthy();
expect(
- (screen.getByRole("button", { name: "Guardar texto" }) as HTMLButtonElement)
+ (screen.getByRole("button", { name: "Guardar" }) as HTMLButtonElement)
.disabled,
).toBe(true);
await userEvent.click(
@@ -165,12 +165,12 @@ it("saves from an empty library with the linked-app scope by default", async ()
expect(document.activeElement).toBe(input);
await userEvent.type(input, note.text);
expect(
- screen.getByRole("button", { name: "保存原话" }).hasAttribute("disabled"),
+ screen.getByRole("button", { name: "保存" }).hasAttribute("disabled"),
).toBe(false);
expect(
screen.queryByRole("checkbox", { name: /允许已关联应用读取/ }),
).toBeNull();
- await userEvent.click(screen.getByRole("button", { name: "保存原话" }));
+ await userEvent.click(screen.getByRole("button", { name: "保存" }));
await waitFor(() =>
expect(api.saveMemoryNote).toHaveBeenCalledWith(
{
@@ -208,7 +208,7 @@ it("preserves draft and request identity after an uncertain save", async () => {
page();
await userEvent.click(screen.getByRole("button", { name: "添加记忆" }));
await userEvent.type(screen.getByRole("textbox"), note.text);
- await userEvent.click(screen.getByRole("button", { name: "保存原话" }));
+ await userEvent.click(screen.getByRole("button", { name: "保存" }));
expect(await screen.findByRole("alert")).toBeTruthy();
expect((screen.getByRole("textbox") as HTMLTextAreaElement).value).toBe(
note.text,
@@ -219,7 +219,7 @@ it("preserves draft and request identity after an uncertain save", async () => {
expect(result?.status).toBe("unknown");
expect(result?.reason).toBe("save_result_unconfirmed");
expect(result?.status).not.toBe("failed");
- await userEvent.click(screen.getByRole("button", { name: "保存原话" }));
+ await userEvent.click(screen.getByRole("button", { name: "保存" }));
expect(api.saveMemoryNote.mock.calls[0][0].request_id).toBe(
api.saveMemoryNote.mock.calls[1][0].request_id,
);
@@ -235,7 +235,7 @@ it("closes as saved when the POST response is lost but the operation exists", as
const callbacks = page();
await userEvent.click(screen.getByRole("button", { name: "添加记忆" }));
await userEvent.type(screen.getByRole("textbox"), note.text);
- await userEvent.click(screen.getByRole("button", { name: "保存原话" }));
+ await userEvent.click(screen.getByRole("button", { name: "保存" }));
await waitFor(() =>
expect(api.getMemoryNoteOperation).toHaveBeenCalledOnce(),
);
@@ -292,7 +292,7 @@ it("does not ask for separate consent when an old note is waiting for permission
page();
await userEvent.click(screen.getByRole("button", { name: "添加记忆" }));
- expect(await screen.findByText("原话已保存,等待整理")).toBeTruthy();
+ expect(await screen.findByText("正在等待整理")).toBeTruthy();
expect(screen.queryByRole("button", { name: "模型授权" })).toBeNull();
await userEvent.click(screen.getByRole("button", { name: "重新整理" }));
expect(api.processMemoryNote).toHaveBeenCalledExactlyOnceWith(
diff --git a/memhub/apps/web/src/MemoryNoteComposer.tsx b/memhub/apps/web/src/MemoryNoteComposer.tsx
index 97f6758..a6a8268 100644
--- a/memhub/apps/web/src/MemoryNoteComposer.tsx
+++ b/memhub/apps/web/src/MemoryNoteComposer.tsx
@@ -16,8 +16,8 @@ import { isDefiniteRefusal } from "./write-outcome";
const states: Record<MemoryNoteReceipt["state"], string> = {
waiting_for_model: "原话已保存,等待可用模型",
- waiting_for_permission: "原话已保存,等待整理",
- pending: "原话已保存,等待整理",
+ waiting_for_permission: "正在等待整理",
+ pending: "正在等待整理",
running: "正在整理",
failed: "原话已保存,整理未完成",
ready: "整理已完成",
@@ -371,7 +371,7 @@ export function MemoryNoteComposer({
</button>
)}
<button type="submit" disabled={busy || !text.trim()}>
- {copy(busy ? "保存中…" : "保存原话")}
+ {copy(busy ? "保存中…" : "保存")}
</button>
</div>
</form>
diff --git a/memhub/packages/i18n/src/gui-i18n-english.ts b/memhub/packages/i18n/src/gui-i18n-english.ts
index 0ab9a4a..df1615c 100644
--- a/memhub/packages/i18n/src/gui-i18n-english.ts
+++ b/memhub/packages/i18n/src/gui-i18n-english.ts
@@ -1722,6 +1722,7 @@ const baseEnglishMessages = {
"memory:原话已保存,等待可用模型":
"Original saved; waiting for an available model",
"memory:原话已保存,等待整理": "Original saved; waiting for processing",
+ "memory:正在等待整理": "Awaiting processing",
"memory:正在整理": "Processing",
"memory:原话已保存,整理未完成": "Original saved; processing incomplete",
"memory:整理已完成": "Processing complete",
diff --git a/memhub/packages/i18n/src/gui-i18n-memory.ts b/memhub/packages/i18n/src/gui-i18n-memory.ts
index 5731099..0d7225e 100644
--- a/memhub/packages/i18n/src/gui-i18n-memory.ts
+++ b/memhub/packages/i18n/src/gui-i18n-memory.ts
@@ -288,6 +288,7 @@ export const memoryChineseMessages = {
"memory:重新整理": "重新整理",
"memory:原话已保存,等待可用模型": "原话已保存,等待可用模型",
"memory:原话已保存,等待整理": "原话已保存,等待整理",
+ "memory:正在等待整理": "正在等待整理",
"memory:正在整理": "正在整理",
"memory:原话已保存,整理未完成": "原话已保存,整理未完成",
"memory:整理已完成": "整理已完成",
@@ -696,6 +697,7 @@ export const memorySpanishMessages: Record<
"memory:重新整理": "Volver a procesar",
"memory:原话已保存,等待可用模型": "Texto guardado; esperando un modelo",
"memory:原话已保存,等待整理": "Texto guardado; pendiente de procesar",
+ "memory:正在等待整理": "Pendiente de procesar",
"memory:正在整理": "Procesando",
"memory:原话已保存,整理未完成": "Texto guardado; procesamiento incompleto",
"memory:整理已完成": "Procesamiento completado",