Skip to content

[Platform]: Category icons and compact Summary redesign - #1007

Open
carcruz wants to merge 9 commits into
feat/sticky-profile-headerfrom
feat/category-redesign
Open

[Platform]: Category icons and compact Summary redesign#1007
carcruz wants to merge 9 commits into
feat/sticky-profile-headerfrom
feat/category-redesign

Conversation

@carcruz

@carcruz carcruz commented Jul 28, 2026

Copy link
Copy Markdown
Member

Description

Adds an entity-relationship category taxonomy (Target, Disease, Drug, Target-Disease, Target-Variant, Disease-Variant, Literature — same vocabulary already used for dataset tags on the Downloads page) to all 71 widget definitions, and uses it to redesign the Summary section and replace the "DG"-style initials avatar across the profile UI.

  • Category tagging: every widget's definition object gets a category field (single or dual-tagged), plus a shared Category/CATEGORY_ICONS map (packages/ui) driving one FontAwesome icon per category.
  • CategoryAvatar (packages/ui/src/components/CategoryAvatar.tsx): single shared component replacing the createShortName-based initials avatar in three places — Summary cards, Section item headers, and the sticky nav (active-widget chip + dropdown rows).
  • Summary redesign: cards → compact pill chips in a CSS grid (no card border/shadow), with a clickable category filter-chip row (styled to match the AOTF control chips) instead of static per-category headers.
  • Bug fix: CredibleSet and Study profile pages rendered widget Summary components directly instead of through SummaryRenderer — broke the grid layout (overlapping chips, since SummaryItem no longer self-wraps in a grid item after the redesign) and meant those two profiles never got category filters at all. Both now route through SummaryRenderer, reusing widget arrays already defined for their sticky nav.

Issue:
Deploy preview:

Type of change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • yarn vite build --mode development in apps/platform after each change, no new errors
  • Manual verification in-browser across all 7 profile page types, including the two pages with layout bugs (CredibleSet, Study)

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have made corresponding changes to the documentation

carcruz added 9 commits July 28, 2026 16:23
Adds a category field (Target, Disease, Drug, Target-Disease,
Target-Variant, Disease-Variant, Literature) to every widget's
definition object across all 71 sections, reusing the same taxonomy
already used for dataset tagging on the Downloads page. Groundwork for
category-driven icons and filtering across profile pages.
Replaces the initials avatar ("DG"-style, from createShortName) used in
three places - Summary cards, Section item headers, and the sticky nav -
with a single CategoryAvatar showing each widget's category icon instead.

Summary cards go from a card grid to compact pill chips in a CSS grid,
grouped/filterable by category via a chip row (styled to match the AOTF
control chips) rather than static per-category headers.

Also fixes CredibleSet and Study profile pages: both rendered widget
Summary components directly instead of through SummaryRenderer, which
broke the grid layout (overlapping chips, since SummaryItem no longer
self-wraps in a grid item) and meant those two profiles never got
category filters at all.
…ion badges

- Summary filter chips: fixed hover reverting to grey, active color now
  matches app blue, no borders (AOTF style), smaller font, kept widget
  display order instead of regrouping by category
- Summary/Section item icons: transparent background with colored icon
  (CategoryAvatar filled=false) instead of a filled square, consistent
  border-radius between Summary chips and Section item cards
- Section item header: tighter padding, smaller icon
- GenomicLocation: rebuilt on shared chip styling, grey-300 fill/border
  matching the Summary chips
- Added a "Core essential gene" chip to TargetPage's ProfileHeader,
  styled like an active filter chip, shown side-by-side with
  GenomicLocation
- New SummaryCategoryContext, URL-synced via useStateParams (?category=),
  shared across Summary chips, section bodies, and the sticky nav
- SectionsRenderer hides full-body sections outside the active category
- StickyProfileHeader nav/active-section tracking filtered to match
- Wired into all 7 profile pages; Study/CredibleSet pages also gate their
  manually-rendered sections (shared trait studies, QTL/GWAS credible
  sets, variants) against the same filter
navigate({ hash }) without an explicit search wipes existing query
params, so clicking a Summary chip or sticky-nav item was resetting
the ?category= filter back to All. Pass through location.search.
…o-top

useActiveSection kept its last activeId even after the caller's ids list
changed (e.g. switching the category filter), so it could keep pointing
at a now-hidden widget until the next scroll-triggered intersection
event. Reset/validate activeId whenever ids changes.

Also clear the URL hash once the user scrolls back above the sticky
trigger, so a refresh at the top of the page doesn't re-jump into
whichever section was last active. Guarded to only kick in after the
sticky bar has been visible at least once, so it doesn't strip a
deep-linked hash before the page has had a chance to scroll to it.
Extracted the "All" + per-category chip row from SummaryRenderer into a
shared CategoryFilterChips component (both read/write the same
SummaryCategoryContext), and reused it in StickyProfileHeader's widget
dropdown alongside the existing text filter, so category filtering is
available and visually consistent in both places.
Swap the full category filter chip row (too busy in a dropdown that
already has its own text filter) for a single chip showing the active
category with a delete/clear action, only rendered when a category
filter is actually applied.
MUI's default filled-Chip delete-icon hover color darkens (tuned for
light chips), which nearly vanished against our primary.dark background.
Override to a lighter grey on hover instead.
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.

1 participant