Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
fix(jarvisbar): lower the display-scale ceiling to the signed-off 0.85 look
Ruben Lütke5e08b1c2357a
diff --git a/jarvis/ui/jarvisbar/renderer.py b/jarvis/ui/jarvisbar/renderer.pyindex 0caa67ce6b..df05487dfa 100644--- a/jarvis/ui/jarvisbar/renderer.py+++ b/jarvis/ui/jarvisbar/renderer.py@@ -68,33 +68,42 @@ _SH = _SCALE * _H # combined vertical factor# (Tk points on macOS). On a small laptop screen (a 14" MacBook is ~1512 Tk# points wide) the same fixed size occupies nearly twice the relative width# and reads as clunky. ``DISPLAY_SCALE`` adapts the whole geometry to the-# screen the bar actually lives on: 1.0 (the maintainer-approved look) on-# anything at least REFERENCE_SCREEN_W x REFERENCE_SCREEN_H, proportionally-# smaller below that, never under MIN_DISPLAY_SCALE so the controls stay-# clickable. Scaling happens at RENDER time — the frame is drawn crisply at-# the scaled size. This is NOT the blurry DPI bitmap upscaling that was-# explicitly rejected (see overlay.start()'s DPI notes); the DPI strategy-# there is untouched.+# screen the bar actually lives on: BASE_DISPLAY_SCALE (the maintainer-+# approved look) on anything at least REFERENCE_SCREEN_W x+# REFERENCE_SCREEN_H, proportionally smaller below that, never under+# MIN_DISPLAY_SCALE so the controls stay clickable. Scaling happens at+# RENDER time — the frame is drawn crisply at the scaled size. This is NOT+# the blurry DPI bitmap upscaling that was explicitly rejected (see+# overlay.start()'s DPI notes); the DPI strategy there is untouched.REFERENCE_SCREEN_W = 1920REFERENCE_SCREEN_H = 1080MIN_DISPLAY_SCALE = 0.55+# The signed-off size ceiling. The historical constants (scale 1.0) render+# the idle pill 47 px long on the maintainer's 2560x1440 monitor — judged+# "too big" against a 40 px good-example screenshot (2026-07-21), while a+# physical-mm experiment at 0.595 (~29 px) was "too small". 40/47 = 0.85+# lands exactly on the good example, and the 14" laptop's proportional+# 0.79 (independently signed off) sits in the same zone — so 0.85 is the+# approved look on every screen at least the reference size.+BASE_DISPLAY_SCALE = 0.85DISPLAY_SCALE = 1.0def compute_display_scale(screen_w: int, screen_h: int) -> float:"""Scale factor for the screen the bar lives on (pure, unit-testable).- Never enlarges beyond 1.0 (big monitors keep the approved look); shrinks- proportionally on screens smaller than the reference in either axis;- clamps at ``MIN_DISPLAY_SCALE``. Invalid input degrades to 1.0.+ Never enlarges beyond ``BASE_DISPLAY_SCALE`` (big monitors keep the+ approved look); shrinks proportionally on screens smaller than the+ reference in either axis; clamps at ``MIN_DISPLAY_SCALE``. Invalid input+ degrades to ``BASE_DISPLAY_SCALE``."""try:sw, sh = int(screen_w), int(screen_h)except (TypeError, ValueError):- return 1.0+ return BASE_DISPLAY_SCALEif sw <= 0 or sh <= 0:- return 1.0- s = min(1.0, sw / REFERENCE_SCREEN_W, sh / REFERENCE_SCREEN_H)+ return BASE_DISPLAY_SCALE+ s = min(BASE_DISPLAY_SCALE, sw / REFERENCE_SCREEN_W, sh / REFERENCE_SCREEN_H)return max(MIN_DISPLAY_SCALE, round(s, 3))diff --git a/tests/unit/ui/jarvisbar/test_display_scale.py b/tests/unit/ui/jarvisbar/test_display_scale.pyindex 5b699f6be8..c51bae7f56 100644--- a/tests/unit/ui/jarvisbar/test_display_scale.py+++ b/tests/unit/ui/jarvisbar/test_display_scale.py@@ -6,8 +6,10 @@ small laptop screen the same fixed size reads as clunky (maintainer feedback,factor and ``apply_display_scale`` recomputes the module geometry. These testspin three contracts:-1. Screens at least as big as the reference keep the EXACT historical look- (scale 1.0 must reproduce the old constants byte-identically).+1. Screens at least as big as the reference get the signed-off+ ``BASE_DISPLAY_SCALE`` ceiling (0.85 — measured from the maintainer's+ too-big/good-example screenshots 2026-07-21); scale 1.0 still reproduces+ the historical constants byte-identically as the geometry baseline.2. Small screens shrink proportionally, bounded by ``MIN_DISPLAY_SCALE``.3. The renderer picks up a rescale at instantiation time (no import-timefreeze) and renders frames at the recomputed window size.@@ -29,17 +31,22 @@ def _restore_scale():# --------------------------------------------------------------------------- ## compute_display_scale ## --------------------------------------------------------------------------- #-def test_reference_and_bigger_screens_keep_scale_one():- assert renderer.compute_display_scale(1920, 1080) == 1.0- assert renderer.compute_display_scale(2560, 1440) == 1.0- assert renderer.compute_display_scale(3840, 2160) == 1.0+def test_reference_and_bigger_screens_get_the_approved_ceiling():+ # The ceiling is the signed-off look, NOT 1.0: the historical constants+ # were judged "too big" (47 px idle pill vs the 40 px good example).+ assert renderer.BASE_DISPLAY_SCALE == 0.85+ assert renderer.compute_display_scale(1920, 1080) == renderer.BASE_DISPLAY_SCALE+ assert renderer.compute_display_scale(2560, 1440) == renderer.BASE_DISPLAY_SCALE+ assert renderer.compute_display_scale(3840, 2160) == renderer.BASE_DISPLAY_SCALEdef test_small_laptop_screen_shrinks_proportionally():- # A 14" MacBook is ~1512 Tk points wide → width is the binding axis.+ # A 14" MacBook is ~1512 Tk points wide → width is the binding axis+ # (0.7875 < the 0.85 ceiling). This is the independently signed-off+ # laptop look — the ceiling change must NOT alter it.s = renderer.compute_display_scale(1512, 982)assert s == pytest.approx(1512 / 1920, abs=0.001)- assert s < 1.0+ assert s < renderer.BASE_DISPLAY_SCALEdef test_height_can_be_the_binding_axis():@@ -52,10 +59,11 @@ def test_tiny_screen_clamps_at_the_floor():assert renderer.compute_display_scale(800, 600) == renderer.MIN_DISPLAY_SCALE-def test_invalid_screen_degrades_to_one():- assert renderer.compute_display_scale(0, 0) == 1.0- assert renderer.compute_display_scale(-1, 1080) == 1.0- assert renderer.compute_display_scale(None, None) == 1.0 # type: ignore[arg-type]+def test_invalid_screen_degrades_to_the_approved_ceiling():+ base = renderer.BASE_DISPLAY_SCALE+ assert renderer.compute_display_scale(0, 0) == base+ assert renderer.compute_display_scale(-1, 1080) == base+ assert renderer.compute_display_scale(None, None) == base # type: ignore[arg-type]# --------------------------------------------------------------------------- #