Skip to content

fix(design): make Design home search addressable so find-designs lands on the filtered list - #9542

Open
steve8708 wants to merge 7 commits into
mainfrom
job/j-20261120-0527-cf9
Open

steve8708 wants to merge 7 commits into
mainfrom
job/j-20261120-0527-cf9

Conversation

@steve8708

Copy link
Copy Markdown
Contributor

Fix: K-DES-4-1 (design, corpus, served e78471e)

Failing evidence: K-DES-4-1: Design search service did not respond (34.5s). The prompt is "find designs with 'checkout' in the name". Expected view: Design home filtered by "checkout".

1. Repro

Sweep e78471e (findings/adhoc/e78471e7e544bebd71456fbefdfb9da2e6f42e73/verdicts.tsv:51) gave FAIL … did not respond (34.5s). In that same shard, K-DES-2-1 failed with CDP timeout Runtime.evaluate, so the pane was already wedged after the generation step. The raw tool trace for that run isn't in the findings (only corpus-compact.jsonl on the sweep host), so the timeout itself was not re-observed.

What is reproducible, on the runs right after it (served 14e35bb, c980b4b, de6cc9f; findings/adhoc/<sha>/verdicts.tsv:51):

  • 14e35bb: FAIL … Reported no matching designs while remaining on Sunday Coffee design URL instead of filtered Design home (7.2s)
  • c980b4b: FAIL … without navigating to filtered search view (7.6s)
  • de6cc9f: FAIL … Pane stayed on Morrow Coffee design; Design search not navigable (9.2s)

Steps: generate a design (K-DES-2-1) so the pane is on /design/design/<id>, then ask "find designs with 'checkout' in the name". The agent answers "no designs" and the pane never leaves the editor.

Baseline on the served build as qa-fleet@builder.io (session email asserted before each call). The server path the agent uses is healthy:

POST /design/_agent-native/webmcp/actions/list-designs {"search":"checkout","pageSize":50,"compact":"true"}
6 sequential: 126 136 258 124 140 260 ms, all 200, {"count":0,...}
5 parallel:   130 422 424 436 401 ms, all 200
first call after idle on the plain action route: 2154 ms

So there is no slow or failing search service on the current build. The part that fails is the flow's view.

2. Root cause

  • templates/design/app/pages/Index.tsx:182 (on main): home search is useState(""), never read from or written to the URL.
  • templates/design/app/hooks/use-navigation-state.ts:263-274: getCommandPath returns /home for every list navigation, so a navigate command cannot carry a search.
  • templates/design/actions/navigate.ts:118: the schema has path but no search, and list-designs is a read, which by policy (packages/core/src/application-state/navigate-write-guard.ts) never moves the user's view.

So from an open editor nothing can put the pane on Design home filtered by a name. The agent can only read list-designs, answer in chat, and leave the pane on the editor, which is the verdict in the three later sweeps. When the pane is also wedged (e78471e), the same prompt ends in the 30 s "did not respond". Other flows that need "show me the filtered list" on Design share this gap; none are in the strict set.

3. Test that fails first, then green

Red (before the fix), actions/navigate.test.ts, app/hooks/use-navigation-state.test.ts, app/pages/Index.skip-to-editor.test.tsx:

× carries a design-home search into the one-shot navigation command   (navigate not called with {view:"list", search})
× sends a list navigation with a search to Design home filtered by it (commandPathFromNavigation is not a function)
× reports the home search back in the navigation state                (homeSearchFromSearchParams is not a function)
× filters the home list by the search in the URL                      (list-designs params had no search)
× writes typed home search into the URL so the view can be shared…    (setSearchParams never called)
Tests 3 failed | 27 passed (30);  Tests 2 failed | 2 passed | 48 skipped (52)

Fix:

  • Index.tsx: home search reads and writes /home?search=; an external navigation replaces the typed search.
  • navigate.ts and use-navigation-state.ts: view=list accepts search and lands on /home?search=<text>; the nav state reports it.
  • list-designs.ts: the description points agents at navigate for showing the matches.

Green (after): 15 files, 293 tests passed on the touched specs (actions/list-designs, actions/navigate*, app/hooks, both Index tests); pnpm typecheck rc=0; pnpm guards rc=0.

4. Live proof

Not yet. The fix is not served, so the failing flow cannot pass on the live build until this lands and the workspace picks it up. Once it is served, I'll run K-DES-4-1 as qa-fleet@builder.io and add the output here. The check is that navigate {view:"list", search:"checkout"} puts the pane on /design/home?search=checkout with the input filled and the rows matching list-designs(search), with the pane opened from an editor first.

Not run: a local browser pass, because this checkout has no built packages (dist copied from an older checkout for the unit runs only).

Ref: j-20261120-0527-cf9

…nds on the filtered list

Home search was local state only, so from an open editor neither an agent nor a
link could put the pane on Design home filtered by a name (K-DES-4-1).

- Index: read and write /home?search=; an external navigation replaces the typed search
- navigate: view=list accepts search and lands on /home?search=<text>; the nav state reports it
- list-designs: description points agents at navigate for showing the matches

Ref: j-20261120-0527-cf9
builder-io-integration[bot]

This comment was marked as outdated.

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder reviewed your changes and found 1 potential issue 🟡

Review Details

This update adds a 300 ms debounce for navigation-state persistence and changes URL-driven nonempty searches to widen the Design home filter from “mine” to “all.” Those changes address both prior findings for agent-issued search navigation; I resolved the associated threads. One related but distinct inconsistency remains for searches typed directly into the home input: typing creates the same ?search= URL but leaves the active filter at “mine,” while reloading that URL switches to “all,” so the visible results change based on how the URL was reached. Risk assessment: standard. The updated URL and navigation tests are useful, though the typed-search test does not assert the resulting ownership scope.

Finding

  • 🟡 Typed search scope differs from URL-restored scope: apply the same “mine”→“all” behavior when a nonempty search is typed, and assert the list query scope in the test.

🧪 Browser testing: Skipped — browser-test-planner agent is unavailable; re-evaluate on the next incremental review.

if (query) next.set("search", query);
else next.delete("search");
if (next.toString() !== searchParams.toString()) {
setSearchParams(next, { replace: true });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Keep typed search scope consistent with URL-restored searches

Typing a nonempty query writes the same ?search= URL used by agent navigation, but this handler leaves designFilter at mine. Reopening that URL switches mine to all, so the same URL can show different matches depending on how it was reached; apply the URL-search scope rule here too and assert the resulting createdBy value in the typed-search test.

Fix in Builder

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferred as non-critical after round 2; tracked in follow-up list (design search follow-ups: typed-search scope parity, route-state dedup of identical navigate commands, search arg with non-list views).

builder-io-integration[bot]

This comment was marked as outdated.

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder reviewed your changes and found 1 potential issue 🟡

Review Details

The PR continues to make Design home search addressable and persists route state with the debounce added in an earlier update. I confirmed the existing typed-search “mine” scope issue remains unchanged and did not repost it. A distinct issue is that identical navigate(view=list, search) commands are written without a unique command ID, while the client deduplicates repeated command payloads for the lifetime of the mounted route-state hook; after one successful search, a later identical request can be consumed without navigating, despite the action returning success. Risk assessment: standard.

New finding

  • 🟡 Repeated search navigation is deduplicated: include a unique _writeId in navigate commands and test identical consecutive requests.

🧪 Browser testing: Skipped — browser-test-planner agent unavailable; re-evaluate on the next incremental review.

if (args.interactTheme) nav.interactTheme = args.interactTheme;
if (args.templateId) nav.templateId = args.templateId;
if (args.path) nav.path = args.path;
if (args.search) nav.search = args.search;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Allow identical search navigation commands to run again

This action writes the same { view, search } payload each time. The route-state consumer deduplicates identical commands by their JSON and retains the last processed key for the mounted session, so after one successful search a repeated request can be consumed without navigating while this action still returns success. Include a unique _writeId per command and test two identical consecutive navigations.

Fix in Builder

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferred as non-critical after round 2; tracked in follow-up list (design search follow-ups: typed-search scope parity, route-state dedup of identical navigate commands, search arg with non-list views).

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder reviewed your changes and has a few items to flag 🟡

Review Details

The updated diff still contains both previously reported issues: typed searches do not switch the “mine” filter to “all,” and identical navigation commands lack a unique ID, so the client can deduplicate repeats. I did not repost either existing finding. The change also adds calendar action search phrases; reviewers found no behavior regression there. A new low-severity contract gap is that the navigate schema accepts search with non-list views or a custom path, but path resolution ignores it while the action response implies it was applied. Risk assessment: standard.

New finding

  • 🟡 Reject search for non-list navigation: validate the combination or avoid reporting it as applied.

🧪 Browser testing: Skipped — browser-test-planner agent unavailable; re-evaluate on the next incremental review.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant