fix(ui): keep theme text and selections readable (#6226)

* fix(ui): keep theme text and selections readable

* fix(tui): theme the blank composer cursor cell

* refactor(webui): centralize diff theme colors

* fix(tui): keep conversation selections readable

* fix(ui): preserve nested syntax colors and selection lifetimes
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-15 15:21:28 +08:00
1 parent 73c2441abc
commit c24153db86
32 files changed
+451 -165

No files matched your search

+2 -10
View File
@@ -48,14 +48,6 @@ vi.mock("react-syntax-highlighter/dist/esm/create-element", () => ({
),
}));
vi.mock("react-syntax-highlighter/dist/esm/styles/prism/one-dark", () => ({
default: { dark: { color: "#fff" } },
}));
vi.mock("react-syntax-highlighter/dist/esm/styles/prism/one-light", () => ({
default: { light: { color: "#111" } },
}));
describe("DiffSyntaxHighlight", () => {
it("highlights a complete hunk while preserving diff rows and line numbers", async () => {
render(
@@ -81,10 +73,10 @@ describe("DiffSyntaxHighlight", () => {
expect(highlighted).toHaveAttribute("data-language", "typescript");
expect(screen.getAllByTestId("syntax-token")).toHaveLength(3);
expect(screen.getByText("return oldValue;", { exact: false }).closest("tr")).toHaveClass(
"bg-rose-500/[0.09]",
"bg-diff-deleted",
);
expect(screen.getByText("return newValue;", { exact: false }).closest("tr")).toHaveClass(
"bg-emerald-500/[0.09]",
"bg-diff-added",
);
expect(screen.getAllByText("5")).toHaveLength(2);
expect(screen.getAllByTestId("syntax-token").some((node) => node.textContent?.endsWith("\n"))).toBe(false);