ENG-1738: Render advanced search results as sidebar block#1071
ENG-1738: Render advanced search results as sidebar block#1071trangdoan982 wants to merge 4 commits into
Conversation
Switch advanced search sidebar behavior to create a single summary block with wikilink children, and wire Option+Enter/footer action to open that block in the right sidebar. This aligns the flow with Roam's native sidebar result rendering while keeping the search dialog focused on result-list interaction. Co-authored-by: Cursor <cursoragent@cursor.com>
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d392a6af2f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| text: `[[${result.title}]]`, | ||
| })); | ||
|
|
||
| const sidebarPageUid = await createPage({ title: sidebarBlockTitle }); |
There was a problem hiding this comment.
Reuse existing sidebar page before calling createPage
The new sidebar action always calls createPage with a deterministic title derived from the query (Advanced search results: "..."), so repeating the same search term will attempt to create the same page title again. Roam page titles are unique and createPage is not an upsert, so the second run for the same query will throw and hit the error toast instead of opening results. This makes the new Option + Enter / footer flow fail for a common repeat-search case unless you first rename/delete the previously created results page.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is quite different than the functionality I was expecting.
On Apr 23 and May 7th, we discussed replicating the same functionality as the Roam native search which is to render the search as a component in the sidebar. But it looks like this did not make it into the scope doc/ticket. Upon looking at the scope doc/ticket, I can see where the confusion could have arose: "The active result opens in the main panel or side bar accordingly". This is quite ambiguous.
I believe this will be quite confusing to users based on the wording and it will leave them with multiple backlinks to clean up. I don't see the benefit of creating a page/blocks in this case as search is generally ephemeral.
That being said, there is a similar pattern in query builder called "Share To" where a user can insert search results as references to a given page, which may be something users request.
But for this use case let's change it to a rendered component or bring it up in the next Roam meeting / All Hands for clarification.
https://www.loom.com/share/08c356bb7cd841868b34bcea39cbab3b
Summary
Option + Entershortcut to open a dedicated sidebar results block instead of opening individual pagesAdvanced search results: \"{query}\") with child wikilink rows for each currently displayed resultTest plan
DG: Open Node Search, search for a query, pressOption + Enter, and confirm a single right-sidebar block opensOpen search sidebarin footer triggers the same behavior asOption + EnterMade with Cursor