Skip to content

Study View filter bar: several ranges of one chart as one pill, as the portal writes them (STV-FB-4) - #471

Merged
alisman merged 1 commit into
masterfrom
studyview-merged-range-pill
Nov 19, 2026
Merged

alisman merged 1 commit into
masterfrom
studyview-merged-range-pill

Conversation

@alisman

@alisman alisman commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Several ranges of one chart's filter now read as one pill, as the portal writes them (STV-FB-4, intervalFiltersDisplayValue). This follows the user's answer of 2026-11-19: copy legacy's single pill.

  • The pill runs from the lowest start to the highest end; each end keeps its own bound and stays open when any range is open there. When the ranges have gaps it reads wider than the filter, as the portal's does. The filter itself is unchanged.
  • Its × removes the chart's filter.
  • An edited end makes the filter that one interval, as the portal's edit does, and its ends become custom bins on the chart (Study View bar menu: Custom Bins, Quartiles, Median, Log Scale, Show NA #203).
  • Unchanged: ranges mixed with a value list keep a pill each, and one range is its own pill.
  • Code: filterGroups, removePill, editInterval and intervalEnds in lib/study-view-pills.ts; the one pill's leaf is ALL_LEAVES.

Spec IDs

  • Covered: STV-FB-4 (several ranges as one interval).

Verification

  • Browser, dev server, luad: Diagnosis Age's bars (45, 50] and (60, 65] clicked read one pill, "Diagnosis Age : 45 < x ≤ 65", with ends 45 and 65. The selection stays the two ranges (99 patients). The pill's × clears the filter. No page errors.

  • e2e: the filter-bar step (one range, its ends edited) is unchanged.

  • Unit tests: test/study-view-pills.test.ts:

    • the pill from the lowest start to the highest end, in either draft order;
    • an open start kept open, and a point as its own end;
    • its × removing the filter;
    • an edited end making one interval, and that interval's ends;
    • ranges mixed with a value list left as pills.

    npm test 6,956 pass, 0 fail; tsc --noEmit and eslint clean.

  • Coverage: passes.

  • Planted bugs: 2 in scripts/mutants/study-view/merged-range-pill.ts (guard unit).

Tracker

Under "Study View → filters, actions and tabs", this line (docs/PORTAL-PARITY.md:474):

  • Several separate ranges of one chart show as one pill each (STV-FB-4); the portal merges them into one interval from the first bar's start to the last's end (which reads wider than the filter)

becomes:

Scorecard 31-study-view-shell.md, row STV-FB-4 (was | STV-FB-4 | 🟡 | B | "50 < x ≤ 60", "a ≤ x ≤ b", "> a", "≤ b", one value; ends edited in place (start > end swaps, start = end and empty refused), and an edit makes custom bins on the chart (#203). Separate ranges are separate pills (portal: one merged interval) |):

| STV-FB-4 | ✅ | B | "50 < x ≤ 60", "a ≤ x ≤ b", "> a", "≤ b", one value; ends edited in place (start > end swaps, start = end and empty refused), and an edit makes custom bins on the chart (#203). Several ranges one pill, the first range's start to the last's end, as the portal (an edit makes it that one interval) |

Preview

/lab?tab=explore&study=luad_tcga_pan_can_atlas_2018: click two non-adjacent Diagnosis Age bars.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht

…e portal writes them (STV-FB-4)

The user's answer (2026-11-19): copy legacy's single pill. When a chart's filter is two or more
ranges, the bar shows one interval from the lowest start to the highest end (each end keeping its
bound), though it reads wider than the filter when the ranges have gaps; the filter itself is
unchanged. Its × removes the chart's filter, and an edited end makes the filter that one interval,
as the portal's edit does. Seen on luad: Diagnosis Age (45, 50] and (60, 65] read
"45 < x ≤ 65", 99 patients.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht
@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
cbiolab-genie Ready Ready Preview Nov 19, 2026 5:53pm UTC
cbiolab-new Ready Ready Preview Nov 19, 2026 5:53pm UTC
cohort-lab Ready Ready Preview Nov 19, 2026 5:53pm UTC

Request Review

@alisman

alisman commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Review: pass. This applies the user's answer of 2026-11-19 (Study View Q6, STV-FB-4). A chart filter of two or more ranges is now one pill, from the lowest start to the highest end, each end keeping its own bound (open when any range is open there), as the portal's intervalFiltersDisplayValue writes it. It reads wider than the filter when the ranges have gaps, as the portal's does. Removing that pill clears the chart's filter, and editing it makes the filter that single interval, as the portal's does. A filter mixing ranges with non-range leaves keeps one pill per leaf. The two planted bugs (a pill per range, first range only) are caught by the new tests.

nit: the test comment "the user's answer of 2026-11-19" records history; the comment should say what the test checks.

@alisman
alisman added this pull request to the merge queue Nov 19, 2026
Merged via the queue into master with commit 5b90208 Nov 19, 2026
12 checks passed
@alisman
alisman deleted the studyview-merged-range-pill branch November 19, 2026 18:22

This branch was successfully deployed

1 active deployment
Preview – cohort-lab — 9b8ddbd6 Deployed Nov 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