feat(kit): render the remaining ranges with UiSlider

UiSlider merges a caller's own input, change and blur handlers with its
own, leaves the input alone on a null model, and gains unstyled for a
range drawn as the browser's own. The rail card setting, observation
timeline, imagery opacity, Street Level date and Bhote Koshi split and
progress ranges now render through it. The timeline and the setting
ranges put the handle back once their owner has answered, since a drag
that ends where the slider last rendered leaves its model unchanged.

The radio tuner keeps its own input: its owner moves the handle back to
the selected station without changing the slot.
This commit is contained in:
Sameh Khamis committed 2026-11-01 13:06:04 -08:00
1 parent b9ecb9b9f5
commit 2e43bd9985
12 files changed
+200 -54

No files matched your search

+26
View File
@@ -150,3 +150,29 @@ test('an update from inside the preview neither moves the handle back nor surviv
assert.equal(slider.getAttribute('aria-valuetext'), '09-22 01:10 UTC');
view.destroy();
});
test('a drag that ends where it began puts the handle back on the shown index', async (t) => {
t.mock.timers.enable({ apis: ['setTimeout'] });
const f = railFixture();
const commits = [];
const view = createRailTimeline({
...f,
onCommit: (tick) => commits.push(tick),
});
view.update(props);
await nextTick();
const slider = f.find((n) => n.tagName === 'INPUT');
slider.value = '0';
slider.dispatchEvent(new Event('input'));
slider.dispatchEvent(new Event('pointercancel'));
await nextTick();
assert.equal(slider.value, '2', 'a cancelled drag');
assert.deepEqual(commits, []);
// A refused commit: the owner keeps its index.
slider.value = '1';
slider.dispatchEvent(new Event('input'));
slider.dispatchEvent(new Event('change'));
await nextTick();
assert.deepEqual(commits, [ticks[1]]);
assert.equal(slider.value, '2', 'a refused commit');
view.destroy();
});