Analytics & builder polish#80
Merged
Merged
Conversation
- Tag badges become clickable: clicking adds a `#<slug>` token to the search input as a coloured chip (view → blue, query → yellow, resource → green). Chips can only be removed whole via the × button or Backspace at empty text. Duplicate chips are prevented. - Search filter supports `#tag` tokens with exact slug match. An item matches a tag if it has that tag OR is the entity itself (label slug match). Free text is fuzzy-searched against the tag-filtered subset. - Sticky search header switched to shadow-only style (no border-b) and copies the /settings layout. - Clear button (IconButton) on the right of the search input. - List wrapped in `mx-auto max-w-[990px] px-8` container with `divide-y` row separators. - Removed `line-clamp-1` from description; ItemRow left padding aligned with the search magnifier icon. - Sidebar in DataLineagePage temporarily removed: `/analytics/**` pages use full width via plain `<Outlet />`. - Sidebar menu icon for Analytics: FileChartPie → ChartNoAxesCombined. - Refactor: extract SearchBar, tagSlug, parseQuery, buildQuery, getItemTagSlugs, filterByTags, chipStyleFor as module-level helpers to keep AnalyticsListPage's cognitive complexity within limits.
- Replace the table layout on /u/resource with a card list aligned with
the analytics page: sticky search bar with shadow, mx-auto max-w-[990px]
centred container, divide-y row separators, name + description, tag
chips.
- Tags derived from StructureDefinition extensions:
- category (.../structuredefinition-category, valueString) split by
the first dot into top/sub chips, with HTML `&` decoded.
- standards-status (.../structuredefinition-standards-status,
valueCode) as a single chip (normative/trial-use/draft/informative).
- Search supports inline chips: clicking a tag adds a `#<slug>` chip
to the input, chips render with blue (category) or yellow (status)
colour, and can only be removed whole. Free text fuzzy-matches name
and description against the tag-filtered subset.
- Sort dropdown replaces the table sort headers (Name/URL × asc/desc).
- Favourites kept: pin button appears on hover, pinned items float to
the top of the list when no search is active.
- Keyboard navigation kept (↑/↓ from the search input, Enter to open).
- WebMCP integration preserved (listResourceTypes, toggleFavorite,
navigateToResourceType, getFavorites).
- Extract tagSlug/parseQuery/buildQuery into src/utils/tag-search.ts
shared between analytics and resource browser.
- Move url-history.ts to shared utils, key as argument so VD and SQLQuery use separate stores - Add canonical URL datalist for ViewDefinition (matches SQLQuery) - Save URL to history on save success only, not on every input change - Fix expand/collapse: stopPropagation in label button to avoid double-toggle with TreeView's onItemLabelClick
- EmptyState gets optional action slot; analytics empty state shows a Create button (single button or kind dropdown) and lives inside the list area so the header (search + Create) stays visible - Search refactor: tags moved out of ?q= into ?tags=[...] so original case/spaces are preserved in the URL; chip rendered as-is, slug normalization happens only for matching - Tag chip is now a button — click anywhere removes it (X remains as a visual cue) - Chip color resolution uses the combined views+queries list so badges remain colored on kind-filtered pages - Row padding pl-3 → pl-3.5; first/last row get rounded-t-lg / rounded-b-lg - Fuzzy-match highlight switched from text-text-link to font-medium for a subtler emphasis
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.
Summary
?tags=[...]query format that preserves original case/spaces, badge color resolution uses combined views+queries set, row padding/rounded corners, subtler fuzzy-match emphasis (font-medium).utils/url-history.ts, separate stores per resource), URL saved on save success only, expand/collapse fix for section labels (stopPropagation in label button)./analytics/**pages use full width via plain<Outlet />; Analytics icon swapped toChartNoAxesCombined.Test plan
/u/analytics(and/views,/queries): empty state shows Create button; header stays visible when list non-empty.#Patient names)./u/analytics/queries, chips for#Patient,#<ViewLabel>get coloured (combined lookup)./u/analytics/views/create: type a canonical URL, Save → reopen the form → URL appears in the input's datalist suggestions. URLs typed but not saved should NOT appear./u/analytics/queries/create(separate history)./u/resource: card list renders with chips; search/filter behaves like analytics.