Skip to content

Hide the "Studies with matching topics" discovery chip - #65

Merged
ronnyTodgers merged 1 commit into
masterfrom
hide-topics-chip
Sep 24, 2026
Merged

ronnyTodgers merged 1 commit into
masterfrom
hide-topics-chip

Conversation

@ronnyTodgers

Copy link
Copy Markdown
Collaborator

The "Studies with matching topics" chip links to Discovery with one topics= parameter for every topic found in the matches. Discovery combines keyword filters with AND (contains_all in harmony_discovery_core/util.py), so the link only returns studies tagged with every topic.

Measured against the live Discovery API:

Topics sent Studies returned
anxiety, depression 207
+ psychological distress 78
+ emotional problems 10
SCARED (child) alone at default 70% threshold: 6 topics 0
SCARED (child) + CES-D at 30%: 9 topics 0

Broad instruments routinely land on an empty search, and switching Discovery to OR isn't practical. So this hides the chip behind SHOW_TOPICS_CHIP = false, next to SHOW_INSTRUMENTS_CHIP from #63. With both flags off, the Discover card doesn't render.

The per-match Harmony logo links (/search/?query=<both question texts>) and the Catalogue Mental Health card are unchanged.

CI=true npm run build and build:HarmonyExport pass locally. The minifier drops the chip code from the bundle, and the per-match link is still there.

🤖 Generated with Claude Code

Discovery ANDs keyword filters, and the chip sends every topic found in the
matches. Two to four topics still return studies, but broader instruments
produce six or more (SCARED child alone gives six at the default 70%
threshold), which returns nothing. With both chips hidden the Discover card
no longer renders; the per-match Discovery links are unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for harmony-staging ready!

Name Link
🔨 Latest commit cb22ac3
🔍 Latest deploy log https://app.netlify.com/projects/harmony-staging/deploys/6ab50a343b2d82000719af29
😎 Deploy Preview https://deploy-preview-65--harmony-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@ronnyTodgers
ronnyTodgers merged commit 4467966 into master Sep 24, 2026
5 checks passed
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