Skip to content

fix(platform): search with the board filters and recover failed reads - #3906

Merged
yannickmonney merged 6 commits into
mainfrom
fix/task-board-filtered-search-recovery
Sep 29, 2026
Merged

yannickmonney merged 6 commits into
mainfrom
fix/task-board-filtered-search-recovery

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

Summary

Two task board defects, both reproduced on main (fac88df) in a real browser before the fix. Screenshots and logs are in the task's evidence.

Closes #3745
Closes #3747

What changed

The search is a board filter (backend/domains/tasks/service.ts, routes.ts)

  • The board doors (/tasks/by-project/:id, /tasks) take q. The shared boardFilterClause matches it with the palette's own token-AND semantics: the task's fields (title, description, external id, KEY-number), or one comment on it, hold every token, with LIKE metacharacters escaped.
  • The match runs in the statement that carries the board's LIMIT, so the facets and the 2,000-task cap apply to the complete match set.
  • The palette keeps its 25-hit page, built from the same tokenizer (taskSearchPatterns) and the same two SQL legs, so the two cannot drift. The board statements alias app.tasks as t.
  • The app sends the query with the board read under the existing board key (taskBoardScope + filters). It no longer calls /tasks/search, and hints invalidate it as before.

Each board read reports where it stands (app/features/tasks/lib/read-state.ts, hooks/queries.ts, tasks-workspace.tsx, task-read-alert.tsx)

  • The states are loading, answered, stale and failed, and each read gets a retry that re-issues it alone.
  • Failed first read: an alert with Try again (common.actions.tryAgain) replaces the lanes. Search, filters, Filter and Create task stay; permissions fall back to the project's own read while the board read has no answer.
  • Failed refresh: the rows stay, under "Couldn't refresh the tasks. They are shown as they were last loaded."
  • Failed search: the unsearched rows never show; react-query drops the placeholder on error.
  • Failed dependencies or activity: a warning over the standing board. The activity warning names Needs my review when that filter is on, because its result may then be incomplete. While the tasks themselves fail, their one alert retries every failed board read.
  • Past the 2,000-task cap: a note says so and points to the search, which reaches past the cap.
  • New search or filter loading: the board keeps its previous rows (react-query placeholderData, matched on the board's key scope, so it never shows another project's rows), dimmed after 300 ms and aria-busy. A late answer for an earlier search never replaces the current one.
  • Focus: Try again stays one focusable element, aria-busy, while it runs. A disabled button would drop the focus, and one given a disabledReason is re-created inside a tooltip. When the retry works, the focus moves to the board region, announced as Board or List.
  • Filter button: now uses the shared isFilterAffordanceDisabled, so a failed or pending read no longer disables Filter.
  • Shared wrapper: useBackendQuery gains a typed placeholderData passthrough, used only by this board.

Copy, docs, manual

Coordination

Checklist

  • bun run check passes. Not run whole locally: the sandbox has 4 GiB shared with a parallel session and hit OOM kills. CI runs every job on this PR, and the scoped local runs are listed below.
  • bun run lint:sast passes (Opengrep): 162 rules on the 17 changed TypeScript files, 0 findings.
  • Translations updated in services/platform/messages/{en,de,fr}.yml (tasks.read.*), plus a de-CH override for «…» quotes.
  • Docs updated in docs/{en,de,fr}/platform/projects/tasks.md.
  • README.md / README.de.md / README.fr.md: N/A, they do not describe the board.

Test plan

Automated, all run locally on the final head (rebased on 5b10a3c):

  • Regression suite tasks-workspace.read-state.test.tsx (12 cases): the real workspace, hooks, adapters and QueryClient against a stubbed backend that filters like the server. It covers the Bug: task search applies its 25-hit limit before board filters and hides matching work #3745 fixture, 26 matches with consistent lane counts, a no-match control, failed first reads on board and list with focus hand-off, a stale refresh, a failed search, a scope change while a retry is pending, dependency and activity failures with scoped retries, a true empty board and the cap note. 11 of 12 fail against main's client code; the one that passes is the true-empty control.
  • Server unit tests: service.board-search.test.ts pins the search inside the statement that carries LIMIT and the shared legs with the palette. routes.board-search.test.ts covers q on both doors.
  • Adapter and hooks: app/lib/backend/tasks.test.ts covers q in the URL and key, trimmed. read-state.test.ts covers the state machine. The existing tasks-workspace.test.tsx, kanban-board, tasks-list, queries, use-home-data and lib/i18n/messages tests pass.
  • Native Postgres (backend:integration, new lane checkTaskBoardSearch, with checkTasks and checkTasksOrgIsolation): 39/40. There are 35 matches across six statuses and three assignees, the only Urgent one is the oldest, and the palette still answers its 25 without it. The lane also checks the assignee, archived and status filters, token-AND, % escaping, KEY-number, a no-match query and the all-projects board. With the route change reverted, all three new records fail. The one FAIL is the environmental BM25 check (pgserver has no pg_search), same on main.
  • Scoped gates: type-aware oxlint + type check on every changed file, oxfmt, bun run lint:manual, check-guide.ts on the tasks suite, and the docs locale/structure/link tests.

Real browser (Chromium via Playwright, local stack with a synthetic org only, no provider or agent calls):

  • Bug: task search applies its 25-hit limit before board filters and hides matching work #3745: Urgent + term shows the Urgent task. All 34 matches show, 33 by field and one by comment only, and the lane counts add up to 34. Assignee You + term gives 16. A no-match word gives six empty lanes and no alert. No /tasks/search request is made.
  • Failed first read (board and list): the alert, Filter and Create task stay, and Enter on Try again recovers with the focus on the Board / List region.
  • Two sessions: an edit from a second session plus a failed refresh keeps the rows under the stale note, and Try again brings the edit in. A match another session adds appears live under the search.
  • Failed search: the alert shows, no rows, and the query is kept. Try again then shows exactly the Urgent match.
  • Scope change: with Try again held for the old search and a new search typed, the late answer never replaces the new results.

Reviewer spot checks: block */api/app/tasks/by-project/* in DevTools, open the board, unblock, press Enter on Try again. Then search a project where the facet match is past the first 25 hits.

…earch

The Tasks page intersected its board read with the palette's search,
whose first 25 hits ignore the board's facets. With more than 25
matches, a task the facets kept could fall outside those hits and
every lane read "No tasks" (#3745).

The search is now a board filter. The board doors take `q`, and the
shared board filter clause matches it with the palette's token-AND
semantics: the task's fields, or one comment on it, hold every token,
LIKE metacharacters escaped. It runs in the statement that carries
the board's LIMIT, so the facets and the cap apply to the complete
match set. The palette keeps its 25-hit page, built from the same
tokenizer and the same two legs. The page sends its query with the
board read under the existing board key and no longer calls the
palette search.

A new integration lane proves it on Postgres: 35 matches across six
statuses and three assignees, with the only Urgent one as the oldest.
The palette still answers its 25 without that task, and the board
answers all 35. The lane also checks the facets, archived tasks,
token-AND, escaping, KEY-number, a no-match query and the
all-projects board.

Refs #3745
The Tasks page dropped every read's error state (#3747). A failed
first read settled on six "No tasks" lanes, and Filter and Create task
vanished because the board's permission defaulted to false. A failed
search left every row under the query. Failed dependency and activity
reads silently removed the Blocked, agent and review markers, and with
them part of "Needs my review". Nothing offered a retry.

Each board read now reports where it stands (loading, answered,
stale, failed) and has a retry that re-issues it alone:

- A failed first read shows an alert with Try again in place of the
  lanes. The search, filters and controls stay, and permissions fall
  back to the project's own read.
- A failed refresh keeps the rows under a note that they are stale.
- A failed search never shows the unsearched rows.
- Failed dependencies or activity show a warning over a standing
  board; the activity one names the review filter when it is on.
- A board past its 2,000-task cap says so and points to the search.
- While a new search or filter loads, the board keeps its previous
  rows, dimmed and busy, but never another project's rows. A late
  answer for an earlier search never replaces the current one.
- Try again stays one focusable, busy element while it runs. When it
  works, the focus moves to the board region, announced as Board or
  List.

Filter uses the shared isFilterAffordanceDisabled rule, so a failed
or pending read no longer disables it. The strings ship in EN, DE and
FR, with a de-CH quote override.

Refs #3747
The tasks guide (EN, DE, FR) now says that the search and the filters
narrow the board together and every match appears, comment matches
included. It notes the 2,000-task cap and that a search reaches past
it. It describes what a failed read, a failed refresh and failed
dependencies or activity show, and that Try again reloads only what
failed.

The tasks suite gains TASK-F51, TASK-B28 to TASK-B31 and TASK-A13,
after the IDs #3810 and #3811 took, and TASK-F18 no longer judges two
reads agreeing. The automation register names the specs that own the
automated half, pins.md records why the boxes say what they say, and
the suite totals are recounted.

Refs #3745
Refs #3747
@yannickmonney yannickmonney changed the title fix(platform): search the task board with its filters and recover failed reads fix(platform): search with the board filters and recover failed reads Sep 29, 2026
…ed-search-recovery

The manual readme counts main's boxes plus this branch's six (989). Three of this branch's new boxes collided with IDs other open PRs add — TASK-F51 (#3813), TASK-B28 (#3881), TASK-B29 (#3908) — so they move to TASK-F52, TASK-B32 and TASK-B33, in the suite, pins.md and the automation register.
Every open PR that edits the readme's shared total conflicts with each other one that lands first; the suites keep their own Cost headers, and the readme is recounted once after the queue lands.
@yannickmonney
yannickmonney merged commit 6483479 into main Sep 29, 2026
50 checks passed
@yannickmonney
yannickmonney deleted the fix/task-board-filtered-search-recovery branch September 29, 2026 14:53
yannickmonney added a commit that referenced this pull request Sep 29, 2026
…chived-project-and-parent-moves

The task suite keeps main's new boxes (#3906) and this branch's TASK-B29 after them; its Cost is 99.
@yannickmonney

Copy link
Copy Markdown
Contributor Author

Post-merge verification: the rest of the plan, run on this PR's CI-built bundle with synthetic local data only.

  • Failed dependencies: a warning shows over a standing board. Its Try again re-reads the dependencies alone (the board read count is unchanged), and Blocked returns.

  • 390 px: the failed-read alert, Filter and Create task fit with no horizontal scrolling. The DE and FR copy renders at 1280 px.

  • Board cap: a project of 2,001 tasks shows "Showing the first 2,000 tasks. Search to find the others." Searching reaches task 2,001 and the note goes.

  • Visual gate (visual-aspect-analyzer, this PR's bundle against main's nightly bundle):

    Scenario This PR main
    Board 99 99
    List 99 99
    Failed read 99 99
    Failed read at 390 px 75 75

    Every defect is identical on main and sits outside the board: the Home panel list shifts 0.03 while it loads, the project tabs' underline flickers on phones (0.5), and one icon shifts by 0. The new alert, its button and the board region add none. The two pre-existing defects would need a follow-up of their own.

Noted for next time: bump only the suite's Cost header and leave the readme totals to the final recount, and run oxfmt on files I resolve during a rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant