fix(ui): enable Visual layout mode on Search results page#1686
fix(ui): enable Visual layout mode on Search results page#1686secondl1ght merged 4 commits intodevfrom
Conversation
Add SEARCH to VISUAL_SUPPORTED_FEED_VARIANTS and VISUAL_INTERACTIVE_CONTENT_VARIANTS so the visual grid renders for search results. Pass feedVariant and allowVisualLayout through the Search template to expose the Visual tab in sidebar filters and activate the wide shell layout. Wire up visual content resolution and sync in SearchTimelineFeed, and add a contentOverride parameter to useSearchStreamId to avoid a one-render lag with unsupported content types. Refs: #1598
🚀 Preview DeploymentURL: https://franky-preview-pr-1686-fzxmjul7ya-oa.a.run.app
|
Greptile SummaryThis PR enables Visual layout mode on the Search results page by applying the same three-layer pattern already used by Home and Bookmarks: adding Confidence Score: 5/5This PR is safe to merge — it's a clean port of the existing Home/Bookmarks Visual mode pattern applied to Search, with no architectural violations or logic errors. All changes follow the established three-layer pattern (layout resolution → content coercion → stream-id override), the test suite is correctly updated, and no P0/P1 issues were found. No files require special attention.
|
| Filename | Overview |
|---|---|
| src/hooks/useFeedLayoutResolution/useFeedLayoutResolution.ts | Adds SEARCH to VISUAL_SUPPORTED_FEED_VARIANTS — minimal, correct change. |
| src/components/organisms/Timeline/Feed/TimelineFeed/TimelineFeedVisual.helpers.ts | Adds SEARCH to VISUAL_INTERACTIVE_CONTENT_VARIANTS to enable content coercion; no issues. |
| src/components/templates/Feed/Search/Search.tsx | Passes feedVariant and allowVisualLayout to ContentLayout and all three sidebar/drawer components — mirrors the Home template correctly. |
| src/components/organisms/Timeline/Feed/TimelineFeed/TimelineFeed.tsx | SearchTimelineFeed gains resolveVisualFeedContent + useSyncInteractiveVisualContent, matching the Home/Bookmarks pattern exactly. |
| src/hooks/useSearchStreamId/useSearchStreamId.ts | Adds an optional contentOverride param to avoid a one-render lag; backward-compatible and clearly documented. |
| src/hooks/useFeedLayoutResolution/useFeedLayoutResolution.test.ts | Updates the unsupported-variant test to use HOT and adds a new test confirming SEARCH supports Visual — correct and complete. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User selects Visual layout] --> B[useFeedLayoutResolution\nSEARCH variant]
B --> C{VISUAL_SUPPORTED_FEED_VARIANTS\ncontains SEARCH?}
C -- Yes --> D[isVisualActive = true]
C -- No --> E[effectiveLayout = COLUMNS]
D --> F[SearchTimelineFeed\nresolveVisualFeedContent]
F --> G{content in\nVISUAL_DISABLED_CONTENT?}
G -- Yes --> H[coerce to 'all']
G -- No --> I[keep original content]
H --> J[useSyncInteractiveVisualContent\nupdate store]
I --> J
H --> K[useSearchStreamId\ncontentOverride = 'all']
I --> L[useSearchStreamId\ncontentOverride = content]
K --> M[Stream ID with overridden content]
L --> M
M --> N[TimelineFeedWithStream\nVisual grid rendered]
Reviews (1): Last reviewed commit: "Merge branch 'dev' into cursor/windows-a..." | Re-trigger Greptile
secondl1ght
left a comment
There was a problem hiding this comment.
Verified via the preview URL and appears to work as expected.
I found an unrelated bug during testing though. The Wide layout on the Search page is currently broken, this is on production right now. You can see it at the end of my demo video. I will put in a another PR to fix this.
Supersedes #1657 (same changes; head branch renamed to
bug-ui/1598-visual-mode-search-returns).Summary
Fixes #1598 — Visual mode was missing from the Search results page. Users could not filter search results using Visual layout, and navigating from Visual mode on Home to Search would silently fall back to Columns.
Changes
Root cause
Three blocking points prevented Visual mode on Search:
TIMELINE_FEED_VARIANT.SEARCHwas not inVISUAL_SUPPORTED_FEED_VARIANTS, soresolveFeedLayoutalways fell back to ColumnsfeedVarianttoContentLayout, so the wide shell layout never activatedallowVisualLayoutto sidebar/drawer components, so the Visual tab was hiddenFix
useFeedLayoutResolution.ts— AddedSEARCHtoVISUAL_SUPPORTED_FEED_VARIANTSSearch.tsx— PassfeedVariant={TIMELINE_FEED_VARIANT.SEARCH}toContentLayoutandallowVisualLayoutto all three sidebar/drawer componentsTimelineFeed.tsx— Added visual content resolution + sync inSearchTimelineFeed(same pattern as Home/Bookmarks), coercing unsupported content types (short/long/links/files) toallwhen Visual is activeTimelineFeedVisual.helpers.ts— AddedSEARCHtoVISUAL_INTERACTIVE_CONTENT_VARIANTSto enable content coercionuseSearchStreamId.ts— Added optionalcontentOverrideparameter soSearchTimelineFeedcan pass the resolved content directly, avoiding a one-render lag with unsupported content typesuseFeedLayoutResolution.test.ts— Updated test that used SEARCH as an "unsupported" variant (now uses HOT), added new test confirming SEARCH supports Visual