Trash search: a result opens read-only with Restore (Q2) #692

Closed
opened 2026-10-26 19:28:33 +00:00 by kayg · 6 comments
Owner

Decision by kayg, 26 Oct:

When you search inside the Trash and tap a result, the item must NOT be restored automatically (today it restores at once, with Undo). It must open the item read-only with a Restore button, exactly like tapping a row in the Trash list already does.

Keyboard Enter must behave the same. Restore remains an explicit action.

Decision by kayg, 26 Oct: > When you search inside the Trash and tap a result, the item must NOT be restored automatically (today it restores at once, with Undo). It must open the item read-only with a Restore button, exactly like tapping a row in the Trash list already does. Keyboard Enter must behave the same. Restore remains an explicit action.
Author
Owner

Starting on branch issue/trash-search-open from origin/dev, base SHA a779a46f4299ade3a222aab7448d11db84b6c0d2. I will share the Trash row open path with search results and verify pointer and Enter behavior against server state.

Starting on branch `issue/trash-search-open` from `origin/dev`, base SHA `a779a46f4299ade3a222aab7448d11db84b6c0d2`. I will share the Trash row open path with search results and verify pointer and Enter behavior against server state.
Author
Owner

Finding: apps/web/src/components/ListSearch.svelte:57 calls restoreNote(t.id, t.title) when a Trash result opens. Pointer and Enter both invoke that result callback, so both restore immediately.

Base a779a46f also differs from the decision's description: TrashList.svelte renders a non-interactive title and explicit Restore/Delete buttons. There is no row-open preview path to reuse. Safest choice: add one shared openTrashed function for row titles and search results, using the existing read-only notes.link-states text response. Restore remains a separate button action. This endpoint supplies the first 16 KiB, so the view is labelled Note preview rather than promising the whole note. No server change is needed.

There are no existing Trash search tests asserting auto-restore. I will add pointer and Enter coverage, check actual notes.trash membership and notes.get, and check the shared row path.

Finding: `apps/web/src/components/ListSearch.svelte:57` calls `restoreNote(t.id, t.title)` when a Trash result opens. Pointer and Enter both invoke that result callback, so both restore immediately. Base `a779a46f` also differs from the decision's description: `TrashList.svelte` renders a non-interactive title and explicit Restore/Delete buttons. There is no row-open preview path to reuse. Safest choice: add one shared `openTrashed` function for row titles and search results, using the existing read-only `notes.link-states` text response. Restore remains a separate button action. This endpoint supplies the first 16 KiB, so the view is labelled Note preview rather than promising the whole note. No server change is needed. There are no existing Trash search tests asserting auto-restore. I will add pointer and Enter coverage, check actual `notes.trash` membership and `notes.get`, and check the shared row path.
Author
Owner

Browser gate temporarily blocked by host setup: all launch attempts fail before test execution because Playwright 1.63.0 needs chromium_headless_shell-1243 and webkit-2359; this host only has revisions 1248 and 2370. Exact errors:

Error: browserType.launch: Executable doesn't exist at /home/agent/.cache/ms-playwright/chromium_headless_shell-1243/chrome-headless-shell-linux-arm64/chrome-headless-shell
Error: browserType.launch: Executable doesn't exist at /home/agent/.cache/ms-playwright/webkit-2359/pw_run.sh

Installing the pinned browser revisions and retrying. Product checks already passed: svelte-check found 0 errors and 14 warnings in 8 files; web unit tests: 6 passed, 0 failed. The test server built successfully through one build slot with cargo build -p calternal --locked -j3.

Browser gate temporarily blocked by host setup: all launch attempts fail before test execution because Playwright 1.63.0 needs `chromium_headless_shell-1243` and `webkit-2359`; this host only has revisions 1248 and 2370. Exact errors: ``` Error: browserType.launch: Executable doesn't exist at /home/agent/.cache/ms-playwright/chromium_headless_shell-1243/chrome-headless-shell-linux-arm64/chrome-headless-shell Error: browserType.launch: Executable doesn't exist at /home/agent/.cache/ms-playwright/webkit-2359/pw_run.sh ``` Installing the pinned browser revisions and retrying. Product checks already passed: `svelte-check found 0 errors and 14 warnings in 8 files`; web unit tests: 6 passed, 0 failed. The test server built successfully through one build slot with `cargo build -p calternal --locked -j3`.
Author
Owner

Finding confirmed by the browser regressions: touch and Enter open the read-only preview without any notes.restore request. The tests verify notes.trash still contains the id and notes.get still fails before Restore. They then close and reopen the row and press Restore, checking the opposite server state. All eight applicable new cases passed:

  ✓  17 [chromium-1440] › e2e/trash-search.spec.ts:12:3 › row opens a Trash note read-only; only Restore brings it back (557ms)
  ✓  35 [chromium-390] › e2e/trash-search.spec.ts:12:3 › tap opens a Trash note read-only; only Restore brings it back (488ms)
  ✓  36 [chromium-390] › e2e/trash-search.spec.ts:12:3 › Enter opens a Trash note read-only; only Restore brings it back (447ms)
  ✓  37 [chromium-390] › e2e/trash-search.spec.ts:12:3 › row opens a Trash note read-only; only Restore brings it back (408ms)
  ✓  57 [webkit-1440] › e2e/trash-search.spec.ts:12:3 › row opens a Trash note read-only; only Restore brings it back (2.8s)
  ✓  75 [webkit-390] › e2e/trash-search.spec.ts:12:3 › tap opens a Trash note read-only; only Restore brings it back (752ms)
  ✓  76 [webkit-390] › e2e/trash-search.spec.ts:12:3 › Enter opens a Trash note read-only; only Restore brings it back (651ms)
  ✓  77 [webkit-390] › e2e/trash-search.spec.ts:12:3 › row opens a Trash note read-only; only Restore brings it back (601ms)

Pinned browser revisions are now installed. The targeted list-search, trash-search and trash specs passed in Chromium and WebKit at 390 and 1440 widths, with one worker: 42 passed, 38 layout skips.

Finding confirmed by the browser regressions: touch and Enter open the read-only preview without any `notes.restore` request. The tests verify `notes.trash` still contains the id and `notes.get` still fails before Restore. They then close and reopen the row and press Restore, checking the opposite server state. All eight applicable new cases passed: ``` ✓ 17 [chromium-1440] › e2e/trash-search.spec.ts:12:3 › row opens a Trash note read-only; only Restore brings it back (557ms) ✓ 35 [chromium-390] › e2e/trash-search.spec.ts:12:3 › tap opens a Trash note read-only; only Restore brings it back (488ms) ✓ 36 [chromium-390] › e2e/trash-search.spec.ts:12:3 › Enter opens a Trash note read-only; only Restore brings it back (447ms) ✓ 37 [chromium-390] › e2e/trash-search.spec.ts:12:3 › row opens a Trash note read-only; only Restore brings it back (408ms) ✓ 57 [webkit-1440] › e2e/trash-search.spec.ts:12:3 › row opens a Trash note read-only; only Restore brings it back (2.8s) ✓ 75 [webkit-390] › e2e/trash-search.spec.ts:12:3 › tap opens a Trash note read-only; only Restore brings it back (752ms) ✓ 76 [webkit-390] › e2e/trash-search.spec.ts:12:3 › Enter opens a Trash note read-only; only Restore brings it back (651ms) ✓ 77 [webkit-390] › e2e/trash-search.spec.ts:12:3 › row opens a Trash note read-only; only Restore brings it back (601ms) ``` Pinned browser revisions are now installed. The targeted list-search, trash-search and trash specs passed in Chromium and WebKit at 390 and 1440 widths, with one worker: 42 passed, 38 layout skips.
Author
Owner

Finished. Head SHA: 8824bdedec217c3fb7f42ffd222d14e4e6552ff3. Branch: issue/trash-search-open. PR into dev: #694

All requested targeted gates passed. The issue remains open. No merge or deployment was performed. Gate output tails verbatim follow.

Server build:

   Compiling calternal v0.1.0 (/home/agent/wt/trash-search-q2/crates/calternal)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 30.68s

svelte-check:

Warn: Unused CSS selector ".toast"
https://svelte.dev/e/css_unused_selector (svelte)
  @media (prefers-reduced-motion: no-preference) {
    .toast {
      animation: toast-in 240ms var(--ease-out) backwards;

====================================
svelte-check found 0 errors and 14 warnings in 8 files

Web unit tests:

  ...
1..6
# tests 6
# suites 0
# pass 6
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 215.143241

Targeted Playwright:

(Use `node --trace-warnings ...` to show where the warning was created)
  -  61 [webkit-390] › e2e/list-search.spec.ts:19:1 › beside the list the Filter field stays and there is no pill
  ✓  62 [webkit-390] › e2e/list-search.spec.ts:27:1 › on a phone there is no Filter field under the title, in a list or the Trash (370ms)
  ✓  63 [webkit-390] › e2e/list-search.spec.ts:37:1 › tap the pill: the field is there with the list as a chip, focused, showing the whole list (899ms)
  ✓  64 [webkit-390] › e2e/list-search.spec.ts:61:1 › after opening and closing the search the list is live again (taps; swipes in swipe-rows) (916ms)
  ✓  65 [webkit-390] › e2e/list-search.spec.ts:83:1 › it searches only the list you are in; Backspace in an empty field widens it (1.1s)
  ✓  66 [webkit-390] › e2e/list-search.spec.ts:109:1 › notes with the words in the heading come before notes with them in the text; case does not matter (484ms)
  ✓  67 [webkit-390] › e2e/list-search.spec.ts:125:1 › the chip widens it and keeps the words (520ms)
  ✓  68 [webkit-390] › e2e/list-search.spec.ts:135:1 › a prefix, a middle-of-word match and a typo all find the note; a miss says so and clears (805ms)
  ✓  69 [webkit-390] › e2e/list-search.spec.ts:154:1 › enter opens the highlighted note, in the list you searched (573ms)
  ✓  70 [webkit-390] › e2e/list-search.spec.ts:169:1 › no empty frame while typing, and no false "Nothing matches" for a typo (892ms)
  ✓  71 [webkit-390] › e2e/list-search.spec.ts:214:5 › nothing is clipped at 320 wide, light (418ms)
  ✓  72 [webkit-390] › e2e/list-search.spec.ts:214:5 › nothing is clipped at 320 wide, dark (411ms)
  ✓  73 [webkit-390] › e2e/list-search.spec.ts:214:5 › nothing is clipped at 390 wide, light (383ms)
  ✓  74 [webkit-390] › e2e/list-search.spec.ts:214:5 › nothing is clipped at 390 wide, dark (436ms)
  ✓  75 [webkit-390] › e2e/trash-search.spec.ts:12:3 › tap opens a Trash note read-only; only Restore brings it back (752ms)
  ✓  76 [webkit-390] › e2e/trash-search.spec.ts:12:3 › Enter opens a Trash note read-only; only Restore brings it back (651ms)
  ✓  77 [webkit-390] › e2e/trash-search.spec.ts:12:3 › row opens a Trash note read-only; only Restore brings it back (601ms)
  -  78 [webkit-390] › e2e/trash.spec.ts:18:1 › Delete in Info moves the note to the Trash, and Undo brings it back
  -  79 [webkit-390] › e2e/trash.spec.ts:33:1 › a deleted note waits in the Trash; Restore puts it back, Delete forever asks first
  -  80 [webkit-390] › e2e/trash.spec.ts:74:1 › a link to a note in the Trash shows the Trash, and comes back when it is restored

  38 skipped
  42 passed (43.6s)
Finished. Head SHA: `8824bdedec217c3fb7f42ffd222d14e4e6552ff3`. Branch: `issue/trash-search-open`. PR into dev: https://git.kayg.org/kayg/calternal/pulls/694 All requested targeted gates passed. The issue remains open. No merge or deployment was performed. Gate output tails verbatim follow. Server build: ```text Compiling calternal v0.1.0 (/home/agent/wt/trash-search-q2/crates/calternal) Finished `dev` profile [unoptimized + debuginfo] target(s) in 30.68s ``` svelte-check: ```text Warn: Unused CSS selector ".toast" https://svelte.dev/e/css_unused_selector (svelte) @media (prefers-reduced-motion: no-preference) { .toast { animation: toast-in 240ms var(--ease-out) backwards; ==================================== svelte-check found 0 errors and 14 warnings in 8 files ``` Web unit tests: ```text ... 1..6 # tests 6 # suites 0 # pass 6 # fail 0 # cancelled 0 # skipped 0 # todo 0 # duration_ms 215.143241 ``` Targeted Playwright: ```text (Use `node --trace-warnings ...` to show where the warning was created) - 61 [webkit-390] › e2e/list-search.spec.ts:19:1 › beside the list the Filter field stays and there is no pill ✓ 62 [webkit-390] › e2e/list-search.spec.ts:27:1 › on a phone there is no Filter field under the title, in a list or the Trash (370ms) ✓ 63 [webkit-390] › e2e/list-search.spec.ts:37:1 › tap the pill: the field is there with the list as a chip, focused, showing the whole list (899ms) ✓ 64 [webkit-390] › e2e/list-search.spec.ts:61:1 › after opening and closing the search the list is live again (taps; swipes in swipe-rows) (916ms) ✓ 65 [webkit-390] › e2e/list-search.spec.ts:83:1 › it searches only the list you are in; Backspace in an empty field widens it (1.1s) ✓ 66 [webkit-390] › e2e/list-search.spec.ts:109:1 › notes with the words in the heading come before notes with them in the text; case does not matter (484ms) ✓ 67 [webkit-390] › e2e/list-search.spec.ts:125:1 › the chip widens it and keeps the words (520ms) ✓ 68 [webkit-390] › e2e/list-search.spec.ts:135:1 › a prefix, a middle-of-word match and a typo all find the note; a miss says so and clears (805ms) ✓ 69 [webkit-390] › e2e/list-search.spec.ts:154:1 › enter opens the highlighted note, in the list you searched (573ms) ✓ 70 [webkit-390] › e2e/list-search.spec.ts:169:1 › no empty frame while typing, and no false "Nothing matches" for a typo (892ms) ✓ 71 [webkit-390] › e2e/list-search.spec.ts:214:5 › nothing is clipped at 320 wide, light (418ms) ✓ 72 [webkit-390] › e2e/list-search.spec.ts:214:5 › nothing is clipped at 320 wide, dark (411ms) ✓ 73 [webkit-390] › e2e/list-search.spec.ts:214:5 › nothing is clipped at 390 wide, light (383ms) ✓ 74 [webkit-390] › e2e/list-search.spec.ts:214:5 › nothing is clipped at 390 wide, dark (436ms) ✓ 75 [webkit-390] › e2e/trash-search.spec.ts:12:3 › tap opens a Trash note read-only; only Restore brings it back (752ms) ✓ 76 [webkit-390] › e2e/trash-search.spec.ts:12:3 › Enter opens a Trash note read-only; only Restore brings it back (651ms) ✓ 77 [webkit-390] › e2e/trash-search.spec.ts:12:3 › row opens a Trash note read-only; only Restore brings it back (601ms) - 78 [webkit-390] › e2e/trash.spec.ts:18:1 › Delete in Info moves the note to the Trash, and Undo brings it back - 79 [webkit-390] › e2e/trash.spec.ts:33:1 › a deleted note waits in the Trash; Restore puts it back, Delete forever asks first - 80 [webkit-390] › e2e/trash.spec.ts:74:1 › a link to a note in the Trash shows the Trash, and comes back when it is restored 38 skipped 42 passed (43.6s) ```
Author
Owner

fixed in dev by 6e5f99decd (Trash search opens the shared read-only preview); #694 records tap/Enter/Restore regression coverage.

fixed in dev by 6e5f99decdd6b56fbedbe9039a19df12235ca46a (Trash search opens the shared read-only preview); #694 records tap/Enter/Restore regression coverage.
kayg closed this issue 2026-11-05 23:23:46 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#692
No description provided.