From 08aad21265db5cec3d3a2d4d185c06a652d4de14 Mon Sep 17 00:00:00 2001 From: murashit Date: Sat, 20 Jun 2026 12:03:57 +0900 Subject: [PATCH] Polish settings dynamic row labels --- src/settings/archived-section.tsx | 4 ++-- src/settings/hook-section.tsx | 1 - src/settings/setting-components.tsx | 3 --- src/styles/60-settings.css | 10 ---------- tests/settings/settings-tab.test.ts | 20 ++++++++++---------- 5 files changed, 12 insertions(+), 26 deletions(-) diff --git a/src/settings/archived-section.tsx b/src/settings/archived-section.tsx index caaf7d74..32a7e7b6 100644 --- a/src/settings/archived-section.tsx +++ b/src/settings/archived-section.tsx @@ -120,7 +120,7 @@ function ArchivedThreadRow({ thread, state }: { thread: Thread; state: ArchivedT {!deleteConfirming ? ( { state.onRestore(thread.id); @@ -129,7 +129,7 @@ function ArchivedThreadRow({ thread, state }: { thread: Thread; state: ArchivedT ) : null} { if (deleteConfirming) { diff --git a/src/settings/hook-section.tsx b/src/settings/hook-section.tsx index 36251a0d..a93a2ea3 100644 --- a/src/settings/hook-section.tsx +++ b/src/settings/hook-section.tsx @@ -50,7 +50,6 @@ function HookRow({ hook, state }: { hook: HookItem; state: HookSectionState }): className="codex-panel-settings__dynamic-row codex-panel-settings__hook-row" name={hookName} desc={`${hook.eventName} · ${hook.matcher ?? "(no matcher)"} · ${hook.trustStatus} · ${hook.enabled ? "enabled" : "disabled"}`} - extraInfo={
{hook.currentHash}
} >
{name}
{desc}
- {extraInfo}
{children}
diff --git a/src/styles/60-settings.css b/src/styles/60-settings.css index 2314bab6..126f1255 100644 --- a/src/styles/60-settings.css +++ b/src/styles/60-settings.css @@ -59,16 +59,6 @@ white-space: nowrap; } -.codex-panel-settings__hook-hash { - overflow: hidden; - padding-top: var(--size-2-1); - color: var(--text-faint); - font-family: var(--font-monospace); - font-size: var(--font-ui-smaller); - text-overflow: ellipsis; - white-space: nowrap; -} - .codex-panel-settings__hook-warning { color: var(--codex-panel-color-warning); } diff --git a/tests/settings/settings-tab.test.ts b/tests/settings/settings-tab.test.ts index e8b72db9..052ae41e 100644 --- a/tests/settings/settings-tab.test.ts +++ b/tests/settings/settings-tab.test.ts @@ -647,8 +647,10 @@ describe("settings tab", () => { ); expect(tab.containerEl.querySelectorAll(".codex-panel-settings__hook-list .codex-panel-settings__hook-row")).toHaveLength(1); expect(tab.containerEl.querySelectorAll(".codex-panel-settings__archived-list .codex-panel-settings__archived-row")).toHaveLength(1); - expect(tab.containerEl.querySelector(".codex-panel-settings__hook-list")?.textContent).toContain("abc123"); + expect(tab.containerEl.querySelector(".codex-panel-settings__hook-list")?.textContent).not.toContain("abc123"); expect(tab.containerEl.querySelector(".codex-panel-settings__archived-list")?.textContent).toContain("Archived thread"); + expect(buttonLabels(tab)).toContain("Restore thread"); + expect(buttonLabels(tab)).toContain("Delete thread"); }); it("confirms archived thread deletion inline and cancels from outside clicks", async () => { @@ -663,13 +665,11 @@ describe("settings tab", () => { tab.display(); await flushPromises(); - clickButtonByLabel(tab, "Delete Archived thread"); + clickButtonByLabel(tab, "Delete thread"); expect(tab.containerEl.querySelector(".codex-panel-settings__archived-row--delete-confirming")).not.toBeNull(); expect(tab.containerEl.textContent).toContain("Permanently delete this archived thread? This cannot be undone."); - expect(tab.containerEl.querySelector("[aria-label='Confirm permanent delete Archived thread']")?.getAttribute("data-icon")).toBe( - "check", - ); + expect(tab.containerEl.querySelector("[aria-label='Delete thread']")?.getAttribute("data-icon")).toBe("check"); tab.containerEl.dispatchEvent(new MouseEvent("pointerdown", { bubbles: true })); @@ -704,7 +704,7 @@ describe("settings tab", () => { expect(inputForSetting(tab, "Codex executable")).toBe(codexInput); expect(selectForSetting(tab, "Send shortcut")).toBe(shortcut); - clickButtonByLabel(tab, "Delete Archived thread"); + clickButtonByLabel(tab, "Delete thread"); expect(inputForSetting(tab, "Codex executable")).toBe(codexInput); expect(selectForSetting(tab, "Send shortcut")).toBe(shortcut); @@ -739,7 +739,7 @@ describe("settings tab", () => { expect(dynamicSection(tab, "codex-panel-settings__helper-section")).toBe(helperSection); expect(dynamicSection(tab, "codex-panel-settings__hook-section")).toBe(hookSection); - clickButtonByLabel(tab, "Delete Archived thread"); + clickButtonByLabel(tab, "Delete thread"); expect(dynamicSection(tab, "codex-panel-settings__helper-section")).toBe(helperSection); expect(dynamicSection(tab, "codex-panel-settings__hook-section")).toBe(hookSection); @@ -771,9 +771,9 @@ describe("settings tab", () => { tab.display(); await flushPromises(); - clickButtonByLabel(tab, "Delete Archived thread"); - pointerDownButtonByLabel(tab, "Confirm permanent delete Archived thread"); - clickButtonByLabel(tab, "Confirm permanent delete Archived thread"); + clickButtonByLabel(tab, "Delete thread"); + pointerDownButtonByLabel(tab, "Delete thread"); + clickButtonByLabel(tab, "Delete thread"); await flushPromises(); expect(client.deleteThread).toHaveBeenCalledWith("thread-archived");