From 82bfb0ce0bcd04cdd432c66ecdbe85b9155c3205 Mon Sep 17 00:00:00 2001 From: murashit Date: Mon, 18 May 2026 17:24:46 +0900 Subject: [PATCH] Clarify archive actions settings copy --- src/settings/dynamic-sections.ts | 14 ++++++++------ tests/settings/settings-tab.test.ts | 11 ++++++----- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/settings/dynamic-sections.ts b/src/settings/dynamic-sections.ts index 656bd9dc..be45e014 100644 --- a/src/settings/dynamic-sections.ts +++ b/src/settings/dynamic-sections.ts @@ -54,8 +54,8 @@ export function renderArchivedThreadSection(containerEl: HTMLElement, state: Arc new Setting(section) .setClass("codex-panel-settings__dynamic-section-heading") .setHeading() - .setName("Thread archive") - .setDesc("Save markdown copies when archiving threads, and restore archived threads when needed."); + .setName("Archive actions") + .setDesc("Configure what happens when a thread is archived, and restore already archived threads when needed."); renderArchiveExportSettings(section, state); @@ -81,7 +81,7 @@ export function renderArchivedThreadSection(containerEl: HTMLElement, state: Arc function renderArchiveExportSettings(containerEl: HTMLElement, state: ArchivedThreadSectionState): void { new Setting(containerEl) - .setName("Archive export") + .setName("Save before archiving") .setDesc( "Save a markdown note before archiving. If saving fails, the thread is not archived. Frontmatter is fixed to title, thread_id, and created.", ) @@ -90,7 +90,7 @@ function renderArchiveExportSettings(containerEl: HTMLElement, state: ArchivedTh }); new Setting(containerEl) - .setName("Archive export folder") + .setName("Save folder") .setDesc("Vault-relative folder path. The folder is created when needed.") .addText((text) => { text @@ -100,7 +100,7 @@ function renderArchiveExportSettings(containerEl: HTMLElement, state: ArchivedTh }); new Setting(containerEl) - .setName("Archive export filename") + .setName("Save filename") .setDesc( "Markdown filename template. Available variables: {{date}}, {{time}}, {{title}}, {{id}}, {{shortId}}. Existing files get a numeric suffix.", ) @@ -115,7 +115,9 @@ function renderArchiveExportSettings(containerEl: HTMLElement, state: ArchivedTh function renderArchivedThreadList(containerEl: HTMLElement, state: ArchivedThreadSectionState): void { containerEl.createEl("p", { cls: "setting-item-description codex-panel-settings__dynamic-list-summary", - text: `Loaded ${state.threads.length} archived thread${state.threads.length === 1 ? "" : "s"} from Codex app-server.`, + text: `Archived threads below can be restored to chat history. Loaded ${state.threads.length} archived thread${ + state.threads.length === 1 ? "" : "s" + } from Codex app-server.`, }); const list = containerEl.createDiv({ cls: "setting-items codex-panel-settings__dynamic-list codex-panel-settings__archived-list" }); for (const thread of state.threads) { diff --git a/tests/settings/settings-tab.test.ts b/tests/settings/settings-tab.test.ts index 3c1583a6..96a774aa 100644 --- a/tests/settings/settings-tab.test.ts +++ b/tests/settings/settings-tab.test.ts @@ -97,7 +97,7 @@ describe("settings tab", () => { "Automatic thread naming", "Selection rewrite", "Hook status", - "Thread archive", + "Archive actions", ]); }); @@ -124,8 +124,8 @@ describe("settings tab", () => { tab.display(); const toggle = tab.containerEl.querySelector('input[type="checkbox"]'); - const folder = inputForSetting(tab, "Archive export folder"); - const filename = inputForSetting(tab, "Archive export filename"); + const folder = inputForSetting(tab, "Save folder"); + const filename = inputForSetting(tab, "Save filename"); if (!toggle || !folder || !filename) throw new Error("Missing archive export controls"); toggle.checked = true; @@ -138,7 +138,7 @@ describe("settings tab", () => { expect(saveSettings).toHaveBeenCalledTimes(3); expect(tab.containerEl.textContent).toContain("title, thread_id, and created"); - expect(tab.containerEl.querySelector('select[aria-label="Choose archive export folder"]')).toBeNull(); + expect(settingDesc(tab, "Save before archiving")).toContain("If saving fails"); }); it("refreshes models, hooks, and archived threads from the global refresh button", async () => { @@ -201,12 +201,13 @@ describe("settings tab", () => { await flushPromises(); expect(tab.containerEl.textContent).toContain("Loaded 1 hook from Codex app-server."); + expect(tab.containerEl.textContent).toContain("Archived threads below can be restored to chat history."); expect(tab.containerEl.textContent).toContain("Loaded 1 archived thread from Codex app-server."); expect(tab.containerEl.querySelector(".codex-panel-settings__hook-section .setting-item-heading")?.textContent).toContain( "Hook status", ); expect(tab.containerEl.querySelector(".codex-panel-settings__archived-section .setting-item-heading")?.textContent).toContain( - "Thread archive", + "Archive actions", ); expect(tab.containerEl.querySelectorAll(".codex-panel-settings__hook-list .setting-item")).toHaveLength(1); expect(tab.containerEl.querySelectorAll(".codex-panel-settings__archived-list .setting-item")).toHaveLength(1);