feat: mobile-first chat layout — split mode, hidden desktop modes, 79 tests

Mobile (≤480px):
- Hide Side Panel, Floating, Full Screen buttons
- Show Split button (50vh vertical split, CV visible above)
- Compact mode: 55vh max bottom sheet
- Force desktop modes to compact if somehow activated
- Disable tooltips on mobile (overflow prevention)
- Tighter header padding

Desktop (>480px):
- Split button hidden, all modes available as before

Tests: 85-chat-mobile.test.mjs — 79 assertions across
iPhone SE (320x568), iPhone 14 (393x852), iPhone 14 Pro Max (430x932),
plus desktop sanity check
This commit is contained in:
juanatsap
2026-04-09 12:21:28 +01:00
parent edf302b302
commit 6e922fd1cb
3 changed files with 303 additions and 3 deletions
+72 -2
View File
@@ -783,12 +783,13 @@
========================================================================== */
@media (max-width: 480px) {
/* Default compact: bottom sheet */
.chat-panel {
bottom: 0;
left: 0;
right: 0;
width: 100%;
max-height: 70vh;
max-height: 55vh;
border-radius: 8px 8px 0 0;
}
@@ -798,6 +799,75 @@
}
.chat-messages {
max-height: 200px;
max-height: 180px;
}
/* Hide desktop-only layout modes on mobile */
.chat-mode-btn[data-mode="chat-half"],
.chat-mode-btn[data-mode="chat-float"],
.chat-mode-btn[data-mode="chat-full"] {
display: none;
}
/* Show mobile split button */
.chat-mode-btn[data-mode="chat-split"] {
display: flex;
}
/* Mobile split: CV on top, chat on bottom half */
.chat-panel.chat-split {
bottom: 0;
left: 0;
right: 0;
top: auto;
width: 100%;
height: 50vh;
max-height: 50vh;
border-radius: 8px 8px 0 0;
border-top: 2px solid var(--accent-green, #27ae60);
}
.chat-panel.chat-split .chat-messages {
max-height: none;
flex: 1;
}
/* Force compact on mobile for desktop-only modes (safety) */
.chat-panel.chat-half,
.chat-panel.chat-float,
.chat-panel.chat-full {
bottom: 0;
left: 0;
right: 0;
top: auto;
width: 100%;
height: auto;
max-height: 55vh;
border-radius: 8px 8px 0 0;
border: 1px solid var(--border-light, #e0e0e0);
resize: none;
}
/* Tooltips: prevent overflow on mobile */
.chat-mode-btn[title]:hover::after {
display: none;
}
/* Tighter header on mobile */
.chat-header {
padding: 8px 10px;
font-size: 0.8rem;
}
.chat-mode-btn {
font-size: 0.85rem;
padding: 3px;
}
}
/* Hide mobile split button on desktop */
@media (min-width: 481px) {
.chat-mode-btn[data-mode="chat-split"] {
display: none;
}
}