Issue 1239
Search results open the exact tab that matched
Back to our planOpen
enhancementfrontendcmspriority: medium
Problem
Search is being widened to every page and tool (#1228). The calculator and other tabbed content sit inside tabs, and every tab already has its own link (#1097, done). A search result that points at the page alone lands on the first tab with the matching content hidden, so the neighbor can't see why it matched.
Proposed fix
- The index stores, for each tab's content, that tab's own link, so a result opens that tab, already shown and in view, when the page loads.
- Reuses the tab links from #1097 and the index from #1228; no new tab behavior. This is extra scope after #1097 closed, so it is its own issue.
- Native-first check: how the Payload search plugin stores one record per page; if it can't hold per-tab records, add them through the plugin's own sync hook rather than a second index.
Acceptance criteria
- Not done: Failing tests first for the stored link of a tab's content.
- Not done: A search for a word that only appears inside a non-first tab opens the page on that tab, shown and in view, on a phone and desktop.
- Not done: A result for a page without tabs behaves as today.
- Not done: The news and events note describes it in the same PR.
Files likely touched
The search index sync in the news module, the search page and result card, src/modules/news/README.md.
Must not touch
The tabs component's own behavior (#1097) and accounts.
Area
frontend, cms
Priority
medium
Generated by Claude Code, opens in a new tab