From 324cd328b3b1ce88cf9d8948148b313b191eff6c Mon Sep 17 00:00:00 2001 From: Clawdbot Date: Wed, 28 Jan 2026 21:10:50 +0100 Subject: [PATCH] fix: use --card background for delete modal card (prevent transparency) --- .idea/workspace.xml | 62 ++++++++++++++++++++++++++ patches/chat-delete-session.patch | 2 +- src/sessions/session-key-utils.test.ts | 38 ++++++++++++++++ ui/src/styles/components.css | 2 +- 4 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 .idea/workspace.xml create mode 100644 src/sessions/session-key-utils.test.ts diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 000000000..b4d6cdedc --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 1769612472859 + + + + + + \ No newline at end of file diff --git a/patches/chat-delete-session.patch b/patches/chat-delete-session.patch index bb49fc47e..7defd6ae1 100644 --- a/patches/chat-delete-session.patch +++ b/patches/chat-delete-session.patch @@ -43,7 +43,7 @@ index 27dfe62d1..9eb7f2150 100644 +} + +.chat-delete-card { -+ background: var(--surface); ++ background: var(--card); + border: 1px solid var(--border); + border-radius: 8px; + padding: 20px 24px; diff --git a/src/sessions/session-key-utils.test.ts b/src/sessions/session-key-utils.test.ts new file mode 100644 index 000000000..145a619c5 --- /dev/null +++ b/src/sessions/session-key-utils.test.ts @@ -0,0 +1,38 @@ +import { describe, expect, it } from "vitest"; +import { extractThreadIdFromSessionKey } from "./session-key-utils.js"; + +describe("extractThreadIdFromSessionKey", () => { + it("extracts topic ID from Telegram session key", () => { + expect(extractThreadIdFromSessionKey("agent:main:telegram:group:123:topic:7")).toBe("7"); + }); + + it("extracts thread ID from session key", () => { + expect(extractThreadIdFromSessionKey("agent:main:discord:channel:123:thread:456")).toBe("456"); + }); + + it("returns null for non-topic session keys", () => { + expect(extractThreadIdFromSessionKey("agent:main:telegram:group:123")).toBeNull(); + }); + + it("handles empty input", () => { + expect(extractThreadIdFromSessionKey(null)).toBeNull(); + expect(extractThreadIdFromSessionKey(undefined)).toBeNull(); + expect(extractThreadIdFromSessionKey("")).toBeNull(); + }); + + it("handles session key without agent prefix", () => { + expect(extractThreadIdFromSessionKey("telegram:group:123:topic:7")).toBe("7"); + }); + + it("extracts last thread/topic marker if multiple present", () => { + expect(extractThreadIdFromSessionKey("agent:main:telegram:topic:1:thread:99")).toBe("99"); + }); + + it("handles whitespace around thread ID", () => { + expect(extractThreadIdFromSessionKey("agent:main:telegram:group:123:topic: 42 ")).toBe("42"); + }); + + it("returns null when thread marker is at the end without ID", () => { + expect(extractThreadIdFromSessionKey("agent:main:telegram:group:123:topic:")).toBeNull(); + }); +}); diff --git a/ui/src/styles/components.css b/ui/src/styles/components.css index 3159aa5e9..fb2205001 100644 --- a/ui/src/styles/components.css +++ b/ui/src/styles/components.css @@ -1514,7 +1514,7 @@ } .chat-delete-card { - background: var(--surface); + background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 20px 24px;