Fix mobile chat composer glitches and add date separators/reconnect banner
Composer focus/blur no longer fights the on-screen keyboard: tapping Send blurred the textarea first, which unconditionally zeroed the visualViewport keyboard-inset compensation before the immediate refocus could recompute it, so the composer could sit misplaced for up to 600ms after every mobile send. Blur now only resets the inset when focus is actually leaving the composer form, and focus recomputes it immediately instead of waiting on the retry timers. Emoji picker and @mention wiring, previously only ever applied once at page load, are now re-run whenever AppChat rebuilds a composer for a client-side conversation switch, so both survive tapping a conversation from the list instead of only working after a full page reload. Viewport meta gains interactive-widget=resizes-content for native keyboard-aware layout. Chat scroll panes get overscroll-behavior: contain plus momentum scrolling, matching the pattern already used elsewhere in the app. The conversation-search dropdown's literal z-index is replaced with the --z-popover token. Adds sticky Today/Yesterday/date separators between message groups (chat/DateSeparators.js, viewer-local-time day boundaries, normalized on every thread mutation) and a debounced "Reconnecting..." banner reflecting live WebSocket state. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qsdit8UXhbUn9ZnfgjbXqt
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
export function dateKey(iso) {
|
||||
if (!iso) return null;
|
||||
const ms = Date.parse(iso);
|
||||
if (Number.isNaN(ms)) return null;
|
||||
const d = new Date(ms);
|
||||
return `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;
|
||||
}
|
||||
|
||||
export function dateLabel(iso) {
|
||||
if (!iso) return "";
|
||||
const ms = Date.parse(iso);
|
||||
if (Number.isNaN(ms)) return "";
|
||||
const d = new Date(ms);
|
||||
const startOfDay = (x) => new Date(x.getFullYear(), x.getMonth(), x.getDate()).getTime();
|
||||
const diffDays = Math.round((startOfDay(new Date()) - startOfDay(d)) / 86400000);
|
||||
if (diffDays === 0) return "Today";
|
||||
if (diffDays === 1) return "Yesterday";
|
||||
const dd = String(d.getDate()).padStart(2, "0");
|
||||
const mm = String(d.getMonth() + 1).padStart(2, "0");
|
||||
return `${dd}/${mm}/${d.getFullYear()}`;
|
||||
}
|
||||
Reference in New Issue
Block a user