A notebook opens in its own order

The hand-made order is where a notebook's own arrangement lives:
separators show, rows can be put where they belong, nothing slides about
by itself. Starting in "last changed" made both of those look broken
until the sort menu was found — pressing "+ Separator" there drew a line
the order cannot display, so the button appeared dead. A notebook nobody
has arranged still reads newest-first, because untouched rows all carry
position 0, so nothing is lost by starting there. The views keep "last
changed": they are questions asked of every notebook at once and have
nowhere to keep an arrangement. The button that draws a line is now only
offered in the order that can show one.

Removing a chapter left you stuck in the confirmation. Every destructive
action goes through one helper that takes the question down again; this
one set the dialog directly and bypassed it, so the chapter was removed
and the prompt stayed over the app. Closing now happens where the dialog
is rendered, so it happens whoever asked and however they asked.

The suites did not catch that, and the reason is worth keeping: they
read the list straight through the overlay, which is in the DOM the
whole time, and passed while the screen was in fact stuck. Both now
assert the question is gone afterwards.

The separator is no wider than its name. It sat in a fixed 132px slot —
chosen so the row would not jump when renaming began — with a short name
floating in a gap it did not fill.

Thirteen suites green: 345 browser checks, 241 unit tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
marcandClaude Opus 5 committed 2026-08-12 21:45:03 +02:00
1 parent cc0b58dd2f
commit c96885d5b3
9 files changed
+223 -69

No files matched your search

+28
View File
@@ -64,6 +64,23 @@ try {
check((await titles()).length === 3, "three notes to arrange", (await titles()).join(", "));
/* ── what a notebook is in before anyone chooses ──
* Its own order. That is where a notebook's arrangement lives: lines show,
* rows can be put where they belong, nothing slides about by itself. It used
* to open in "last changed", so both of those looked broken until the sort
* menu was found — a notebook nobody had arranged still reads newest-first,
* because untouched rows all share position 0. */
check(
(await p.locator("[data-sort-button]").getAttribute("data-sort-button")) === "manual",
"a notebook is in its own order to begin with",
await p.locator("[data-sort-button]").getAttribute("data-sort-button")
);
check(
(await p.locator("[data-add-separator]").count()) === 1,
"so a line can be drawn in it straight away"
);
check((await titles())[0] === "Gamma", "and it reads newest first until something is moved", (await titles()).join(", "));
/* ── the built-in orders ── */
await sortBy("updated");
check((await titles())[0] === "Gamma", "newest first by default", (await titles()).join(", "));
@@ -237,6 +254,13 @@ try {
// notes would slide past the line on every edit.
await sortBy("updated");
check((await p.locator("[data-separator]").count()) === 0, "it is hidden in the other orders");
/* And the button that draws one goes with it. Standing in an order that
cannot show a line, pressing it produced nothing at all — which reads
exactly like a button that is broken. */
check(
(await p.locator("[data-add-separator]").count()) === 0,
"and so is the button that draws one, which could only do nothing there"
);
await sortBy("manual");
await p.waitForTimeout(800);
check((await p.locator("[data-separator]").count()) === 1, "and back on the way in");
@@ -261,6 +285,10 @@ try {
await p.getByRole("button", { name: "Remove" }).click();
await p.waitForTimeout(2000);
check((await p.locator("[data-separator]").count()) === 0, "and then it is gone");
check(
(await p.locator("[data-confirm-dialog]").count()) === 0,
"and the question is gone with it, not left standing over the app"
);
check((await titles()).length === 3, "with every note still there", (await titles()).join(", "));
/* ── exporting a note and importing it back ── */