The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 08:15 UTC
fix(web): Backspace no longer re-nests a checkbox under a bullet (#27384)
Lee Keun Hwee committed
Nov 1, 2026 at 11:38 UTC
868524f259e5bc1d754e4a3970964d90ff4d69fc
2 files changed
+22
-2
apps/web/src/composer-list-split.browser.test.ts
+19
@@ -68,6 +68,25 @@ describe("Backspace at the start of a line", () => {
68
editor.commands.keyboardShortcut("Backspace");
69
expect(storedDraft(editor)).toBe(expected);
70
});
71
+
72
+ // Neither item has a list of its own kind one level up to lift into.
73
+ it.each([
74
+ ["- a\n - [ ] x\n - [ ] y", "- a\n - [ ] xy"],
75
+ ["- [ ] a\n - x\n - y", "- [ ] a\n - xy"],
76
+ ["- a\n - [ ] y\n - [ ] q", "- ay\n - [ ] q"],
77
+ ])("joins y in %j onto the line above", (value, expected) => {
78
+ using editor = makeEditor(value);
79
+ placeCaret(editor, "y");
80
+ editor.commands.keyboardShortcut("Backspace");
81
+ expect(storedDraft(editor)).toBe(expected);
82
+ });
83
+
84
+ it("removes an empty checkbox under a bullet", () => {
85
+ using editor = makeEditor("- a\n - [ ] x\n - [ ]");
86
+ editor.view.dispatch(editor.state.tr.setSelection(TextSelection.atEnd(editor.state.doc)));
87
+ editor.commands.keyboardShortcut("Backspace");
88
+ expect(storedDraft(editor)).toBe("- a\n - [ ] x");
89
+ });
90
});
91
92
describe("blocks that a list item or quote cannot hold", () => {
apps/web/src/composer-rich-text-doc.ts
+3
-2
@@ -1,4 +1,4 @@
1
-import { joinBackward, joinTextblockBackward, joinTextblockForward } from "@tiptap/pm/commands";
1
+import { joinTextblockBackward, joinTextblockForward } from "@tiptap/pm/commands";
2
import {
3
Fragment,
4
Mark,
@@ -1203,7 +1203,8 @@ function backspaceAcrossList(editor: Editor): boolean {
1203
return moved;
1204
};
1205
// can() skips the schema check and can accept tasks with no parent list to lift into.
1206
- return editor.chain().command(lift).run() || joinBackward(state, editor.view.dispatch);
1206
+ // Those join the line above; joinBackward would re-nest them or select the parent line.
1207
+ return editor.chain().command(lift).run() || joinTextblockBackward(state, editor.view.dispatch);
1208
}
1209
const before = $from.depth === 1 ? $from.node(0).maybeChild($from.index(0) - 1) : null;
1210
if (before && LIST_NODE_NAMES.has(before.type.name) && $from.parent.type.name !== "codeBlock") {