Skip to content

CODAP-1516: range thumb for visibility sliders - #2708

Draft
kswenson wants to merge 3 commits into
CODAP-1515-slider-configure-from-attributefrom
CODAP-1516-slider-range-thumb
Draft

kswenson wants to merge 3 commits into
CODAP-1515-slider-configure-from-attributefrom
CODAP-1516-slider-range-thumb

Conversation

@kswenson

@kswenson kswenson commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Summary

Stacked on #2707 (CODAP-1515). A visibility slider now shows a range thumb:

  • drag either edge to resize the range, or the middle to move it while keeping its width
  • bounds clamp to the axis; the handles can't cross
  • a collapsed (zero-width) range snaps to values present in the attribute, while dragging and during playback
  • each drag is one undoable change
  • playback moves the whole range, stepping through the data values when it has zero width

It follows the design mockup: the thumb is the slider's thumb split in half at its point, the value row reads "visible value(s) = low - high", and the axis is labeled with the bound attribute's name and units. The label is plain text until CODAP-1514's attribute menu replaces it.

The selection slider isn't implemented yet (CODAP-1518). It will reuse this same appearance. The thumb, value row and axis label apply to any range slider, and its value row will read "selected value(s)".

The range is modeled as the slider's value (its low end) plus a stored width, rather than separate low and high bounds, so the existing dynamic-value, playback, formula and export paths carry it. The design spec's model section was updated to match.

The Config width control depends on CODAP-1513's Config panel, so this story stays open until that lands.

Testing

  • Jest: range model (clamping, snapping, moving at the axis ends, axis-bound changes, one-step undo), playback stepping and bounds, and the handle and step helpers
  • Cypress: slider-range-thumb.spec.ts covers the handles and value row, the attribute label, hit-testing at the axis ends, keyboard resize, collapsing onto a data value, ignoring a right-button press, and moving the middle with undo; slider.spec.ts still passes for variable sliders

Fixes CODAP-1516

🤖 Generated with Claude Code

A visibility or selection slider shows a range thumb: drag either edge
to resize, or the middle to move the range while keeping its width.
Bounds clamp to the axis, a collapsed range snaps to values present in
the attribute, each drag is one undoable change, and playback moves the
whole range, stepping through the data values when it has zero width.

The thumb is the slider's thumb split in half at its point, the value
row shows "visible value(s) = low - high", and the axis is labeled with
the bound attribute.

The range is the slider's value (its low end) plus a stored width, so
the existing dynamic-value, playback, formula, and export paths carry it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kswenson kswenson added the v3 CODAP v3 label Sep 25, 2026
@kswenson kswenson changed the title CODAP-1516: range thumb for visibility and selection sliders CODAP-1516: range thumb for visibility sliders Sep 25, 2026
@codecov

codecov Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.22222% with 67 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.46%. Comparing base (cefd1be) to head (a9a61e3).

Files with missing lines Patch % Lines
v3/src/components/slider/slider-range-thumb.tsx 25.42% 44 Missing ⚠️
v3/src/components/slider/slider-component.tsx 51.61% 13 Missing and 2 partials ⚠️
v3/src/components/slider/slider-model.ts 95.83% 4 Missing ⚠️
v3/src/components/slider/use-slider-animation.tsx 33.33% 4 Missing ⚠️
Additional details and impacted files
@@                              Coverage Diff                               @@
##           CODAP-1515-slider-configure-from-attribute    #2708      +/-   ##
==============================================================================
- Coverage                                       73.46%   73.46%   -0.01%     
==============================================================================
  Files                                             826      829       +3     
  Lines                                           47793    47994     +201     
  Branches                                        12196    12263      +67     
==============================================================================
+ Hits                                            35111    35258     +147     
- Misses                                          12667    12699      +32     
- Partials                                           15       37      +22     
Flag Coverage Δ
cypress 38.00% <14.42%> (-0.11%) ⬇️
jest 63.58% <65.33%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cypress

cypress Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

codap-v3    Run #12313

Run Properties:  status check passed Passed #12313  •  git commit a9a61e337e: CODAP-1516: show a collapsed range's last value before playback wraps
Project codap-v3
Branch Review CODAP-1516-slider-range-thumb
Run status status check passed Passed #12313
Run duration 03m 12s
Commit git commit a9a61e337e: CODAP-1516: show a collapsed range's last value before playback wraps
Committer Kirk Swenson
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
View all changes introduced in this branch ↗︎

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Range clamping, snapping, displayed values, and completion notifications have correctness gaps.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity · 3 Medium severity

Open (4)
What changed in this PR

Adds range-thumb behavior for attribute-bound visibility and selection sliders.

Changes:

  • Adds range resizing, movement, snapping, playback, labels, and undo/logging.
  • Adds range-specific model helpers and UI components.
  • Adds Jest and Cypress coverage.
File Description
.claude/​skills/​generate-log-events-csv/​codap-v3-log-events.csv Documents range-change logging.
v3/​src/​utilities/​translation/​lang/​en-US.json5 Adds range labels and undo strings.
v3/​src/​components/​slider/​use-slider-animation.tsx Supports range-aware playback.
v3/​src/​components/​slider/​slider.scss Styles range controls and attribute labels.
v3/​src/​components/​slider/​slider-utils.ts Adds handle and step helpers.
v3/​src/​components/​slider/​slider-utils.test.ts Tests range utilities.
v3/​src/​components/​slider/​slider-range-values.tsx Renders range values.
v3/​src/​components/​slider/​slider-range-thumb.tsx Implements range handles and movement.
v3/​src/​components/​slider/​slider-model.ts Models range width, snapping, and bounds.
v3/​src/​components/​slider/​slider-model-range.test.ts Tests range model behavior.
v3/​src/​components/​slider/​slider-component.tsx Integrates range UI and state.
v3/​cypress/​support/​elements/​slider-tile.ts Adds range test selectors.
v3/​cypress/​e2e/​slider-range-thumb.spec.ts Tests range interactions.
v3/​cypress/​e2e/​slider-configure-from-attribute.spec.ts Updates configured-slider expectations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread v3/src/components/slider/slider-model.ts
Comment thread v3/src/components/slider/slider-component.tsx Outdated
Comment thread v3/src/components/slider/slider-range-thumb.tsx Outdated
Comment thread v3/src/components/slider/slider-range-values.tsx Outdated
- snap a collapsed range only to data values within the axis
- report the committed range in notifications and the log, from both
  edge and middle drags, which now share their commit options
- send the "change slider value" notification when a middle drag ends
- show one value only when the range has zero width

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Range playback has boundary and increment defects, and V2 serialization loses the new range state.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Resolved since last review (4)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Range playback skips endpoint due to premature boundary reset

v3/​src/​components/​slider/​use-slider-animation.tsx:64

For a collapsed range, nextAnimationValue() can return the final data value exactly. Because resetSlider treats equality as already past the boundary, starting playback from the penultimate value wraps immediately and never displays the endpoint (and likewise in reverse). Only reset when the next value is strictly outside the domain.

Comment thread v3/src/components/slider/slider-model.ts
When playback starts, a range slider tests its current value against the
end of its value domain, not its next step: a collapsed range's next step
can land exactly on the last data value, which has to be shown before
playback wraps. Variable sliders keep their existing check.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

Review effort: Balanced
Findings: None

Resolved since last review (1)

This branch was previously deployed

1 inactive deployment
development — a9a61e33 Deployed Sep 25, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3 CODAP v3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants