Repository navigation
Conversation
rnambaale
marked this pull request as draft
September 23, 2026 11:56
rnambaale
force-pushed
the
feat/global-search
branch
from
September 23, 2026 11:57
2bf6c97 to
a3d0f57
Compare
Adds a GET /search client with typed errors, a debounced and cancellable useSearch hook with cursor-based load-more, and a header search field that renders snippet highlights as text nodes and deep-links hits to their session panels. Also fixes the shared CommandItem disabled selector: cmdk 1.x always emits data-disabled="false", so data-[disabled] matched every item and made results unclickable.
rnambaale
force-pushed
the
feat/global-search
branch
from
September 24, 2026 04:34
a3d0f57 to
c02dcd9
Compare
Renames session_display_title to session_title on action and agreement hits, drops display_title from session hits in favour of title, and unescapes HTML entities in snippet segments now that the backend escapes stored text before adding <mark> markers.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds the frontend for the backend's new
GET /searchendpoint (keyword mode): a search field in the top navigation that searches coaching sessions, goals, actions, agreements and topics and links each hit to where it lives in the app. Results render in a dropdown under the field with keyboard navigation, load-more pagination, and inline loading, empty and error states.GitHub Issue: [Resolves] refactor-group/refactor-platform-rs#404
Changes
src/types/search.ts- hit tagged union withOption-wrapped nullable fields, typed error codes, a parser that drops unknown hit types, andsplitSnippetso<mark>markers render as text nodes, never HTML.src/lib/api/search.ts-SearchApi.searchreturning a neverthrowResultAsync<SearchResponse, SearchError>;useSearchhook with 250 ms debounce,AbortControllercancellation, reset to page one on query or filter change, and cursor-basedloadMore.src/lib/utils/search-hit-href.ts- maps hits to routes: sessions to their page, actions to the actions panel withhighlight, goals to their creating session's goals panel or the dashboard, agreements and topics to their session.src/components/ui/search/-GlobalSearch(cmdk-based field, ⌘K //focus shortcut, skeleton loading rows, empty and error states) andSearchSnippet.src/components/ui/site-header.tsx- renders the field between the sidebar toggle and the right-hand nav.src/components/ui/command.tsx- fixes the sharedCommandItemdisabled selector. cmdk 1.x always emitsdata-disabled="false", sodata-[disabled]matched every item and made results unclickable; nowdata-[disabled=true].Screenshots / Videos Showing UI Changes
Testing Strategy
npm run test— new suites under__tests__/types/search.test.ts,__tests__/lib/utils/search-hit-href.test.ts,__tests__/lib/api/search.test.tsx,__tests__/components/ui/search/.Escapeclears, ⌘K focuses the field from outside an input.plannvsplann).coaching_session_id.Concerns
describe any concerns that might be worth mentioning or discussing