oficina / base Public

Bring the Ask panel's composer closer to a phone's edges

On a phone the composer row has 8px side padding and 8px below it, plus
the safe-area insets; the conversation and header have 12px; the status
line lines up with the composer's edge. 44px targets stay. Desktop is
unchanged. TestMobile checks the composer's gaps (12px at most) and the
status line's alignment.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 0ad7840afde13a455072852923e22a72eaace2bc parent 44df83b
2 files changed, +12 −2
  • internal/browsertest/mobile_test.go +8 −0
  • internal/look/static/app.css +4 −2
diff --git a/internal/browsertest/mobile_test.go b/internal/browsertest/mobile_test.go
index f0ddec2..b7842b2 100644
--- a/internal/browsertest/mobile_test.go
+++ b/internal/browsertest/mobile_test.go
@@ -137,6 +137,13 @@ func TestMobile(t *testing.T) {
const r = el.getBoundingClientRect();
if (r.height < 44 || r.width < 44) problems.push(el.textContent.trim() + " is " + r.width + "x" + r.height);
}
+ const field = document.querySelector("#ask-panel textarea").getBoundingClientRect();
+ const send = document.querySelector("#ask-panel form.composer .btn").getBoundingClientRect();
+ if (field.left > 12 || vw - send.right > 12) problems.push("composer gaps " + field.left + " and " + (vw - send.right));
+ const st = document.querySelector("#ask-panel .ask-status");
+ st.textContent = "Equipo is answering…";
+ if (Math.abs(st.getBoundingClientRect().left - field.left) > 1) problems.push("status at " + st.getBoundingClientRect().left + ", composer at " + field.left);
+ st.textContent = "";
const m = document.querySelector("#ask-panel .msg.coordinator").getBoundingClientRect();
if (m.right > vw) problems.push("a message overflows");
return problems.join("; ");
@@ -144,6 +151,7 @@ func TestMobile(t *testing.T) {
t.Errorf("the panel on a phone: %s", got)
}
mobileShot(t, rig, "4-panel-conversation")
+ mobileShot(t, rig, "4c-panel-tight")
drive(t, rig, chromedp.KeyEvent("\u001b"),
chromedp.Poll[chromedp.Void](`!document.querySelector("#ask-panel").open`, chromedp.WithPollingTimeout(3*time.Second)))
// Focus goes back once the close event has run.
diff --git a/internal/look/static/app.css b/internal/look/static/app.css
index 8a8ebcc..af1b05b 100644
--- a/internal/look/static/app.css
+++ b/internal/look/static/app.css
@@ -250,9 +250,11 @@ main { min-height: 100dvh; }
.people li { flex-wrap: wrap; }
dialog.ask-panel { inset: auto 0 auto 0; top: var(--vv-top, 0); width: 100%; height: var(--vv-h, 100dvh); max-height: var(--vv-h, 100dvh);
border: 0; border-radius: 0; padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left); }
- dialog.ask-panel .ask-head { position: sticky; top: 0; padding: max(8px, env(safe-area-inset-top)) 8px 8px 16px; }
+ dialog.ask-panel .ask-head { position: sticky; top: 0; padding: max(8px, env(safe-area-inset-top)) 12px 8px; }
dialog.ask-panel .ask-head h2 { font-size: 18px; }
- dialog.ask-panel .composer { padding: 8px 12px max(12px, env(safe-area-inset-bottom)); }
+ dialog.ask-panel .composer { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
+ dialog.ask-panel .ask-foot { padding: 0 8px; }
+ dialog.ask-panel .ask-empty, dialog.ask-panel .ask-problem { padding: 0 12px 12px; }
.thread { padding: 14px 12px; }
.msg { max-width: 92%; }
.ask-page { min-height: calc(100dvh - 20px); }