Skip to content

Examples tab: accurate features and tags, and a search - #43

Merged
alisman merged 1 commit into
masterfrom
session/examples
Oct 19, 2026
Merged

alisman merged 1 commit into
masterfrom
session/examples

Conversation

@alisman

@alisman alisman commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

The Examples tab's pills and its filter disagreed, and the tags had drifted from the documents. This fixes both and adds a search.

What was wrong

  • The filter ignored the view-kind pills. Cards showed the view kinds each document draws, plus its tags. The chips filtered on tags alone, so an example drawing a survival view didn't appear under survival.
  • Tags claimed views the document doesn't have. oncoprint was on the colorectal workup, and its note promised an oncoprint it doesn't draw. compare was on pathways/enrichment/signatures, survival on Cox/risk model/incidence, and table on the patient tables. federation was on three single-study examples.
  • One tag was spelled several ways: OQL/oql, gene-set/gene-sets, lines-of-therapy/treatment-lines, and the timeline tag vs. the timeline view kind.
  • The risk-model example appeared twice under the same title. 34e2116 reinserted a stale copy, and the Table 1 change updated only the first. The two cards shared a React key.

What changed

  • lib/example-features.ts is now the one source for the tab, its filter and the assistant's list_examples tool:
    • View kinds are read from doc.views.
    • federation (cohorts span more than one study) and custom-data (bundled uploads) are derived from the document.
    • tags now hold topics only.
  • I retagged every example, removed the stale duplicate, fixed the colorectal note and regenerated docs/dsl.md.
  • Search: every word must appear in the title, description, note, pills or studies, ignoring case, hyphens and spaces. It combines with the chip filter, and chip counts follow the search. Chips are grouped as views / topics. An empty result says so and offers ways to clear the search or filter. The search and filter survive a tab switch.

Verification

  • test/example-features.test.ts checks for unique titles, no tag naming a view kind, no hand-written derived tag, no tag spelled two ways, and the search rules.
  • A new e2e check confirms the survival chip plus a search shows exactly the expected cards.
  • GATE_PORT=4109 scripts/gate.sh: 262 PASS, 0 FAIL. docs/dsl.md is in sync and the example counts are unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JqkKwtvKACvUPwmbbJzrjv

…earch

The tab's pills and its filter disagreed: a card showed the view kinds its
document draws plus its tags, but the chips filtered on tags alone, so an
example drawing a survival view was missing under "survival". And the tags
themselves had drifted from the documents.

lib/example-features.ts is now the one source for what an example is about:
- views: the kinds its document draws, read from doc.views
- topics: derived ones first ("federation" when its cohorts span more than
  one study, "custom-data" when it brings uploads), then its own tags
The tab, its filter and the assistant's list_examples tool all read it.

Tags are now topics only. Removed tags that named a view the document lacks
(oncoprint on the colorectal workup, compare on pathways/enrichment/
signatures, survival on Cox/risk model/incidence, table on the patient
tables, clinical and attrition where there is no such view), "federation" on
three single-study examples (now "federable"), and spellings of one tag
two ways (OQL/oql, gene-set/gene-sets, lines-of-therapy/treatment-lines,
timeline vs the timeline view kind -> timeline-events).

Removed the second "A survival risk model from mutated genes in lung cancer":
a stale copy reinserted by 34e2116; the Table 1 change updated only the
first. Two cards with one title shared a React key. Fixed the colorectal
workup's note, which promised an oncoprint the document does not draw.

Search: every word of the query must appear in the title, demonstrates,
note, pills or studies, ignoring case, hyphens and spaces. It combines with
the chip filter; chips are grouped as views / topics, their counts follow
the search, and an empty result says so with ways out. The box keeps its own
draft and hands it to the page after a pause, so typing re-renders the tab,
not the page; search and filter survive a tab switch (use-library).

Verified: test/example-features.test.ts (unique titles, no tag naming a view
kind, no hand-written derived tag, no tag spelled two ways, search rules);
a new e2e check that the survival chip plus a search shows exactly the
expected cards; GATE_PORT=4109 scripts/gate.sh passes (262 PASS, 0 FAIL,
docs/dsl.md in sync, example counts unchanged).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JqkKwtvKACvUPwmbbJzrjv
@alisman
alisman merged commit 4349a9c into master Oct 19, 2026
5 checks passed
@vercel

vercel Bot commented Oct 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cohort-lab Ready Ready Preview Oct 19, 2026 8:06am UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — 6393ee47 Deployed Oct 19, 2026 by vercel[bot]
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