mirror of
https://github.com/murashit/codex-panel.git
synced 2026-07-22 06:57:10 +00:00
Clarify archive actions settings copy
This commit is contained in:
parent
886e47ac12
commit
82bfb0ce0b
2 changed files with 14 additions and 11 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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<HTMLInputElement>('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<HTMLSelectElement>('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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue