feat(ui): persist the chat conversation in localStorage — survives refresh and navigation, with a New chat reset
This commit is contained in:
@@ -174,11 +174,13 @@ body::after {
|
||||
rgb(34 211 238 / 0.05) 90%
|
||||
);
|
||||
}
|
||||
/* margin-left:auto on the nav (not justify-content:space-between) so the
|
||||
phase-14 "New chat" pill clusters with the nav on the right while the
|
||||
two-child Sources header keeps the exact same look. */
|
||||
.header-inner {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
}
|
||||
.brand {
|
||||
@@ -198,7 +200,7 @@ body::after {
|
||||
.brand-mark { width: 22px; height: 22px; flex: 0 0 auto; display: block; }
|
||||
.brand-text strong { color: var(--brand-ink); font-weight: 700; }
|
||||
|
||||
.app-nav { display: flex; gap: 0.25rem; }
|
||||
.app-nav { display: flex; gap: 0.25rem; margin-left: auto; }
|
||||
.nav-link {
|
||||
padding: 0.5rem 0.9rem;
|
||||
border-radius: 999px;
|
||||
@@ -213,6 +215,32 @@ body::after {
|
||||
.nav-link:hover { background: var(--brand-soft); color: var(--brand-ink); }
|
||||
.nav-link.is-active { background: var(--brand); color: var(--bg); }
|
||||
|
||||
/* "New chat" reset (phase 14): ghost pill in the chat header, hover like
|
||||
a nav link. ink-soft on surface ≈6.9:1; hover pair brand-ink/brand-soft
|
||||
≈6.9:1 — both WCAG AA. Icon-only below 640px (aria-label keeps the
|
||||
accessible name); ≥44px touch target at every width. */
|
||||
.new-chat-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.4rem;
|
||||
min-height: 44px;
|
||||
padding: 0.5rem 0.9rem;
|
||||
border-radius: 999px;
|
||||
border: 1px solid var(--line);
|
||||
background: transparent;
|
||||
color: var(--ink-soft);
|
||||
font: inherit;
|
||||
font-weight: 600;
|
||||
font-size: 0.95rem;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
}
|
||||
.new-chat-btn:hover { background: var(--brand-soft); color: var(--brand-ink); }
|
||||
/* The plus mark is hidden on desktop (label carries the pill); it is the
|
||||
whole control below 640px. */
|
||||
.new-chat-btn svg { width: 16px; height: 16px; display: none; }
|
||||
|
||||
/* ---------- Main frame ---------- */
|
||||
.app-main {
|
||||
flex: 1;
|
||||
@@ -754,8 +782,23 @@ body::after {
|
||||
@media (max-width: 640px) {
|
||||
:root { --header-h: 58px; }
|
||||
.container { padding-inline: 0.9rem; }
|
||||
.brand-text { font-size: 0.88rem; }
|
||||
.nav-link { padding: 0.45rem 0.7rem; font-size: 0.9rem; }
|
||||
/* Phase 14: the New chat pill joins the header — tighten the bar so
|
||||
brand + nav + pill fit at 360px without horizontal overflow (the
|
||||
brand text may ellipsize as the designated squeeze target). */
|
||||
.header-inner { gap: 0.6rem; }
|
||||
.brand { min-width: 0; }
|
||||
.brand-text {
|
||||
font-size: 0.8rem;
|
||||
letter-spacing: 0.04em;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.nav-link { padding: 0.4rem 0.55rem; font-size: 0.88rem; }
|
||||
.new-chat-btn { padding: 0.4rem 0.55rem; }
|
||||
.new-chat-label { display: none; }
|
||||
.new-chat-btn svg { display: block; }
|
||||
.msg-body { max-width: 92%; }
|
||||
.empty-state { padding: 1.75rem 1.1rem; margin-top: 0.25rem; }
|
||||
.empty-state-title { font-size: 1.25rem; }
|
||||
|
||||
Reference in New Issue
Block a user