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.

Tests: follow the media picker's Chat-aligned height, start pwsh through run_pwsh (#15758)

Daniel Han947358ef8a36
diff --git a/tests/python/test_installer_compile_bytecode.py b/tests/python/test_installer_compile_bytecode.py
index eb359d7d4bd..58515691305 100644
--- a/tests/python/test_installer_compile_bytecode.py
+++ b/tests/python/test_installer_compile_bytecode.py
@@ -22,6 +22,8 @@ import sys
import time
from pathlib import Path
+from unsloth_pwsh_runner import run_pwsh
+
import pytest
REPO_ROOT = Path(__file__).resolve().parents[2]
@@ -268,7 +270,7 @@ def test_setup_ps1_block_never_fails(tmp_path, opt_out, expect_call):
env = {"PATH": "/usr/bin:/bin", "HOME": str(tmp_path)}
if opt_out:
env[opt_out[0]] = opt_out[1]
- result = subprocess.run(
+ result = run_pwsh(
[PWSH, "-NoProfile", "-NonInteractive", "-Command", script],
env = env,
capture_output = True,
diff --git a/tests/studio/test_desktop_reliability_frontend_contract.py b/tests/studio/test_desktop_reliability_frontend_contract.py
index 57de410eb69..2a9853f1818 100644
--- a/tests/studio/test_desktop_reliability_frontend_contract.py
+++ b/tests/studio/test_desktop_reliability_frontend_contract.py
@@ -2003,11 +2003,10 @@ def test_audio_page_matches_the_image_rail_header_and_action_footer():
assert "relative" in header_opening
assert "z-40" in header_opening
assert "@[50rem]:border-r" in header
- assert (
- 'className="!h-[34px] max-w-full gap-1 overflow-hidden pl-3 pr-1 '
- '@[68rem]:gap-2 @[68rem]:pl-4 @[68rem]:pr-2"' in header
- )
- assert 'triggerLabelClassName="text-ui-14 @[68rem]:text-ui-16"' in header
+ # The media model picker shares Chat's control height (scaled in index.css), see _MEDIA_PICKER_CLASS.
+ assert _MEDIA_PICKER_CLASS in header
+ # No label override: the trigger reads exactly like Chat's.
+ assert "triggerLabelClassName" not in header
assert "grid h-full min-w-0 grid-cols-[1fr_auto_auto] gap-2" in header
assert "@[50rem]:grid-cols-[1fr_auto_1fr]" in header
assert "col-start-2 justify-self-end pt-" in header
@@ -2160,11 +2159,10 @@ def test_images_header_tracks_preview_and_preserves_titlebar_controls():
assert "isMobile" in header and "pl-12" in header
assert "!pinned && isTauri" in header
assert "pl-[var(--studio-collapsed-chat-controls-inset,0.75rem)]" in header
- assert (
- 'className="!h-[34px] max-w-full gap-1 overflow-hidden pl-3 pr-1 '
- '@[68rem]:gap-2 @[68rem]:pl-4 @[68rem]:pr-2"' in header
- )
- assert 'triggerLabelClassName="text-ui-14 @[68rem]:text-ui-16"' in header
+ # The media model picker shares Chat's control height (scaled in index.css), see _MEDIA_PICKER_CLASS.
+ assert _MEDIA_PICKER_CLASS in header
+ # No label override: the trigger reads exactly like Chat's.
+ assert "triggerLabelClassName" not in header
assert "grid h-full min-w-0 grid-cols-[1fr_auto_auto] gap-2" in header
assert "@[50rem]:grid-cols-[1fr_auto_1fr] @[50rem]:gap-0" in header
assert "col-start-2" in header
@@ -2191,6 +2189,12 @@ def test_a_stopped_repair_update_is_recorded_as_canceled_not_failed():
# `_ui_source` hides whether a length still scales, so the scaling is asserted here, per
# variant (`h-[...]` and `hover:h-[...]` differ).
+# Images, Audio and Video line their model picker up with Chat: same left inset, same control height.
+_MEDIA_PICKER_CLASS = (
+ 'className="ml-1.5 max-w-full overflow-hidden !pl-2.5 !pr-1.5 '
+ '!h-[var(--studio-chat-control-height,34px)]"'
+)
+
_LENGTHS_THAT_MUST_KEEP_THE_SCALE = (
(NAVBAR, "", "h", "48px", 2),
(IMAGES_PAGE, "", "h", "48px", 1),
@@ -2213,13 +2217,13 @@ _LENGTHS_THAT_MUST_KEEP_THE_SCALE = (
# The 34px pill controls in the media headers, in all three spellings the pages use. The
# band around them scales and so does their own text, so a control left fixed is the one
# thing in that row that does not move, and it crowds out its label.
- (IMAGES_PAGE, "!", "h", "34px", 2),
+ (IMAGES_PAGE, "!", "h", "34px", 1),
(IMAGES_PAGE, "", "h", "34px", 1),
(IMAGES_PAGE, "[&>button]:", "h", "34px", 1),
- (AUDIO_PAGE, "!", "h", "34px", 1),
+ (AUDIO_PAGE, "!", "h", "34px", 0),
(AUDIO_PAGE, "", "h", "34px", 1),
(AUDIO_PAGE, "[&>button]:", "h", "34px", 1),
- (VIDEO_PAGE, "!", "h", "34px", 2),
+ (VIDEO_PAGE, "!", "h", "34px", 1),
(CHAT_PAGE, "!", "size", "30px", 1),
(CHAT_PAGE, "", "size", "30px", 2),
(CHAT_HEADER_MENU, "", "size", "30px", 2),
@@ -2337,6 +2341,17 @@ def test_the_lengths_these_contracts_measure_still_follow_the_ui_scale():
), f"{path.name} has a bare {named}, which stays put while its text grows"
+def test_the_media_pickers_take_chats_scaled_control_height():
+ """The picker height moved from a scaled 34px literal to Chat's control-height token; the token
+ itself must still scale, or the pill stays put while its text grows."""
+ css = (FRONTEND / "index.css").read_text(encoding = "utf-8")
+ assert re.search(
+ r"--studio-chat-control-height:\s*calc\(\d+px \* var\(--ui-space-scale, 1\)\);", css
+ )
+ for page in (IMAGES_PAGE, AUDIO_PAGE, VIDEO_PAGE):
+ assert _MEDIA_PICKER_CLASS in page.read_text(encoding = "utf-8"), page
+
+
def test_the_media_rail_fallback_is_the_width_hook_fallback():
"""The CSS fallback must equal the hook's fallback, or the divider jumps on first paint."""
hook = (FRONTEND / "hooks/use-media-rail-width.ts").read_text(encoding = "utf-8")