fix(webui): align mention overlay spacing with the native caret

This commit is contained in:
chengyongru authored and chengyongru committed 2026-10-18 00:25:47 +08:00
1 parent 61666c495a
commit 1a4cee5815
2 files changed
+17 -1

No files matched your search

+15
View File
@@ -2484,6 +2484,21 @@ describe("ThreadComposer", () => {
expect(input).toHaveValue("use @Blender tonight");
});
it("keeps literal mixed-script spacing in both composer input layers", () => {
render(<ThreadComposer onSend={vi.fn()} cliApps={CLI_APPS} />);
const input = screen.getByLabelText("Message input");
const value = "定位原因, 提 @gimp issue, i并提";
fireEvent.change(input, { target: { value, selectionStart: value.length } });
const display = "定位原因, 提 @\u00a0GIMP issue, i并提";
const overlay = input.previousElementSibling;
expect(input).toHaveValue(display);
expect(overlay).toHaveAttribute("aria-hidden", "true");
expect(overlay?.textContent).toBe(display);
expect(input).toHaveClass("[text-autospace:no-autospace]");
expect(overlay).toHaveClass("[text-autospace:no-autospace]");
});
it("renders a CLI app mention logo inline without moving the text cursor slot", () => {
render(
<ThreadComposer