Skip to content

AI-powered virtual executive team — a single coherent executive persona backed by 8 specialist agents (FastAPI + Next.js).

fix(ui): make the web app readable and usable on phones (#335)

Rufus3ff5f50d3982
diff --git a/packages/ui/scripts/sideNav.test.mjs b/packages/ui/scripts/sideNav.test.mjs
new file mode 100644
index 00000000..b1455266
--- /dev/null
+++ b/packages/ui/scripts/sideNav.test.mjs
@@ -0,0 +1,52 @@
+import assert from "node:assert/strict";
+import { readdirSync, readFileSync } from "node:fs";
+import test from "node:test";
+import { nextSideNavOpen } from "../src/lib/sideNav.ts";
+
+test("the bar button toggles the menu", () => {
+ assert.equal(nextSideNavOpen(false, { type: "toggle" }), true);
+ assert.equal(nextSideNavOpen(true, { type: "toggle" }), false);
+});
+
+test("tapping an item closes the menu, even the item already selected", () => {
+ assert.equal(nextSideNavOpen(true, { type: "menu-click", closesNav: true }), false);
+});
+
+test("other taps inside the menu keep it open", () => {
+ assert.equal(nextSideNavOpen(true, { type: "menu-click", closesNav: false }), true);
+});
+
+test("a tap on the page behind, Escape, or a new selection closes it", () => {
+ assert.equal(nextSideNavOpen(true, { type: "outside" }), false);
+ assert.equal(nextSideNavOpen(true, { type: "key", key: "Escape" }), false);
+ assert.equal(nextSideNavOpen(true, { type: "selection-changed" }), false);
+});
+
+test("other keys leave the menu as it is", () => {
+ assert.equal(nextSideNavOpen(true, { type: "key", key: "Tab" }), true);
+ assert.equal(nextSideNavOpen(false, { type: "key", key: "Escape" }), false);
+});
+
+// Every PageSideNav user marks its menu items, or re-tapping the current item
+// would leave the menu covering the page. Found by scanning src/, so a new
+// user is checked without editing this list; the menu items live in the file
+// itself or in the one component it hands them to.
+const MENU_ITEMS_IN = { "components/knowledge/KnowledgeWorkspace.tsx": "components/knowledge/SourceTree.tsx" };
+
+function sourceFiles(dir) {
+ return readdirSync(new URL(`../src/${dir}`, import.meta.url), { withFileTypes: true }).flatMap((e) =>
+ e.isDirectory() ? sourceFiles(`${dir}${e.name}/`) : /\.tsx$/.test(e.name) ? [`${dir}${e.name}`] : []
+ );
+}
+const read = (f) => readFileSync(new URL(`../src/${f}`, import.meta.url), "utf8");
+const users = sourceFiles("").filter((f) => f !== "components/shell/PageSideNav.tsx" && /<PageSideNav/.test(read(f)));
+
+test("PageSideNav users are found", () => {
+ assert.ok(users.length >= 4, `found ${users.join(", ")}`);
+});
+
+for (const user of users) {
+ test(`${user} marks its menu items data-closes-nav`, () => {
+ assert.match(read(MENU_ITEMS_IN[user] ?? user), /data-closes-nav/);
+ });
+}
diff --git a/packages/ui/src/app/architecture/page.tsx b/packages/ui/src/app/architecture/page.tsx
index 40889e03..11cfaee3 100644
--- a/packages/ui/src/app/architecture/page.tsx
+++ b/packages/ui/src/app/architecture/page.tsx
@@ -3,6 +3,7 @@
import { useEffect, useRef, useState } from 'react';
import DynamicSection from '@/components/architecture/DynamicSection';
+import PageSideNav from '@/components/shell/PageSideNav';
// The section nav is hardcoded so the sidebar renders instantly without
// waiting for the backend. IDs must match the SECTIONS registry in
@@ -108,8 +109,13 @@ export default function ArchitecturePage() {
const totalCount = SECTIONS.length;
return (
- <div className="flex flex-1 min-h-0 bg-surface text-fg overflow-hidden">
- <aside className="w-52 flex-shrink-0 border-r border-line flex flex-col bg-surface-elevated">
+ <div className="flex flex-col md:flex-row flex-1 min-h-0 bg-surface text-fg overflow-hidden">
+ <PageSideNav
+ label="Section"
+ current={SECTIONS.find((s) => s.id === activeSection)?.label}
+ closeKey={activeSection}
+ className="md:w-52 bg-surface-elevated"
+ >
<div className="px-3 py-4">
<p className="px-2 text-[10px] font-semibold uppercase tracking-widest text-fg-subtle mb-2">
Architecture
@@ -124,11 +130,12 @@ export default function ArchitecturePage() {
<a
key={id}
href={`#${id}`}
+ data-closes-nav
onClick={(e) => {
e.preventDefault();
document.getElementById(id)?.scrollIntoView({ behavior: 'smooth', block: 'start' });
}}
- className={`flex items-center gap-2 px-2 py-1.5 rounded-lg text-xs transition-colors ${
+ className={`flex items-center gap-2 px-2 py-2.5 md:py-1.5 rounded-lg text-sm md:text-xs transition-colors ${
activeSection === id
? 'bg-indigo-500/10 text-indigo-400'
: 'text-fg-muted hover:text-fg hover:bg-surface-overlay/60'
@@ -154,10 +161,10 @@ export default function ArchitecturePage() {
A map of how the running system is built — components, data flow, and the invariants that hold it together.
</p>
</div>
- </aside>
+ </PageSideNav>
- <main className="flex-1 overflow-y-auto">
- <div className="max-w-4xl mx-auto px-8 py-10 space-y-20">
+ <main className="flex-1 min-h-0 min-w-0 overflow-y-auto">
+ <div className="max-w-4xl mx-auto px-4 py-6 sm:px-8 sm:py-10 space-y-12 sm:space-y-20">
<div className="space-y-4">
<div>
<h1 className="text-2xl font-bold text-fg">Open Executive — Architecture</h1>
diff --git a/packages/ui/src/app/artifacts/[id]/page.tsx b/packages/ui/src/app/artifacts/[id]/page.tsx
index 121376ed..4bba80ac 100644
--- a/packages/ui/src/app/artifacts/[id]/page.tsx
+++ b/packages/ui/src/app/artifacts/[id]/page.tsx
@@ -109,7 +109,7 @@ export default function ArtifactDetailPage() {
return (
<div className="flex flex-col h-full bg-surface text-fg">
- <main className="flex-1 overflow-y-auto px-6 py-8">
+ <main className="flex-1 overflow-y-auto px-4 sm:px-6 py-8">
<div className="max-w-4xl mx-auto space-y-6">
<div className="flex items-start justify-between gap-4">
<div className="min-w-0">
diff --git a/packages/ui/src/app/artifacts/page.tsx b/packages/ui/src/app/artifacts/page.tsx
index 16fa9890..28c3aca7 100644
--- a/packages/ui/src/app/artifacts/page.tsx
+++ b/packages/ui/src/app/artifacts/page.tsx
@@ -336,7 +336,7 @@ export default function ArtifactsPage() {
return (
<div className="flex flex-col h-full bg-surface text-fg">
- <main className="flex-1 overflow-y-auto px-6 py-8">
+ <main className="flex-1 overflow-y-auto px-4 sm:px-6 py-8">
<div className="max-w-5xl mx-auto">
<div className="mb-6">
<h1 className="text-2xl font-semibold text-fg mb-1">
diff --git a/packages/ui/src/app/audit/page.tsx b/packages/ui/src/app/audit/page.tsx
index f8a9d1e3..fb1ca3f6 100644
--- a/packages/ui/src/app/audit/page.tsx
+++ b/packages/ui/src/app/audit/page.tsx
@@ -445,7 +445,7 @@ function AuditPageInner() {
return (
<div className="flex flex-col h-full bg-surface text-fg">
<main className="flex-1 overflow-y-auto">
- <div className="max-w-6xl mx-auto px-6 py-6">
+ <div className="max-w-6xl mx-auto px-4 sm:px-6 py-6">
<div className="grid grid-cols-1 md:grid-cols-5 gap-3 mb-4">
<input
type="search"
@@ -663,7 +663,7 @@ function AuditPageInner() {
onClick={() => setExpandedId(isOpen ? null : evt.id)}
className="w-full flex items-center gap-3 px-3 py-1.5 hover:bg-surface-elevated/60 text-left"
>
- <span className="font-mono text-[10px] text-fg-muted whitespace-nowrap w-[7ch]">
+ <span className="font-mono text-[10px] text-fg-muted whitespace-nowrap flex-shrink-0 min-w-[11ch]">
{formatTimeOnly(evt.ts)}
</span>
<span
diff --git a/packages/ui/src/app/audit/usage/page.tsx b/packages/ui/src/app/audit/usage/page.tsx
index 0adb6bce..044cf72a 100644
--- a/packages/ui/src/app/audit/usage/page.tsx
+++ b/packages/ui/src/app/audit/usage/page.tsx
@@ -118,7 +118,7 @@ export default function TokenUsagePage() {
return (
<div className="flex flex-col h-full bg-surface text-fg">
<main className="flex-1 overflow-y-auto">
- <div className="max-w-6xl mx-auto px-6 py-6">
+ <div className="max-w-6xl mx-auto px-4 sm:px-6 py-6">
<div className="flex items-center justify-between gap-4">
<h1 className="text-xl font-semibold text-fg">Token usage</h1>
<Link
diff --git a/packages/ui/src/app/company-profile/page.tsx b/packages/ui/src/app/company-profile/page.tsx
index 336c91de..400c5340 100644
--- a/packages/ui/src/app/company-profile/page.tsx
+++ b/packages/ui/src/app/company-profile/page.tsx
@@ -127,7 +127,7 @@ export default function CompanyProfilePage() {
return (
<div className="flex flex-col h-full bg-surface">
<main className="flex-1 overflow-y-auto">
- <div className="max-w-3xl mx-auto px-6 py-10">
+ <div className="max-w-3xl mx-auto px-4 py-6 sm:px-6 sm:py-10">
{loading && (
<div className="flex items-center justify-center h-40">
@@ -136,9 +136,9 @@ export default function CompanyProfilePage() {
)}
{notFound && (
- <div className="bg-indigo-500/10 border border-indigo-500/20 rounded-xl px-5 py-4 flex items-center justify-between">
+ <div className="bg-indigo-500/10 border border-indigo-500/20 rounded-xl px-5 py-4 flex flex-col sm:flex-row sm:items-center justify-between gap-2">
<p className="text-sm text-fg">{copy.missing}</p>
- <Link href="/onboard" className="text-xs text-indigo-400 hover:text-indigo-300 font-medium transition-colors">
+ <Link href="/onboard" className="flex-shrink-0 text-xs text-indigo-400 hover:text-indigo-300 font-medium transition-colors">
Complete setup →
</Link>
</div>
diff --git a/packages/ui/src/app/council/page.tsx b/packages/ui/src/app/council/page.tsx
index d409f834..4b114dd3 100644
--- a/packages/ui/src/app/council/page.tsx
+++ b/packages/ui/src/app/council/page.tsx
@@ -29,6 +29,7 @@ import {
testAgent,
} from "@/lib/api";
import VoicePicker from "@/components/executive/VoicePicker";
+import PageSideNav from "@/components/shell/PageSideNav";
interface DraftState {
role: string;
@@ -424,8 +425,13 @@ export default function CouncilPage() {
};
return (
- <div className="flex flex-1 min-h-0 bg-surface text-fg overflow-hidden">
- <aside className="w-64 flex-shrink-0 border-r border-line flex flex-col bg-surface-elevated">
+ <div className="flex flex-col md:flex-row flex-1 min-h-0 bg-surface text-fg overflow-hidden">
+ <PageSideNav
+ label="Agent"
+ current={listedAgents.find((a) => a.name === selected)?.role}
+ closeKey={selected ?? ""}
+ className="md:w-64 bg-surface-elevated"
+ >
<div className="px-3 py-4 overflow-y-auto">
<p className="px-2 text-[10px] font-semibold uppercase tracking-widest text-fg-subtle mb-2">
Agent Council
@@ -434,8 +440,9 @@ export default function CouncilPage() {
{listedAgents.map((a) => (
<button
key={a.name}
+ data-closes-nav
onClick={() => setSelected(a.name)}
- className={`w-full text-left flex items-start gap-2 px-2 py-1.5 rounded-lg text-xs transition-colors ${
+ className={`w-full text-left flex items-start gap-2 px-2 py-2 md:py-1.5 rounded-lg text-sm md:text-xs transition-colors ${
selected === a.name
? "bg-indigo-500/10 text-indigo-300"
: "text-fg-muted hover:text-fg hover:bg-surface-overlay/60"
@@ -473,10 +480,10 @@ export default function CouncilPage() {
</button>
)}
</div>
- </aside>
+ </PageSideNav>
- <main className="flex-1 overflow-y-auto">
- <div className="max-w-4xl mx-auto px-8 py-10 space-y-6">
+ <main className="flex-1 min-h-0 min-w-0 overflow-y-auto">
+ <div className="max-w-4xl mx-auto px-4 py-6 sm:px-8 sm:py-10 space-y-6">
<div>
<div className="flex items-start justify-between gap-4">
<h1 className="text-2xl font-bold text-fg">Agent Council</h1>
diff --git a/packages/ui/src/app/demo/page.tsx b/packages/ui/src/app/demo/page.tsx
index f4213080..6618c7be 100644
--- a/packages/ui/src/app/demo/page.tsx
+++ b/packages/ui/src/app/demo/page.tsx
@@ -481,7 +481,7 @@ export default function DemoPage() {
{/* Snapshot CTA when no fixture is active */}
{!loading && !status.active_fixture && !error && fixtures.length > 0 && (
<div className="mb-5 rounded-xl border border-line bg-surface-elevated px-4 py-3 flex items-center justify-between gap-3 flex-wrap">
- <p className="text-xs text-fg-muted flex-1 min-w-0">
+ <p className="text-xs text-fg-muted flex-1 basis-56">
{status.has_snapshot ? (
<>Snapshot of your company exists. Loading a fixture will replace state; unload restores from the snapshot.</>
) : (
diff --git a/packages/ui/src/app/departments/[slug]/page.tsx b/packages/ui/src/app/departments/[slug]/page.tsx
index 1ea05b7c..e940b8f6 100644
--- a/packages/ui/src/app/departments/[slug]/page.tsx
+++ b/packages/ui/src/app/departments/[slug]/page.tsx
@@ -229,7 +229,7 @@ export default function DepartmentDetailPage() {
return (
<div className="flex flex-col h-full bg-surface">
<main className="flex-1 overflow-y-auto">
- <div className="max-w-3xl mx-auto px-6 py-6">
+ <div className="max-w-3xl mx-auto px-4 sm:px-6 py-6">
{loading && <p className="text-fg-muted text-sm">Loading…</p>}
{error && (
<div className="p-3 rounded-lg bg-rose-500/10 border border-rose-500/30 text-rose-300 text-sm">
diff --git a/packages/ui/src/app/departments/page.tsx b/packages/ui/src/app/departments/page.tsx
index 83114e16..a9836cbb 100644
--- a/packages/ui/src/app/departments/page.tsx
+++ b/packages/ui/src/app/departments/page.tsx
@@ -127,7 +127,7 @@ export default function DepartmentsPage() {
return (
<div className="flex flex-col h-full bg-surface">
<main className="flex-1 overflow-y-auto">
- <div className="max-w-5xl mx-auto px-6 py-6">
+ <div className="max-w-5xl mx-auto px-4 sm:px-6 py-6">
<div className="flex items-center justify-between mb-1">
<h1 className="text-xl font-semibold text-fg">Departments</h1>
<button
diff --git a/packages/ui/src/app/globals.css b/packages/ui/src/app/globals.css
index 150140c2..2094b327 100644
--- a/packages/ui/src/app/globals.css
+++ b/packages/ui/src/app/globals.css
@@ -107,3 +107,29 @@
scroll-behavior: auto !important;
}
}
+
+/* Phones. Many labels, badges and timestamps are sized 9 to 11px for dense
+ * desktop panels; on a phone screen that is too small to read, so the floor
+ * is 12px there. Form fields go to 16px, the size below which iOS Safari
+ * zooms the page in whenever one is tapped. Markdown tables scroll sideways
+ * inside their own box instead of pushing the page wider than the screen.
+ * Unlayered on purpose, so these win over Tailwind's utility layer. */
+@media (max-width: 639.98px) {
+ .text-\[9px\],
+ .text-\[10px\],
+ .text-\[11px\] {
+ font-size: 12px;
+ }
+
+ input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
+ textarea,
+ select {
+ font-size: 16px;
+ }
+
+ .prose table {
+ display: block;
+ max-width: 100%;
+ overflow-x: auto;
+ }
+}
diff --git a/packages/ui/src/app/guide/page.tsx b/packages/ui/src/app/guide/page.tsx
index a5b70da9..a6e3fa10 100644
--- a/packages/ui/src/app/guide/page.tsx
+++ b/packages/ui/src/app/guide/page.tsx
@@ -3,6 +3,7 @@
import { useEffect, useRef, useState } from 'react';
import DynamicSection from '@/components/architecture/DynamicSection';
+import PageSideNav from '@/components/shell/PageSideNav';
// The section nav is hardcoded so the sidebar renders instantly without
// waiting for the backend. IDs must match the GUIDE_SECTIONS registry in
@@ -72,8 +73,13 @@ export default function GuidePage() {
const totalCount = SECTIONS.length;
return (
- <div className="flex flex-1 min-h-0 bg-surface text-fg overflow-hidden">
- <aside className="w-52 flex-shrink-0 border-r border-line flex flex-col bg-surface-elevated">
+ <div className="flex flex-col md:flex-row flex-1 min-h-0 bg-surface text-fg overflow-hidden">
+ <PageSideNav
+ label="Section"
+ current={SECTIONS.find((s) => s.id === activeSection)?.label}
+ closeKey={activeSection}
+ className="md:w-52 bg-surface-elevated"
+ >
<div className="px-3 py-4">
<p className="px-2 text-[10px] font-semibold uppercase tracking-widest text-fg-subtle mb-2">
User Guide
@@ -86,11 +92,12 @@ export default function GuidePage() {
<a
key={id}
href={`#${id}`}
+ data-closes-nav
onClick={(e) => {
e.preventDefault();
document.getElementById(id)?.scrollIntoView({ behavior: 'smooth', block: 'start' });
}}
- className={`flex items-center gap-2 px-2 py-1.5 rounded-lg text-xs transition-colors ${
+ className={`flex items-center gap-2 px-2 py-2.5 md:py-1.5 rounded-lg text-sm md:text-xs transition-colors ${
activeSection === id
? 'bg-indigo-500/10 text-indigo-400'
: 'text-fg-muted hover:text-fg hover:bg-surface-overlay/60'
@@ -117,10 +124,10 @@ export default function GuidePage() {
built, see the Architecture reference.
</p>
</div>
- </aside>
+ </PageSideNav>
- <main className="flex-1 overflow-y-auto">
- <div className="max-w-4xl mx-auto px-8 py-10 space-y-20">
+ <main className="flex-1 min-h-0 min-w-0 overflow-y-auto">
+ <div className="max-w-4xl mx-auto px-4 py-6 sm:px-8 sm:py-10 space-y-12 sm:space-y-20">
<div>
<h1 className="text-2xl font-bold text-fg">Open Executive — User Guide</h1>
<p className="mt-2 text-sm text-fg-muted">
diff --git a/packages/ui/src/app/jobs/[name]/page.tsx b/packages/ui/src/app/jobs/[name]/page.tsx
index 5ffb0c96..8ffbb2c6 100644
--- a/packages/ui/src/app/jobs/[name]/page.tsx
+++ b/packages/ui/src/app/jobs/[name]/page.tsx
@@ -231,7 +231,7 @@ export default function JobDetailPage() {
return (
<div className="flex flex-col h-full bg-surface text-fg">
- <main className="flex-1 overflow-y-auto px-6 py-8">
+ <main className="flex-1 overflow-y-auto px-4 sm:px-6 py-8">
<div className="max-w-3xl mx-auto space-y-8">
<div>
<h1 className="text-2xl font-semibold text-fg mb-1">
diff --git a/packages/ui/src/app/jobs/new/page.tsx b/packages/ui/src/app/jobs/new/page.tsx
index fb798ee6..38b7e6b9 100644
--- a/packages/ui/src/app/jobs/new/page.tsx
+++ b/packages/ui/src/app/jobs/new/page.tsx
@@ -945,7 +945,7 @@ function AdvancedBuilderPage() {
const editing = !!searchParams.get("edit");
return (
<div className="flex flex-col h-full bg-surface text-fg">
- <main className="flex-1 overflow-y-auto px-6 py-8">
+ <main className="flex-1 overflow-y-auto px-4 sm:px-6 py-8">
<div className="max-w-3xl mx-auto">
<div className="mb-6">
<Link href="/jobs" className="text-xs text-fg-muted hover:text-fg">
diff --git a/packages/ui/src/app/jobs/page.tsx b/packages/ui/src/app/jobs/page.tsx
index 03d7d379..2675b910 100644
--- a/packages/ui/src/app/jobs/page.tsx
+++ b/packages/ui/src/app/jobs/page.tsx
@@ -900,7 +900,7 @@ function StatusSegment({
export default function JobsPage() {
return (
<div className="flex flex-col h-full bg-surface text-fg">
- <main className="flex-1 overflow-y-auto px-6 py-6">
+ <main className="flex-1 overflow-y-auto px-4 sm:px-6 py-6">
<div className="max-w-6xl mx-auto">
<div className="mb-4 flex items-start justify-between gap-4">
<div className="min-w-0">
diff --git a/packages/ui/src/app/jobs/runs/[id]/page.tsx b/packages/ui/src/app/jobs/runs/[id]/page.tsx
index 1965943a..dd664d06 100644
--- a/packages/ui/src/app/jobs/runs/[id]/page.tsx
+++ b/packages/ui/src/app/jobs/runs/[id]/page.tsx
@@ -139,7 +139,7 @@ export default function RunDetailPage() {
return (
<div className="flex flex-col h-full bg-surface text-fg">
- <main className="flex-1 overflow-y-auto px-6 py-8">
+ <main className="flex-1 overflow-y-auto px-4 sm:px-6 py-8">
<div className="max-w-4xl mx-auto space-y-6">
<div className="flex items-start justify-between gap-4">
<div className="min-w-0">
diff --git a/packages/ui/src/app/layout.tsx b/packages/ui/src/app/layout.tsx
index 355c282d..6efd972b 100644
--- a/packages/ui/src/app/layout.tsx
+++ b/packages/ui/src/app/layout.tsx
@@ -1,4 +1,4 @@
-import type { Metadata } from "next";
+import type { Metadata, Viewport } from "next";
import AuthProvider from "@/components/AuthProvider";
import { ExecutiveStatusProvider } from "@/components/executive/ExecutiveStatusContext";
import { SessionsProvider } from "@/components/sessions/SessionsContext";
@@ -11,6 +11,15 @@ export const metadata: Metadata = {
description: "Your AI-powered virtual executive team",
};
+// `viewport-fit=cover` lets the page reach under the iPhone notch and home
+// indicator; the mobile bottom bar pads itself by the safe-area inset so its
+// buttons stay clear of the indicator.
+export const viewport: Viewport = {
+ width: "device-width",
+ initialScale: 1,
+ viewportFit: "cover",
+};
+
export default function RootLayout({
children,
}: {
diff --git a/packages/ui/src/app/onboard/page.tsx b/packages/ui/src/app/onboard/page.tsx
index 9a1cdc04..80a788ae 100644
--- a/packages/ui/src/app/onboard/page.tsx
+++ b/packages/ui/src/app/onboard/page.tsx
@@ -108,7 +108,7 @@ function OnboardFlow() {
if (turn?.phase === "draft") {
return (
- <div className="max-w-3xl mx-auto px-6 py-10 w-full">
+ <div className="max-w-3xl mx-auto px-4 sm:px-6 py-10 w-full">
<OnboardDraftReview
turn={turn}
onBackToConversation={() => {
@@ -124,7 +124,7 @@ function OnboardFlow() {
}
return (
- <div className="max-w-2xl mx-auto px-6 py-16 w-full">
+ <div className="max-w-2xl mx-auto px-4 sm:px-6 py-16 w-full">
<div className="mb-8">
<h1 className="text-xl font-semibold text-fg">Set up your Executive</h1>
<p className="text-sm text-fg-muted mt-1">
@@ -230,7 +230,7 @@ function WorkspaceChoice({ onChosen }: { onChosen: (mode: WorkspaceMode) => void
);
return (
- <div className="max-w-2xl mx-auto px-6 py-16 w-full">
+ <div className="max-w-2xl mx-auto px-4 sm:px-6 py-16 w-full">
<h1 className="text-xl font-semibold text-fg">Who is Open Executive for?</h1>
<p className="text-sm text-fg-muted mt-1">
Your answer decides what setup asks and what you see afterwards. You can change it
@@ -301,7 +301,7 @@ function RoleStep({ onDone }: { onDone: () => void }) {
}
return (
- <div className="max-w-2xl mx-auto px-6 py-16 w-full">
+ <div className="max-w-2xl mx-auto px-4 sm:px-6 py-16 w-full">
<h1 className="text-xl font-semibold text-fg">What&apos;s your role?</h1>
<p className="text-sm text-fg-muted mt-1">
So setup asks the right questions and the advice fits your job — a case to put to your
@@ -347,7 +347,7 @@ function RoleStep({ onDone }: { onDone: () => void }) {
// /agents/executive); skipping keeps Direct. Settings → Executive changes it.
function VoiceStep({ onDone }: { onDone: () => void }) {
return (
- <div className="max-w-3xl mx-auto px-6 py-16 w-full">
+ <div className="max-w-3xl mx-auto px-4 sm:px-6 py-16 w-full">
<h1 className="text-xl font-semibold text-fg">How should your Executive sound?</h1>
<p className="text-sm text-fg-muted mt-1">
The advice is the same; this sets the tone it comes in. You can change it later in
diff --git a/packages/ui/src/app/people/[id]/page.tsx b/packages/ui/src/app/people/[id]/page.tsx
index 8d80319b..251e9af9 100644
--- a/packages/ui/src/app/people/[id]/page.tsx
+++ b/packages/ui/src/app/people/[id]/page.tsx
@@ -701,7 +701,7 @@ export default function PersonDetailPage() {
<div className="flex flex-col h-full bg-surface">
{offerFor && <TeamModeOffer name={offerFor} onDone={() => setOfferFor(null)} />}
<main className="flex-1 overflow-y-auto">
- <div className="max-w-2xl mx-auto px-6 py-6">
+ <div className="max-w-2xl mx-auto px-4 sm:px-6 py-6">
{loading && <p className="text-fg-muted text-sm">Loading…</p>}
{error && (
<div className="p-3 rounded-lg bg-rose-500/10 border border-rose-500/30 text-rose-300 text-sm">
diff --git a/packages/ui/src/app/people/page.tsx b/packages/ui/src/app/people/page.tsx
index f339452d..bb3aea19 100644
--- a/packages/ui/src/app/people/page.tsx
+++ b/packages/ui/src/app/people/page.tsx
@@ -629,7 +629,7 @@ export default function PeoplePage() {
)}
{offerFor && <TeamModeOffer name={offerFor} onDone={() => setOfferFor(null)} />}
<main className="flex-1 overflow-y-auto">
- <div className="max-w-5xl mx-auto px-6 py-6">
+ <div className="max-w-5xl mx-auto px-4 sm:px-6 py-6">
<div className="flex items-baseline justify-between mb-4">
<div>
<h1 className="text-xl font-semibold text-fg">People</h1>
diff --git a/packages/ui/src/app/watchlist/[slug]/page.tsx b/packages/ui/src/app/watchlist/[slug]/page.tsx
index 2ddea65e..2a58dd2c 100644
--- a/packages/ui/src/app/watchlist/[slug]/page.tsx
+++ b/packages/ui/src/app/watchlist/[slug]/page.tsx
@@ -200,7 +200,7 @@ export default function WatchDetailPage() {
return (
<div className="flex flex-col h-full bg-surface">
<main className="flex-1 overflow-y-auto">
- <div className="max-w-3xl mx-auto px-6 py-6">
+ <div className="max-w-3xl mx-auto px-4 sm:px-6 py-6">
<Link
href="/watchlist"
className="text-xs text-indigo-300 hover:text-indigo-200 inline-block mb-4"
diff --git a/packages/ui/src/app/watchlist/page.tsx b/packages/ui/src/app/watchlist/page.tsx
index 52ab6980..aa1cb147 100644
--- a/packages/ui/src/app/watchlist/page.tsx
+++ b/packages/ui/src/app/watchlist/page.tsx
@@ -658,8 +658,8 @@ export default function WatchlistPage() {
/>
)}
<main className="flex-1 overflow-y-auto">
- <div className="max-w-5xl mx-auto px-6 py-6">
- <div className="flex items-baseline justify-between mb-6">
+ <div className="max-w-5xl mx-auto px-4 sm:px-6 py-6">
+ <div className="flex flex-col sm:flex-row sm:items-baseline justify-between gap-3 mb-6">
<div>
<h1 className="text-xl font-semibold text-fg">Watch list</h1>
<p className="text-sm text-fg-muted mt-0.5">
@@ -669,7 +669,7 @@ export default function WatchlistPage() {
</div>
<button
onClick={() => setShowAdd(true)}
- className="flex-shrink-0 px-4 py-2 text-sm rounded-lg bg-indigo-600 hover:bg-indigo-500 text-white font-medium"
+ className="self-start flex-shrink-0 px-4 py-2 text-sm rounded-lg bg-indigo-600 hover:bg-indigo-500 text-white font-medium"
>
+ Add monitor
</button>
diff --git a/packages/ui/src/components/Briefing.tsx b/packages/ui/src/components/Briefing.tsx
index a711097b..7a788393 100644
--- a/packages/ui/src/components/Briefing.tsx
+++ b/packages/ui/src/components/Briefing.tsx
@@ -2213,7 +2213,7 @@ export default function Briefing({ onContinue, showHeader = false, firstName }:
return (
<div className="flex flex-col h-full bg-surface">
<main className="flex-1 overflow-y-auto">
- <div className="max-w-6xl mx-auto px-6 py-6">
+ <div className="max-w-6xl mx-auto px-4 sm:px-6 py-6">
<div className="flex items-baseline gap-3 mb-3">
<h1 className="text-xl font-semibold text-fg">
{showHeader
diff --git a/packages/ui/src/components/Chat.tsx b/packages/ui/src/components/Chat.tsx
index 5867b032..59e98c6e 100644
--- a/packages/ui/src/components/Chat.tsx
+++ b/packages/ui/src/components/Chat.tsx
@@ -620,7 +620,7 @@ export default function Chat({ onDebugEvent, initialMessages, initialSessionId,
{fileError}
</p>
)}
- <div className="relative flex items-end gap-2 sm:gap-3 bg-surface-overlay/50 border border-line-strong rounded-2xl px-3 sm:px-4 py-3 focus-within:border-fg-muted transition-colors">
+ <div className="relative flex items-end gap-1.5 sm:gap-3 bg-surface-overlay/50 border border-line-strong rounded-2xl px-2 sm:px-4 py-2 sm:py-3 focus-within:border-fg-muted transition-colors">
<input
ref={fileInputRef}
type="file"
@@ -691,15 +691,19 @@ export default function Chat({ onDebugEvent, initialMessages, initialSessionId,
disabled={isLoading}
title="Committee review: slower, higher-quality response — adversarial review pass before sending"
aria-pressed={committeeEnabled}
+ aria-label="Committee review"
className={
- "flex-shrink-0 min-h-touch px-3 rounded-xl text-xs font-medium transition-all duration-150 border cursor-pointer " +
+ "flex-shrink-0 min-h-touch min-w-touch sm:px-3 flex items-center justify-center rounded-xl text-xs font-medium transition-all duration-150 border cursor-pointer " +
(committeeEnabled
? "bg-indigo-500/15 border-indigo-500/60 text-indigo-300 hover:bg-indigo-500/20"
: "bg-surface-overlay border-line-strong text-fg-muted hover:text-fg hover:border-line-strong") +
" disabled:opacity-30 disabled:cursor-not-allowed"
}
>
- Committee
+ {/* An icon on phones, where the word would take most of the
+ row the message box needs. */}
+ <Icon name="users" size="w-4 h-4" className="sm:hidden" />
+ <span className="hidden sm:inline">Committee</span>
</button>
{isLoading ? (
<button
diff --git a/packages/ui/src/components/Message.tsx b/packages/ui/src/components/Message.tsx
index c5e47bc3..20dff56e 100644
--- a/packages/ui/src/components/Message.tsx
+++ b/packages/ui/src/components/Message.tsx
@@ -130,8 +130,9 @@ export default function Message({
return (
<div className="flex gap-3 sm:gap-4 mb-8">
- {/* Avatar */}
- <div className="flex-shrink-0 mt-1">
+ {/* Avatar. Hidden on phones, where its column would take an eighth of
+ the width the answer needs. */}
+ <div className="hidden sm:block flex-shrink-0 mt-1">
<BrandMark size="md" />
</div>
@@ -140,7 +141,7 @@ export default function Message({
<div className="text-xs text-fg-muted mb-2 font-medium tracking-wide uppercase">Executive</div>
<div className="prose prose-invert prose-sm max-w-none
prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded prose-code:text-xs prose-code:bg-surface-overlay prose-code:before:content-none prose-code:after:content-none
- prose-pre:bg-surface-overlay prose-pre:border
+ prose-pre:bg-surface-overlay prose-pre:text-fg prose-pre:border
prose-a:text-accent prose-a:no-underline hover:prose-a:underline">
<ReactMarkdown
remarkPlugins={[remarkGfm]}
diff --git a/packages/ui/src/components/OnboardWizard.tsx b/packages/ui/src/components/OnboardWizard.tsx
index c2824819..81860191 100644
--- a/packages/ui/src/components/OnboardWizard.tsx
+++ b/packages/ui/src/components/OnboardWizard.tsx
@@ -107,7 +107,7 @@ export default function OnboardWizard({ onComplete }: OnboardWizardProps) {
const isOptionalStep = status.optional ?? status.current_step >= 6;
return (
- <div className="flex flex-col h-full max-w-2xl mx-auto px-6 py-10">
+ <div className="flex flex-col h-full max-w-2xl mx-auto px-4 sm:px-6 py-10">
{/* Progress */}
<div className="mb-10">
<div className="flex justify-between text-xs text-fg-muted mb-2.5 font-medium">
diff --git a/packages/ui/src/components/jobs/WorkflowWizard.tsx b/packages/ui/src/components/jobs/WorkflowWizard.tsx
index 308217ca..d1aaa250 100644
--- a/packages/ui/src/components/jobs/WorkflowWizard.tsx
+++ b/packages/ui/src/components/jobs/WorkflowWizard.tsx
@@ -157,7 +157,7 @@ export default function WorkflowWizard() {
return (
<div className="flex flex-col h-full min-h-0">
- <div className="flex-1 min-h-0 overflow-y-auto px-6 py-6">
+ <div className="flex-1 min-h-0 overflow-y-auto px-4 sm:px-6 py-6">
<div className="max-w-3xl mx-auto space-y-4">
{!started && (
<div className="space-y-3">
diff --git a/packages/ui/src/components/knowledge/CompanyPanel.tsx b/packages/ui/src/components/knowledge/CompanyPanel.tsx
index c8230c45..3c447075 100644
--- a/packages/ui/src/components/knowledge/CompanyPanel.tsx
+++ b/packages/ui/src/components/knowledge/CompanyPanel.tsx
@@ -217,7 +217,7 @@ export default function CompanyPanel({ onCountChange }: CompanyPanelProps) {
return (
<div className="space-y-5 max-w-3xl">
- <div className="flex items-start justify-between gap-4">
+ <div className="flex flex-col sm:flex-row sm:items-start justify-between gap-3 sm:gap-4">
<div>
<h1 className="text-lg font-semibold text-fg">Company documents</h1>
<p className="text-sm text-fg-muted mt-1">
@@ -225,7 +225,7 @@ export default function CompanyPanel({ onCountChange }: CompanyPanelProps) {
company.
</p>
</div>
- <label className="flex-shrink-0 cursor-pointer inline-flex items-center gap-1.5 px-3.5 py-2 rounded-lg bg-indigo-500 hover:bg-indigo-400 text-white text-sm font-medium transition-colors">
+ <label className="self-start flex-shrink-0 cursor-pointer inline-flex items-center gap-1.5 px-3.5 py-2 rounded-lg bg-indigo-500 hover:bg-indigo-400 text-white text-sm font-medium transition-colors">
<Icon name="plus" size="w-4 h-4" />
Add documents
<input
diff --git a/packages/ui/src/components/knowledge/KnowledgeWorkspace.tsx b/packages/ui/src/components/knowledge/KnowledgeWorkspace.tsx
index 82f2df98..85349187 100644
--- a/packages/ui/src/components/knowledge/KnowledgeWorkspace.tsx
+++ b/packages/ui/src/components/knowledge/KnowledgeWorkspace.tsx
@@ -22,6 +22,7 @@ import {
type ReviewStatus,
} from "@/lib/api";
import ReviewQueue from "@/components/ReviewQueue";
+import PageSideNav from "@/components/shell/PageSideNav";
import CompanyPanel from "./CompanyPanel";
import FileEditor from "./FileEditor";
import NewFileForm from "./NewFileForm";
@@ -29,6 +30,26 @@ import QueryPanel from "./QueryPanel";
import ReferencePanel from "./ReferencePanel";
import SourceTree, { type FileKind, type Selection } from "./SourceTree";
+// What the phone bar above the source tree names as open.
+function selectionLabel(selection: Selection): string | undefined {
+ switch (selection?.kind) {
+ case "file":
+ return selection.filename;
+ case "new":
+ return "New file";
+ case "company":
+ return "Company documents";
+ case "reference":
+ return "Reference library";
+ case "query":
+ return "Query mode";
+ case "review":
+ return "Review queue";
+ default:
+ return undefined;
+ }
+}
+
const DOMAINS = [
"board",
"finance",
@@ -212,8 +233,13 @@ export default function KnowledgeWorkspace() {
);
return (
- <div className="flex h-full">
- <aside className="w-64 flex-shrink-0 border-r border-line bg-surface/40 px-4 py-5 overflow-y-auto">
+ <div className="flex flex-col md:flex-row h-full">
+ <PageSideNav
+ label="Showing"
+ current={selectionLabel(selection)}
+ closeKey={JSON.stringify(selection)}
+ className="md:w-64 bg-surface-elevated md:bg-surface/40 px-4 py-5"
+ >
<SourceTree
domains={DOMAINS}
builtinFiles={builtinFiles}
@@ -225,9 +251,9 @@ export default function KnowledgeWorkspace() {
companyCount={companyCount}
onSelect={setSelection}
/>
- </aside>
+ </PageSideNav>
- <main className="flex-1 min-w-0 overflow-y-auto px-8 py-6">
+ <main className="flex-1 min-h-0 min-w-0 overflow-y-auto px-4 py-5 sm:px-8 sm:py-6">
{error && (
<div className="mb-4 text-xs text-red-400 bg-red-500/10 border border-red-500/20 rounded-lg px-3 py-2">
{error}
diff --git a/packages/ui/src/components/knowledge/SourceTree.tsx b/packages/ui/src/components/knowledge/SourceTree.tsx
index 837664ef..d23f6224 100644
--- a/packages/ui/src/components/knowledge/SourceTree.tsx
+++ b/packages/ui/src/components/knowledge/SourceTree.tsx
@@ -83,6 +83,7 @@ export default function SourceTree({
return (
<nav className="text-sm space-y-4">
<button
+ data-closes-nav
onClick={() => onSelect({ kind: "company" })}
className={`w-full flex items-center gap-2 text-left px-2.5 py-2 rounded-lg text-sm font-semibold transition-colors ${
selection?.kind === "company"
@@ -276,6 +277,7 @@ function FileGroup({
{label}
</span>
<button
+ data-closes-nav
onClick={onAdd}
className="text-[10px] text-fg-subtle hover:text-fg transition-colors px-1"
title={`Add ${label.toLowerCase()} file`}
@@ -292,6 +294,7 @@ function FileGroup({
return (
<button
key={f.filename}
+ data-closes-nav
onClick={() => onClickFile(f)}
className={`w-full text-left px-2 py-0.5 rounded text-xs transition-colors truncate ${
active
@@ -329,6 +332,7 @@ function RootButton({
const activeClass = accent === "indigo" ? "bg-indigo-500/15 text-indigo-200" : "bg-surface-input text-fg";
return (
<button
+ data-closes-nav
onClick={onClick}
className={`w-full flex items-center gap-2 text-left px-2 py-1.5 rounded-lg text-xs font-bold uppercase tracking-widest transition-colors ${
active ? activeClass : "text-fg hover:text-white hover:bg-surface-overlay"
diff --git a/packages/ui/src/components/memories/PulsePage.tsx b/packages/ui/src/components/memories/PulsePage.tsx
index 285a315c..321719e8 100644
--- a/packages/ui/src/components/memories/PulsePage.tsx
+++ b/packages/ui/src/components/memories/PulsePage.tsx
@@ -16,7 +16,7 @@ import PulseHeader from "./PulseHeader";
export default function PulsePage() {
return (
- <div className="max-w-6xl mx-auto px-6 py-8 space-y-10">
+ <div className="max-w-6xl mx-auto px-4 sm:px-6 py-8 space-y-10">
<PulseHeader />
{/* `min-w-0` on each grid child: fr tracks default to min-width:auto, so
diff --git a/packages/ui/src/components/shell/AppShell.tsx b/packages/ui/src/components/shell/AppShell.tsx
index 6c39110a..84ae7c1a 100644
--- a/packages/ui/src/components/shell/AppShell.tsx
+++ b/packages/ui/src/components/shell/AppShell.tsx
@@ -239,7 +239,7 @@ export function MobileBottomNav({
return (
<nav
aria-label="Primary"
- className={`${hideClass} h-16 border-t border-line bg-surface-elevated flex items-stretch flex-shrink-0`}
+ className={`${hideClass} h-[calc(4rem+env(safe-area-inset-bottom))] pb-[env(safe-area-inset-bottom)] border-t border-line bg-surface-elevated flex items-stretch flex-shrink-0`}
>
{buildMobilePrimary(mode).map((item) => {
const active = isNavActive(item.href, pathname);
diff --git a/packages/ui/src/components/shell/PageSideNav.tsx b/packages/ui/src/components/shell/PageSideNav.tsx
new file mode 100644
index 00000000..e9d9265c
--- /dev/null
+++ b/packages/ui/src/components/shell/PageSideNav.tsx
@@ -0,0 +1,94 @@
+"use client";
+
+import { useEffect, useId, useState } from "react";
+
+import Icon from "@/components/Icon";
+import { nextSideNavOpen, type SideNavEvent } from "@/lib/sideNav";
+
+// A page's own side menu (the section list on the Guide, the agent list on
+// the Agent Council, the source tree in the Knowledge base). From `md` up it
+// is a fixed-width column beside the page. Below `md` a full column would
+// squeeze the page into a strip a few words wide, so it folds into a bar at
+// the top that opens the same menu over the page and closes again once the
+// selection changes, or when an item marked `data-closes-nav` is tapped
+// (re-tapping the current item changes nothing, so the key alone misses it).
+//
+// The children render once, in one place, at every width, so element ids and
+// observers inside them behave the same on phones and desktops. The parent
+// must stack on phones and sit side by side from `md`
+// (`flex flex-col md:flex-row`).
+export default function PageSideNav({
+ label,
+ current,
+ closeKey,
+ className = "",
+ children,
+}: {
+ /** What the menu is, e.g. "Sections". Shown on the phone bar. */
+ label: string;
+ /** The selected item's name, shown on the phone bar next to the label. */
+ current?: string;
+ /** Changes whenever the selection does; the phone menu closes on change. */
+ closeKey?: string;
+ /** Width, background and padding for the desktop column, e.g. "md:w-52". */
+ className?: string;
+ children: React.ReactNode;
+}) {
+ const [open, setOpen] = useState(false);
+ const send = (event: SideNavEvent) => setOpen((o) => nextSideNavOpen(o, event));
+ // Close when the selection changes, adjusted during render rather than in
+ // an effect so the menu never paints open over the new selection.
+ const [seenKey, setSeenKey] = useState(closeKey);
+ if (closeKey !== seenKey) {
+ setSeenKey(closeKey);
+ setOpen((o) => nextSideNavOpen(o, { type: "selection-changed" }));
+ }
+ const panelId = useId();
+
+ // Escape closes the open phone menu, as tapping the page behind it does.
+ useEffect(() => {
+ if (!open) return;
+ const onKey = (e: KeyboardEvent) =>
+ setOpen((o) => nextSideNavOpen(o, { type: "key", key: e.key }));
+ window.addEventListener("keydown", onKey);
+ return () => window.removeEventListener("keydown", onKey);
+ }, [open]);
+
+ return (
+ <div className="relative flex-shrink-0 md:contents">
+ <button
+ type="button"
+ onClick={() => send({ type: "toggle" })}
+ aria-expanded={open}
+ aria-controls={panelId}
+ className="md:hidden w-full min-h-touch flex items-center gap-2 px-4 py-2 border-b border-line bg-surface-elevated text-left text-sm cursor-pointer"
+ >
+ <span className="text-fg-subtle flex-shrink-0">{label}</span>
+ {current && <span className="font-medium text-fg truncate">{current}</span>}
+ <Icon
+ name="chevron-right"
+ size="w-4 h-4"
+ className={`ml-auto flex-shrink-0 text-fg-muted transition-transform ${open ? "rotate-90" : ""}`}
+ />
+ </button>
+ {open && (
+ <div
+ className="md:hidden fixed inset-0 z-10"
+ onClick={() => send({ type: "outside" })}
+ aria-hidden="true"
+ />
+ )}
+ <aside
+ id={panelId}
+ onClick={(e) =>
+ send({ type: "menu-click", closesNav: !!(e.target as Element).closest("[data-closes-nav]") })
+ }
+ className={`${
+ open ? "flex" : "hidden"
+ } md:flex flex-col flex-shrink-0 overflow-y-auto border-line absolute md:static inset-x-0 top-full z-20 max-h-[70vh] md:max-h-none border-b md:border-b-0 md:border-r shadow-lg md:shadow-none ${className}`}
+ >
+ {children}
+ </aside>
+ </div>
+ );
+}
diff --git a/packages/ui/src/lib/sideNav.ts b/packages/ui/src/lib/sideNav.ts
new file mode 100644
index 00000000..319fa0c6
--- /dev/null
+++ b/packages/ui/src/lib/sideNav.ts
@@ -0,0 +1,31 @@
+// Whether a page's phone side menu (components/shell/PageSideNav.tsx) is open
+// after something happens. Kept free of React and the DOM so `npm test` can
+// run it under `node --experimental-strip-types` (scripts/sideNav.test.mjs).
+
+export type SideNavEvent =
+ /** The bar button above the menu was tapped. */
+ | { type: "toggle" }
+ /** A tap landed inside the menu; `closesNav` when it hit an item marked `data-closes-nav`. */
+ | { type: "menu-click"; closesNav: boolean }
+ /** A tap landed on the page behind the open menu. */
+ | { type: "outside" }
+ /** A key was pressed while the menu was open. */
+ | { type: "key"; key: string }
+ /** The page's selection changed (its `closeKey`). */
+ | { type: "selection-changed" };
+
+export function nextSideNavOpen(open: boolean, event: SideNavEvent): boolean {
+ switch (event.type) {
+ case "toggle":
+ return !open;
+ case "menu-click":
+ // Re-tapping the current item changes no selection, so the item itself
+ // closes the menu. Other taps (a "Show all" toggle, a disclosure) keep it open.
+ return event.closesNav ? false : open;
+ case "outside":
+ case "selection-changed":
+ return false;
+ case "key":
+ return event.key === "Escape" ? false : open;
+ }
+}