feat: UI redesign — compact mode select, consolidated header nav

Header:
- Sessions, ⚙ context panel, ≡ settings dropdown (Files, Account,
  Sign Out), and  help — down from 6+ individual buttons
- Responsive: flex-row on desktop, wraps on mobile with labels hidden

Footer (input area):
- 4-way mode select replaces the button row — shows only the active
  mode as [icon] [label] ▲; click opens an upward dropdown
- Options sorted by MRU: most recently used floats to the bottom
  (closest to the trigger button) for quick re-selection
- Current mode marked with ✓
- Note mode shows a small prv/pub sub-toggle below the select button
- Mobile: textarea on top (full width), mode select + send on one row

Mode state consolidated from 3 booleans into a single current_mode
variable with localStorage persistence and MRU tracking.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-03-26 22:08:33 -04:00
parent fa04b5e6b0
commit 6cf10d2755
3 changed files with 330 additions and 242 deletions

View File

@@ -110,6 +110,7 @@
align-items: center;
gap: 12px;
position: relative;
flex-wrap: wrap;
}
.header-emoji {
@@ -188,11 +189,57 @@
padding: 5px 10px;
cursor: pointer;
transition: border-color 0.15s, color 0.15s;
white-space: nowrap;
}
.hdr-btn:hover { border-color: var(--muted); color: var(--text); }
#sessions-btn { margin-left: auto; }
/* Right-side nav group — pushed to the end */
#hdr-nav {
display: flex;
align-items: center;
gap: 8px;
margin-left: auto;
}
/* Settings dropdown */
.hdr-dropdown-wrap { position: relative; }
.hdr-dropdown {
display: none;
position: absolute;
top: calc(100% + 6px);
right: 0;
min-width: 170px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 8px;
box-shadow: 0 4px 16px rgba(0,0,0,0.4);
z-index: 200;
overflow: hidden;
}
.hdr-dropdown.open { display: block; }
.hdr-dd-item {
display: block;
width: 100%;
text-align: left;
padding: 0.55rem 0.85rem;
color: var(--text);
text-decoration: none;
font-size: 0.85rem;
background: none;
border: none;
cursor: pointer;
transition: background 0.1s;
box-sizing: border-box;
}
.hdr-dd-item:hover { background: var(--border); }
.hdr-dd-divider {
border-top: 1px solid var(--border);
margin: 0.25rem 0;
}
/* Sessions panel */
#sessions-panel {
@@ -448,16 +495,103 @@
.message.note-private .note-content { color: #c9a84c; white-space: pre-wrap; }
.message.note-public .note-content { color: #4abfb0; white-space: pre-wrap; }
/* ── Input area ────────────────────────────────────────────── */
/* ── Input area — 3-col: [mode-toggle] [textarea] [send-col] ── */
#input-area {
padding: 14px 20px;
padding: 12px 20px;
background: var(--surface);
border-top: 1px solid var(--border);
display: flex;
flex-direction: row;
gap: 10px;
align-items: flex-end;
}
/* ── Mode select — compact dropdown ─────────────────────────── */
#mode-select {
position: relative;
flex-shrink: 0;
display: flex;
flex-direction: column;
align-items: stretch;
gap: 4px;
}
#mode-select-btn {
display: flex;
align-items: center;
gap: 7px;
background: var(--bg);
border: 1px solid var(--border);
border-radius: 8px;
color: var(--muted);
padding: 8px 11px;
cursor: pointer;
font-size: 0.85rem;
white-space: nowrap;
transition: border-color 0.15s, color 0.15s;
}
#mode-select-btn:hover { border-color: var(--muted); color: var(--text); }
#mode-select-btn.mode-note { border-color: rgba(180,130,40,0.6); color: #c9a84c; }
#mode-select-btn.mode-otr { border-color: rgba(120,80,160,0.6); color: #a87fd4; }
#mode-select-btn.mode-agent { border-color: rgba(80,140,200,0.6); color: #7cb9e8; }
#mode-icon { font-size: 1rem; line-height: 1; }
.mode-arrow { font-size: 0.55rem; color: var(--muted); margin-left: 2px; opacity: 0.5; }
/* Dropdown — opens upward; MRU at bottom = closest to button */
#mode-dropdown {
display: none;
position: absolute;
bottom: calc(100% + 4px);
left: 0;
min-width: 100%;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 8px;
box-shadow: 0 -4px 16px var(--shadow);
z-index: 100;
overflow: hidden;
}
#mode-dropdown.open { display: block; }
.mode-option {
display: flex;
align-items: center;
gap: 8px;
padding: 0.5rem 0.85rem;
cursor: pointer;
font-size: 0.85rem;
color: var(--muted);
border: none;
background: none;
width: 100%;
text-align: left;
transition: background 0.1s, color 0.1s;
}
.mode-option:hover { background: var(--border); color: var(--text); }
.mode-option.current { color: var(--text); font-weight: 500; }
.mode-option .opt-icon { font-size: 1rem; line-height: 1; }
.mode-option .opt-check { margin-left: auto; font-size: 0.7rem; opacity: 0.7; }
/* Note visibility sub-button — shown below mode-select when note is active */
#note-vis-btn {
display: none;
background: var(--bg);
border: 1px solid rgba(180,130,40,0.35);
border-radius: 6px;
color: rgba(180,130,40,0.75);
font-size: 0.7rem;
padding: 4px 8px;
cursor: pointer;
text-align: center;
transition: opacity 0.15s;
}
#note-vis-btn:hover { opacity: 0.75; }
#note-vis-btn.pub {
border-color: rgba(40,170,150,0.35);
color: rgba(40,170,150,0.75);
}
#input {
flex: 1;
background: var(--bg);
@@ -475,121 +609,21 @@
#input:focus { outline: none; border-color: var(--muted); }
#input.note-mode { border-color: rgba(180, 130, 40, 0.55); }
#input.note-mode:focus { border-color: rgba(180, 130, 40, 0.85); }
#input.note-mode.public { border-color: rgba(40, 170, 150, 0.55); }
#input.note-mode.public:focus { border-color: rgba(40, 170, 150, 0.85); }
#input.mode-note { border-color: rgba(180,130,40,0.55); }
#input.mode-note:focus { border-color: rgba(180,130,40,0.85); }
#input.mode-note.public { border-color: rgba(40,170,150,0.55); }
#input.mode-note.public:focus { border-color: rgba(40,170,150,0.85); }
#input.mode-otr { border-color: rgba(120,80,160,0.4); background: rgba(120,80,160,0.04); }
#input.mode-agent { border-color: rgba(80,140,200,0.4); }
/* Right column — all controls stacked, fixed width */
#right-col {
/* Send column — right side, stacked */
#send-col {
display: flex;
flex-direction: column;
align-items: stretch;
gap: 4px;
flex-shrink: 0;
width: 88px;
}
/* Semi-hidden controls: height selector row */
#height-row {
display: none; /* shown by JS when content > 3 lines */
align-items: center;
gap: 4px;
}
#height-row span {
font-size: 0.65rem;
color: var(--muted);
flex-shrink: 0;
}
#height-sel {
flex: 1;
background: var(--bg);
border: 1px solid var(--border);
border-radius: 5px;
color: var(--muted);
font-size: 0.65rem;
padding: 2px 4px;
cursor: pointer;
min-width: 0;
}
#height-sel:focus { outline: none; border-color: var(--muted); }
/* Semi-hidden: enter-mode toggle */
#enter-toggle {
display: none; /* shown by JS when content > 3 lines */
background: var(--bg);
border: 1px solid var(--border);
border-radius: 5px;
color: var(--muted);
font-size: 0.68rem;
padding: 3px 6px;
cursor: pointer;
text-align: center;
transition: border-color 0.15s, color 0.15s;
}
#enter-toggle:hover { border-color: var(--muted); color: var(--text); }
/* Note type toggle — only visible in note mode */
#note-type-btn {
display: none;
background: var(--bg);
border: 1px solid rgba(180, 130, 40, 0.4);
border-radius: 5px;
color: rgba(180, 130, 40, 0.85);
font-size: 0.68rem;
padding: 3px 6px;
cursor: pointer;
text-align: center;
transition: opacity 0.15s;
}
#note-type-btn.public {
border-color: rgba(40, 170, 150, 0.4);
color: rgba(40, 170, 150, 0.85);
}
#note-type-btn:hover { opacity: 0.75; }
/* Note button */
#note-btn {
background: var(--bg);
border: 1px solid var(--border);
color: var(--muted);
border-radius: 8px;
padding: 8px 0;
cursor: pointer;
font-size: 0.85rem;
text-align: center;
transition: border-color 0.15s, color 0.15s;
}
#note-btn:hover { border-color: var(--muted); color: var(--text); }
#note-btn.active { border-color: rgba(180, 130, 40, 0.6); color: #c9a84c; }
#note-btn.active.public { border-color: rgba(40, 170, 150, 0.6); color: #4abfb0; }
/* OTR button */
#otr-btn {
background: var(--bg);
border: 1px solid var(--border);
color: var(--muted);
border-radius: 8px;
padding: 8px 0;
cursor: pointer;
font-size: 0.85rem;
text-align: center;
transition: border-color 0.15s, color 0.15s;
}
#otr-btn:hover { border-color: var(--muted); color: var(--text); }
#otr-btn.active { border-color: rgba(120, 80, 160, 0.6); color: #a87fd4; }
/* OTR textarea styling */
#input.otr-mode {
border-color: rgba(120, 80, 160, 0.4);
background: rgba(120, 80, 160, 0.04);
width: 80px;
}
/* Send button */
@@ -1116,12 +1150,11 @@
@media (max-width: 520px) {
header { padding: 8px 12px; gap: 8px; }
header .subtitle { display: none; }
.btn-label { display: none; }
/* Persona dropdown: avoid clipping off left edge on narrow screens */
/* Persona dropdown: avoid clipping off left edge */
.persona-dropdown { left: 0; right: auto; min-width: 140px; }
/* Logout button: keep visible but compact */
#logout-btn { padding: 5px 8px; font-size: 1rem; }
#messages { padding: 12px; }
/* dvh adjusts as soft keyboard opens/closes */
@@ -1130,32 +1163,49 @@
/* Hide session ID — saves vertical space */
#session-id { display: none; }
/* Input area: stack textarea above button row */
/*
* Footer on mobile: textarea on top (full width), then
* mode-toggle + send-col side by side below.
* flex-wrap + order:-1 achieves this without a wrapper div.
*/
#input-area {
flex-direction: column;
align-items: stretch;
flex-wrap: wrap;
align-items: center;
padding: 8px 12px;
gap: 6px;
}
/* 16px minimum prevents iOS Safari auto-zoom on focus */
#input { font-size: 16px; }
/* Right col goes horizontal, full width */
#right-col {
flex-direction: row;
/* Textarea floats to top row, full width */
#input {
order: -1;
width: 100%;
flex-basis: 100%;
font-size: 16px; /* prevent iOS Safari auto-zoom */
}
/* Mode select: row layout (btn left, note-vis right) */
#mode-select {
flex-direction: row;
flex: 1;
align-items: center;
}
#mode-select-btn { flex: 1; justify-content: center; }
/* Note vis button sits to the right of the mode btn on mobile */
#note-vis-btn { margin-top: 0; }
/* Dropdown still opens upward on mobile */
#mode-dropdown { min-width: 140px; }
/* Send col: horizontal in bottom row */
#send-col {
flex-direction: row;
width: auto;
gap: 6px;
}
/* Desktop-only controls — hide on mobile */
#height-row,
#enter-toggle { display: none !important; }
/* Larger touch targets */
#send, #stop { padding: 12px 0; flex: 1; font-size: 1rem; }
#note-btn { padding: 12px 14px; }
#note-type-btn { padding: 6px 10px; }
#send, #stop { padding: 12px 14px; font-size: 1rem; }
}
/* ── Touch devices — no hover capability ─────────────────── */