From e2392ecd0b354d6d69a77c0380f30cf350759214 Mon Sep 17 00:00:00 2001 From: jimmy Date: Thu, 22 Oct 2026 11:44:19 +1300 Subject: [PATCH] Keep the simulator fitted to the window and label fixtures on hover. Co-Authored-By: Claude Sonnet 5.5 --- simulator/static/app.js | 1 + simulator/static/style.css | 42 ++++++++++++++++++++++++++++++-------- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/simulator/static/app.js b/simulator/static/app.js index 6d9a42f..df383f4 100644 --- a/simulator/static/app.js +++ b/simulator/static/app.js @@ -389,6 +389,7 @@ function buildList() { li.id = `fx-${fixture.id}`; li.className = fixture.kind; li.dataset.id = fixture.id; + li.title = fixture.label; const swatch = document.createElement("span"); swatch.className = "swatch"; const name = document.createElement("span"); diff --git a/simulator/static/style.css b/simulator/static/style.css index 0a5f613..747ebcc 100644 --- a/simulator/static/style.css +++ b/simulator/static/style.css @@ -21,8 +21,10 @@ html, body { body { display: grid; - grid-template-rows: auto 1fr; - min-height: 100%; + grid-template-rows: auto minmax(0, 1fr); + height: 100vh; + height: 100dvh; + overflow: hidden; } header { @@ -65,8 +67,10 @@ h2 { font-size: 14px; } main { display: grid; - grid-template-columns: 1fr 300px; + grid-template-columns: minmax(0, 1fr) 300px; + grid-template-rows: minmax(0, 1fr); min-height: 0; + min-width: 0; } canvas { @@ -80,8 +84,11 @@ canvas { aside { border-left: 1px solid var(--line); background: var(--panel); - overflow: auto; - padding: 12px 14px 24px; + overflow: hidden; + min-height: 0; + padding: 10px 14px; + display: flex; + flex-direction: column; } ul { @@ -95,7 +102,7 @@ li { grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; - padding: 7px 6px; + padding: 4px 6px; border-radius: 6px; cursor: pointer; } @@ -115,11 +122,28 @@ li.mover .swatch { border-radius: 3px; } .name { font-size: 13px; font-weight: 600; } .addr { color: var(--muted); font-size: 11px; } -#detail { margin-top: 16px; } +/* with a fixture open, or in a short window, collapse the list to swatches */ +aside:has(#detail:not([hidden])) ul { display: flex; flex-wrap: wrap; gap: 4px; } +aside:has(#detail:not([hidden])) li { display: block; padding: 3px; } +aside:has(#detail:not([hidden])) li .name, +aside:has(#detail:not([hidden])) li .addr { display: none; } + +@media (max-height: 760px) { + ul { display: flex; flex-wrap: wrap; gap: 4px; } + li { display: block; padding: 3px; } + li .name, li .addr { display: none; } +} + +#detail { + margin-top: 12px; + min-height: 0; + overflow: hidden; +} #channels { display: grid; - gap: 3px; + grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); + gap: 2px 10px; margin-top: 8px; } @@ -153,6 +177,6 @@ li.mover .swatch { border-radius: 3px; } } @media (max-width: 800px) { - main { grid-template-columns: 1fr; grid-template-rows: minmax(280px, 1fr) auto; } + main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; } aside { border-left: 0; border-top: 1px solid var(--line); max-height: 42vh; } }