The best way to control Claude Code, Codex and more from any computer or phone
fix(web): Tab from a citation comment reaches Save, not Cancel (#37579)
Julius Marminge committed
Nov 16, 2026 at 01:08 UTC
dfeaf7b13786712cc350fa35abea17715fdef987
2 files changed
+15
apps/web/src/components/chat/AssistantCitationChip.browser.test.tsx
+13
@@ -149,6 +149,19 @@ describe("citation comment caret", () => {
149
await userEvent.keyboard("!");
150
expect(input.value).toBe(`${comment}!`);
151
});
152
+
153
+ it("saves with Tab then Enter after typing a comment", async () => {
154
+ using _source = setup();
155
+ const onSave = vi.fn(() => true);
156
+ await using _screen = await mount(undefined, onSave);
157
+ await vi.waitFor(() => expect(document.activeElement).toBe(textarea()));
158
+
159
+ await userEvent.keyboard("agreed");
160
+ await userEvent.keyboard("{Tab}");
161
+ await userEvent.keyboard("{Enter}");
162
+
163
+ expect(onSave).toHaveBeenCalledWith("agreed");
164
+ });
165
});
166
167
describe("citation comment popup position", () => {
apps/web/src/components/chat/AssistantCitationCommentEditor.tsx
+2
@@ -117,6 +117,8 @@ export function AssistantCitationCommentEditor({
117
<Button
118
variant="outline"
119
size="xs"
120
+ // Escape cancels; keep Tab from the comment on Save so Enter cannot discard a new citation.
121
+ tabIndex={-1}
122
onPointerDown={(event) => event.preventDefault()}
123
onClick={onCancel}
124
>