Skip to content

Commit 035af64

Browse files
mios-devclaude
andcommitted
launch default = golden-ratio 16:10 centered (MiOS global)
Operator directive 2026-05-18: "always default launched perfectly centered as a 16:10 window centered at the screens current resolutions bounds--centered and sized centered and ratioed at the golden ratio + centered per 3x3 screen grid (just sized per the golden ratio to screen size and centered all in a 16:10 ratio window--ALL as Global defaults". NEW position value "default" added to PositionLiteral enum + JSONSchema. Geometry: phi = 1.6180339887 (golden ratio) W = round(screen_width / phi) ~= 0.618 * screen_width H = round(W * 10 / 16) 16:10 aspect X = (screen_W - W) / 2 centered horizontally Y = (screen_H - H) / 2 centered vertically Concrete numbers on 1920x1080 primary: W = 1186, H = 741 X = 367, Y = 169 (centered in the middle cell of the 3x3 rule-of-thirds grid) ALL launches now get this by default. open_app(name="notepad") emits this geometry; "open notepad on top right" still emits top-right (operator's explicit position wins). Opt-out via "as-is" (no MoveWindow at all -- whatever the OS gave) or "center" (centered at native size, no resize). Implementation (4 files): * mios_verbs.py: PositionLiteral now begins with "default"; open_app's `position` parameter default = "default". * mios-owui-install-tools: open_app spec enum + default updated; description names the new default + clarifies as-is vs center vs default vs maximize. * mios-windows: MIOS_LAUNCH_POSITION env default flipped from "center" to "default"; new branch in place_block computes the golden-16:10-centered rect via PowerShell ($phi var + Round + integer cast); clamps to WorkingArea. * Live verified in OWUI DB: open_app.position.enum (12): ['default','as-is','center', 'left','right','top','bottom','top-left','top-right', 'bottom-left','bottom-right','maximize'] open_app.position.default: 'default' Note: the always-focus chain from the previous commit (ShowWindow + AttachThreadInput + SetForegroundWindow + SwitchToThisWindow) still runs unconditionally, so the new geometry comes with the XFSE/Game-Bar-piercing focus baked in. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 73a6c38 commit 035af64

3 files changed

Lines changed: 46 additions & 9 deletions

File tree

usr/libexec/mios/mios-owui-install-tools

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,13 @@ def main() -> int:
202202
"description": "App name or substring (case-insensitive)."},
203203
"position": {
204204
"type": "string",
205-
"enum": ["as-is", "center", "left", "right", "top", "bottom",
206-
"top-left", "top-right", "bottom-left", "bottom-right",
205+
"enum": ["default", "as-is", "center",
206+
"left", "right", "top", "bottom",
207+
"top-left", "top-right",
208+
"bottom-left", "bottom-right",
207209
"maximize"],
208-
"default": "as-is",
209-
"description": "Where to place the new window. 'as-is' = no MoveWindow; 'maximize' = full WorkingArea.",
210+
"default": "default",
211+
"description": "Where to place the new window. 'default' (MiOS global): 16:10 window sized at screen_width / golden-ratio, centered. 'as-is' = no MoveWindow at all. 'center' = centered at native size. 'maximize' = full WorkingArea.",
210212
},
211213
"args": {
212214
"type": "array",
@@ -242,8 +244,10 @@ def main() -> int:
242244
"title": {"type": "string", "description": "Title pattern."},
243245
"position": {
244246
"type": "string",
245-
"enum": ["as-is", "center", "left", "right", "top", "bottom",
246-
"top-left", "top-right", "bottom-left", "bottom-right",
247+
"enum": ["default", "as-is", "center",
248+
"left", "right", "top", "bottom",
249+
"top-left", "top-right",
250+
"bottom-left", "bottom-right",
247251
"maximize"],
248252
"description": "Canonical position. 'as-is' is a noop.",
249253
},

usr/libexec/mios/mios-windows

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,13 @@ start_args = [cmd_exe, "/c", "start", "", target] + extra_args
524524
# MIOS_LAUNCH_PLACE <X>,<Y> (absolute top-left, takes
525525
# precedence over MIOS_LAUNCH_POSITION)
526526
import os
527-
position = os.environ.get("MIOS_LAUNCH_POSITION", "center").lower()
527+
# Operator directive 2026-05-18: "always default launched perfectly
528+
# centered as a 16:10 window centered at the screens current
529+
# resolutions bounds--centered and sized centered and ratioed at the
530+
# golden ratio + centered per 3x3 screen grid". Default position is
531+
# now "default": 16:10 window sized at W = screen_W / phi, centered
532+
# on the primary monitor's WorkingArea.
533+
position = os.environ.get("MIOS_LAUNCH_POSITION", "default").lower()
528534
size_env = os.environ.get("MIOS_LAUNCH_SIZE", "")
529535
place_env = os.environ.get("MIOS_LAUNCH_PLACE", "")
530536
# Compute the placement PowerShell snippet from those knobs.
@@ -553,7 +559,21 @@ if "," in place_env:
553559
except (ValueError, TypeError):
554560
pass
555561
# Otherwise apply named position relative to PrimaryScreen WorkingArea.
556-
if position == "center":
562+
if position == "default":
563+
# 16:10 window sized at W = screen_W / golden_ratio,
564+
# H = W * 10/16, centered both axes. The PowerShell-side
565+
# [Math]::Round + integer cast keeps the numbers clean.
566+
place_block += (
567+
"$phi = 1.6180339887; "
568+
"$w = [int]([Math]::Round($s.Width / $phi)); "
569+
"$wh = [int]([Math]::Round($w * 10.0 / 16.0)); "
570+
# Don't exceed working area
571+
"if ($w -gt $s.Width) { $w = $s.Width }; "
572+
"if ($wh -gt $s.Height) { $wh = $s.Height }; "
573+
"$x = $s.X + [int](($s.Width - $w) / 2); "
574+
"$y = $s.Y + [int](($s.Height - $wh) / 2); "
575+
)
576+
elif position == "center":
557577
place_block += (
558578
"$x = $s.X + [int](($s.Width - $w) / 2); "
559579
"$y = $s.Y + [int](($s.Height - $wh) / 2); ")
@@ -614,6 +634,9 @@ if pwsh:
614634
proc_name = target.rsplit("\\", 1)[-1]
615635
if proc_name.lower().endswith(".exe"):
616636
proc_name = proc_name[:-4]
637+
# Move only when position changes geometry. "as-is" and "none"
638+
# leave the window where the OS put it; "default" applies the
639+
# golden-16:10 centered geometry (the new MiOS global default).
617640
do_move = position not in ("none", "as-is")
618641
move_block = ""
619642
if do_move:

usr/share/mios/owui/tools/mios_verbs.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,17 @@
5353
# enforces them client-side -- the model CANNOT emit an invalid
5454
# position value, so the schema teaches the surface instead of a
5555
# 700-line rule book.
56+
# Position enum: "default" is the MiOS global launch geometry
57+
# (operator directive 2026-05-18) -- a 16:10 window sized at
58+
# screen_width / phi (golden ratio ~0.618) and centered on the
59+
# primary monitor's WorkingArea. Concretely on 1920x1080:
60+
# W = 1920 / 1.618 ~= 1186
61+
# H = W * 10/16 ~= 741
62+
# centered at (367, 169)
63+
# Use "as-is" to OPT OUT (leave wherever the OS placed it).
64+
# "center" = native-size centered (no resize).
5665
PositionLiteral = Literal[
66+
"default",
5767
"as-is",
5868
"center", "left", "right", "top", "bottom",
5969
"top-left", "top-right", "bottom-left", "bottom-right",
@@ -317,7 +327,7 @@ async def system_status(self, __user__: Optional[dict] = None) -> str:
317327
async def open_app(
318328
self,
319329
name: str,
320-
position: PositionLiteral = "as-is",
330+
position: PositionLiteral = "default",
321331
args: Optional[list[str]] = None,
322332
monitor: int = 0,
323333
__user__: Optional[dict] = None,

0 commit comments

Comments
 (0)