Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

studiobench: residual stabilizer padding settles the windowed pin check (#17571)

Daniel Hanea64e5654cc0
diff --git a/tests/studio/studiobench/INTERFACES.md b/tests/studio/studiobench/INTERFACES.md
index c0205b12f32..c1ef4a79e78 100644
--- a/tests/studio/studiobench/INTERFACES.md
+++ b/tests/studio/studiobench/INTERFACES.md
@@ -331,7 +331,7 @@ condition and adds four:
| `total_declared` / `total_matches_seeded` | every mounted `[data-role]` carries `aria-setsize`, all agreeing, equal to the number of messages the seeder wrote. Waived only when the whole thread is mounted anyway, which is the full-mount condition itself |
| `posinset_on_every_row` | every mounted message carries `aria-posinset` |
| `anchored_at_end` | the app reports itself at the bottom (`.aui-thread-scroll-to-bottom` carrying `invisible`), falling back to the scrollTop arithmetic only when it does not |
-| `pin_settled` | `--aui-scroll-stabilizer` is off the viewport, i.e. the autoscroll has finished pinning |
+| `pin_settled` | `--aui-scroll-stabilizer` is off the viewport, or unchanged since the last probe of a settled page (the autoscroll keeps its last value as residual padding until the user scrolls up) |
**This is a contract the arm must meet, not a signal that exists today.** Unsloth ships no
virtualization and no ordinal attributes anywhere in the chat thread. WAI-ARIA already requires a
diff --git a/tests/studio/studiobench/runtime/readiness.py b/tests/studio/studiobench/runtime/readiness.py
index 3f2efd685db..43c95a75664 100644
--- a/tests/studio/studiobench/runtime/readiness.py
+++ b/tests/studio/studiobench/runtime/readiness.py
@@ -75,8 +75,8 @@ PROBE_JS = """
// permanently and hides it with `invisible` when use-intent-aware-autoscroll reports at-bottom,
// so this is the state the app is acting on rather than a number the driver computed.
const jump = document.querySelector(".aui-thread-scroll-to-bottom");
- // Set on the viewport WHILE the autoscroll is pinning and removed when it settles. A page that
- // still carries it is mid-pin, whatever its scrollTop currently reads.
+ // Set on the viewport while the autoscroll pins. use-intent-aware-autoscroll keeps the last
+ // value as residual padding until the user scrolls up, so only a changing value is mid-pin.
const stabilizer = vp
? (vp.style.getPropertyValue("--aui-scroll-stabilizer") || "").trim()
: "";
@@ -120,6 +120,7 @@ PROBE_JS = """
jump_button_present: Boolean(jump),
app_says_at_bottom: jump ? jump.classList.contains("invisible") : null,
pinning: stabilizer !== "",
+ stabilizer: stabilizer,
};
}
"""
@@ -208,8 +209,13 @@ def evaluate(probe: dict, previous: Optional[dict], expected_messages: int, mode
out["anchored_at_end"] = bool(app_bottom) if app_bottom is not None else near_bottom
# Assert the viewport exists: without it every windowed condition above silently passes.
out["viewport_present"] = bool(probe.get("viewport_present"))
- # `--aui-scroll-stabilizer` is present while autoscroll is still pinning.
- out["pin_settled"] = not probe.get("pinning")
+ # `--aui-scroll-stabilizer` stays on the viewport as residual padding once the pin ends, so
+ # a value unchanged since the last probe of a settled page has finished pinning.
+ out["pin_settled"] = not probe.get("pinning") or bool(
+ settled
+ and previous.get("pinning")
+ and previous.get("stabilizer") == probe.get("stabilizer")
+ )
out["not_over_mounted"] = (probe.get("mounted") or 0) <= expected_messages
else:
out["all_messages_mounted"] = (probe.get("mounted") or 0) >= expected_messages
diff --git a/tests/studio/studiobench/runtime/selftest/test_studiobench_readiness_live.py b/tests/studio/studiobench/runtime/selftest/test_studiobench_readiness_live.py
index 1b8496508bf..53707dcba1d 100644
--- a/tests/studio/studiobench/runtime/selftest/test_studiobench_readiness_live.py
+++ b/tests/studio/studiobench/runtime/selftest/test_studiobench_readiness_live.py
@@ -709,3 +709,17 @@ def test_a_windowed_thread_with_no_viewport_is_refused(browser):
page.close()
assert "viewport_present" in str(caught.value), str(caught.value)
+
+
+def test_residual_stabilizer_padding_settles_the_pin():
+ """use-intent-aware-autoscroll keeps `--aui-scroll-stabilizer` as residual padding after the
+ pin ends and drops it only when the user scrolls up, on fully mounted builds too."""
+ residual = _windowed_probe(pinning = True, stabilizer = "24px")
+ assert evaluate(residual, None, 18, MODE_WINDOWED)["pin_settled"] is False
+ assert evaluate(residual, dict(residual), 18, MODE_WINDOWED)["pin_settled"] is True
+ moving = _windowed_probe(pinning = True, stabilizer = "12px")
+ assert evaluate(residual, moving, 18, MODE_WINDOWED)["pin_settled"] is False
+ growing = _windowed_probe(pinning = True, stabilizer = "24px", scroll_height = 90)
+ assert evaluate(residual, growing, 18, MODE_WINDOWED)["pin_settled"] is False
+ cleared = _windowed_probe()
+ assert evaluate(cleared, residual, 18, MODE_WINDOWED)["pin_settled"] is True