Skip to content

Analytics & builder polish#80

Merged
Panthevm merged 4 commits into
masterfrom
7565-analytics-recents-list
May 19, 2026
Merged

Analytics & builder polish#80
Panthevm merged 4 commits into
masterfrom
7565-analytics-recents-list

Conversation

@Panthevm
Copy link
Copy Markdown
Collaborator

Summary

  • Analytics list: empty state with inline Create CTA, header (search + Create) always visible, click-to-remove chips, ?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).
  • ResourceBrowser: card list aligned with analytics layout, clickable tag chips.
  • Builder (ViewDefinition + SQLQuery): canonical URL datalist (shared utils/url-history.ts, separate stores per resource), URL saved on save success only, expand/collapse fix for section labels (stopPropagation in label button).
  • Sidebar: /analytics/** pages use full width via plain <Outlet />; Analytics icon swapped to ChartNoAxesCombined.

Test plan

  • /u/analytics (and /views, /queries): empty state shows Create button; header stays visible when list non-empty.
  • Click a row badge → chip appears in search bar with original text (e.g. #Patient names).
  • Click chip → removed. X icon still shown.
  • On /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.
  • Same for /u/analytics/queries/create (separate history).
  • In both create pages, clicking the section labels (PROPERTIES, DEPENDS ON, PARAMETERS, SQL, etc.) toggles expand/collapse on every click.
  • /u/resource: card list renders with chips; search/filter behaves like analytics.

Panthevm added 4 commits May 18, 2026 19:31
- 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 `&amp;` 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
@Panthevm Panthevm requested review from Aitem and ryukzak May 19, 2026 14:16
Copy link
Copy Markdown
Contributor

@ryukzak ryukzak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TLDR

@Panthevm Panthevm merged commit 8c96d42 into master May 19, 2026
4 checks passed
@ryukzak ryukzak deleted the 7565-analytics-recents-list branch May 19, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants