The best way to control Claude Code, Codex and more from any computer or phone
fix(web): Enter on a bare "2." in the composer adds a line instead of deleting it (#18786)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
Batuhan1999 committed
Oct 20, 2026 at 06:11 UTC
bac96aa3b244b95629addadb7d434b194aa53576
2 files changed
+10
-1
apps/web/src/composer-list-continuation.test.ts
+9
@@ -43,6 +43,15 @@ describe("composer list continuation", () => {
43
it("exits the list on an empty item", () => {
44
expect(applyEdit("1. foo\n2. ", listContinuationForEnter("1. foo\n2. ", 10)!)).toBe("1. foo\n");
45
expect(applyEdit("- ", listContinuationForEnter("- ", 2)!)).toBe("");
46
+ expect(applyEdit("1)\t", listContinuationForEnter("1)\t", 3)!)).toBe("");
47
+ expect(applyEdit("- [ ] ", listContinuationForEnter("- [ ] ", 6)!)).toBe("");
48
+ });
49
+
50
+ it("keeps a marker typed without a trailing space", () => {
51
+ expect(listContinuationForEnter("asd\n2.", 6)).toBeNull();
52
+ expect(listContinuationForEnter("1)", 2)).toBeNull();
53
+ expect(listContinuationForEnter("-", 1)).toBeNull();
54
+ expect(listContinuationForEnter("- [ ]", 5)).toBeNull();
55
});
56
57
it("ignores non-list lines and carets inside the marker", () => {
apps/web/src/composer-list-continuation.ts
+1
-1
@@ -153,7 +153,7 @@ export function listContinuationForEnter(value: string, cursor: number): Compose
153
if (!Number.isInteger(cursor) || cursor < 0 || cursor > value.length) return null;
154
const line = currentLine(value, cursor);
155
const parsed = parseListMarker(line.text);
156
- if (!parsed) return null;
156
+ if (!parsed || parsed.marker.space === "") return null;
157
const markerEnd = line.start + parsed.markerEnd;
158
if (cursor < markerEnd) return null;
159
const tokens = inlineTokenRanges(value);