Files
fusion/packages/dashboard/app/components/ChatView.css
gsxdsm 5ba4395d4e fix(dashboard): mobile chat New Chat button placement + merged fn-2469
- ChatView mobile: hide the top sidebar header's "New Chat" button on
  <=768px and show the existing footer button as a pinned full-width
  action with safe-area padding. Both buttons existed in JSX; only
  CSS was needed.
- styles.css: comments compose/edit textareas use var(--surface) so
  they remain visible against the task detail modal's --card panel
  (in light theme --bg and --card both resolve to #ffffff).
- Includes resolved-conflict changes from fusion/fn-2469 in
  ModelOnboardingModal and SettingsModal (and the related test).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 20:43:22 -07:00

688 lines
14 KiB
CSS

/* ── Chat View ─────────────────────────────────────────────────────────────── */
.chat-view {
display: flex;
height: 100%;
overflow: hidden;
}
/* Sidebar */
.chat-sidebar {
width: 280px;
min-width: 280px;
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
background: var(--bg-secondary);
}
.chat-sidebar--hidden {
display: none;
}
.chat-sidebar-header {
padding: 12px;
display: flex;
gap: 8px;
align-items: center;
}
.chat-sidebar-search-wrapper {
position: relative;
display: flex;
align-items: center;
}
.chat-sidebar-search-icon {
position: absolute;
left: 12px;
color: var(--text-tertiary);
pointer-events: none;
}
.chat-sidebar-search {
width: 100%;
padding: 8px 12px 8px 32px;
border: 1px solid var(--border);
border-radius: 8px;
background: var(--bg);
color: var(--text);
font-size: 13px;
}
.chat-session-list {
flex: 1;
min-height: 0;
overflow-y: auto;
padding: 4px 8px;
}
.chat-session-item {
padding: 10px 12px;
border-radius: 8px;
cursor: pointer;
display: flex;
flex-direction: column;
gap: 2px;
transition: background 0.15s;
position: relative;
}
.chat-session-item:hover {
background: var(--hover);
}
.chat-session-item--active {
background: var(--accent-bg, var(--hover));
}
.chat-session-title {
font-weight: 500;
font-size: 14px;
color: var(--text);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.chat-session-preview {
font-size: 12px;
color: var(--text-secondary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.chat-session-meta {
display: flex;
justify-content: space-between;
font-size: 11px;
color: var(--text-tertiary);
}
/* === Chat Session Delete Button === */
.chat-session-delete-btn {
position: absolute;
top: 8px;
right: 8px;
display: flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
padding: 0;
background: transparent;
border: none;
border-radius: var(--radius-sm);
color: var(--text-muted);
cursor: pointer;
opacity: 0;
transition: opacity var(--transition-fast), color var(--transition-fast);
}
.chat-session-item:hover .chat-session-delete-btn {
opacity: 1;
}
.chat-session-delete-btn:hover {
color: var(--color-error);
opacity: 1;
}
.chat-session-delete-btn:focus {
opacity: 1;
outline: 2px solid var(--focus-ring-strong);
outline-offset: 1px;
}
/* Context menu for session items */
.chat-session-context-menu {
position: fixed;
background: var(--bg-elevated, var(--bg));
border: 1px solid var(--border);
border-radius: 8px;
box-shadow: 0 4px 12px var(--shadow);
padding: 4px;
z-index: 100;
}
.chat-session-context-menu button {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
padding: 8px 12px;
border: none;
background: none;
color: var(--text);
cursor: pointer;
border-radius: 4px;
font-size: 13px;
}
.chat-session-context-menu button:hover {
background: var(--hover);
}
/* Main chat thread */
.chat-thread {
flex: 1;
display: flex;
flex-direction: column;
min-width: 0;
min-height: 0;
}
.chat-thread-header {
padding: 12px 16px;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
gap: 8px;
}
.chat-thread-header-title {
font-weight: 600;
font-size: 15px;
}
/* Messages */
.chat-messages {
flex: 1;
min-height: 0;
overflow-y: auto;
padding: 16px;
display: flex;
flex-direction: column;
gap: 12px;
}
.chat-message {
max-width: 75%;
padding: 10px 14px;
border-radius: 12px;
font-size: 14px;
line-height: 1.5;
word-break: break-word;
}
.chat-message--user {
align-self: flex-end;
background: var(--accent);
color: var(--accent-text, #fff);
border-bottom-right-radius: 4px;
}
.chat-message--assistant {
align-self: flex-start;
background: var(--bg-elevated, var(--bg-secondary));
color: var(--text);
border-bottom-left-radius: 4px;
}
.chat-message-avatar {
display: flex;
align-items: center;
gap: 6px;
margin-bottom: 4px;
font-size: 12px;
color: var(--text-secondary);
}
.chat-model-tag {
font-size: 11px;
padding: 1px 6px;
border-radius: 4px;
background: var(--surface-bg, rgba(255, 255, 255, 0.08));
color: var(--text-secondary);
margin-left: 6px;
white-space: nowrap;
vertical-align: middle;
}
.chat-message-content {
white-space: pre-wrap;
}
.chat-message-time {
font-size: 11px;
color: var(--text-tertiary);
margin-top: 4px;
}
.chat-message-thinking {
margin-top: 6px;
}
.chat-message-thinking summary {
font-size: 12px;
color: var(--text-secondary);
cursor: pointer;
}
.chat-message-thinking-content {
font-size: 13px;
color: var(--text-secondary);
padding: 8px;
background: var(--bg);
border-radius: 6px;
margin-top: 4px;
white-space: pre-wrap;
font-family: var(--font-mono, monospace);
overflow-x: auto;
}
/* === Chat Tool Calls === */
.chat-tool-calls {
margin-top: var(--space-sm);
display: flex;
flex-direction: column;
gap: var(--space-xs);
}
.chat-tool-calls-header {
display: inline-flex;
align-items: center;
gap: var(--space-xs);
color: var(--text-muted);
font-size: var(--space-md);
}
.chat-tool-call {
border: var(--btn-border-width, 1px) solid color-mix(in srgb, var(--border) 85%, transparent);
border-radius: var(--radius-sm);
background: color-mix(in srgb, var(--surface) 35%, transparent);
}
.chat-tool-call summary {
display: flex;
align-items: center;
gap: var(--space-xs);
list-style: none;
cursor: pointer;
padding: var(--space-xs) var(--space-sm);
color: var(--text-muted);
border-radius: var(--radius-sm);
font-size: var(--space-md);
min-width: 0;
}
.chat-tool-call summary::marker {
content: "";
}
.chat-tool-call summary::-webkit-details-marker {
display: none;
}
.chat-tool-call summary:focus-visible {
outline: none;
box-shadow: var(--focus-ring-strong);
}
.chat-tool-call-status-dot {
width: calc((var(--space-xs) + var(--space-sm)) / 2);
height: calc((var(--space-xs) + var(--space-sm)) / 2);
border-radius: 50%;
background: var(--color-success);
flex-shrink: 0;
}
.chat-tool-call-name {
font-family: var(--font-mono, monospace);
flex-shrink: 0;
}
.chat-tool-call-preview {
color: var(--text-muted);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
min-width: 0;
font-size: 0.6875rem;
}
.chat-tool-call-status-text {
margin-left: auto;
font-size: 0.6875rem;
text-transform: lowercase;
}
.chat-tool-call-content {
margin: var(--space-xs) var(--space-sm) var(--space-sm);
padding: var(--space-sm);
border-radius: var(--radius-sm);
background: var(--bg);
font-family: var(--font-mono, monospace);
display: flex;
flex-direction: column;
gap: var(--space-xs);
}
.chat-tool-call-row {
display: grid;
grid-template-columns: auto 1fr;
gap: var(--space-xs);
align-items: start;
}
.chat-tool-call-label {
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.04em;
font-size: 0.6875rem;
}
.chat-tool-call-value {
color: var(--text);
word-break: break-word;
white-space: pre-wrap;
}
.chat-tool-call--running .chat-tool-call-status-dot {
background: var(--color-info);
animation: tool-call-pulse var(--transition-slow) infinite;
}
.chat-tool-call--error summary {
color: var(--color-error);
}
.chat-tool-call--error .chat-tool-call-status-dot {
background: var(--color-error);
}
.chat-tool-call-row--error {
background: color-mix(in srgb, var(--color-error) 10%, transparent);
border-radius: var(--radius-sm);
padding: var(--space-xs);
}
.chat-tool-calls--compact .chat-tool-calls-header,
.chat-tool-calls--compact .chat-tool-call summary,
.chat-tool-calls--compact .chat-tool-call-content,
.chat-tool-calls--compact .chat-tool-call-preview,
.chat-tool-calls--compact .chat-tool-call-value {
font-size: 0.6875rem;
}
@keyframes tool-call-pulse {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0.4;
}
}
/* Streaming indicator */
.chat-message--streaming {
align-self: flex-start;
background: var(--bg-elevated, var(--bg-secondary));
color: var(--text);
border-bottom-left-radius: 4px;
opacity: 0.9;
}
.chat-typing-indicator {
display: inline-flex;
gap: 4px;
padding: 4px 0;
}
.chat-typing-indicator span {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--text-secondary);
animation: chat-typing-bounce 1.4s infinite ease-in-out;
}
.chat-typing-indicator span:nth-child(1) { animation-delay: 0s; }
.chat-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chat-typing-bounce {
0%, 80%, 100% { opacity: 0.3; }
40% { opacity: 1; }
}
/* Chat waiting state */
.chat-message-content--waiting {
color: var(--text-muted);
font-style: italic;
font-size: 13px;
}
.quick-chat-panel-waiting {
color: var(--text-muted) !important;
font-style: italic;
}
/* Input area */
.chat-input-area {
position: relative;
padding: 12px 16px;
border-top: 1px solid var(--border);
display: flex;
align-items: flex-end;
gap: 8px;
}
/* === Chat Skill Menu === */
.chat-skill-menu {
position: absolute;
left: var(--space-lg);
bottom: calc(100% + var(--space-xs));
min-width: calc((var(--space-xl) * 10) + var(--space-2xl) + (var(--space-xs) * 2));
max-width: calc(100% - (var(--space-lg) * 2));
max-height: calc(var(--space-xl) * 10);
overflow-y: auto;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-md);
box-shadow: var(--shadow-lg);
z-index: 50;
}
.chat-skill-menu-item {
width: 100%;
border: none;
background: transparent;
color: inherit;
text-align: left;
padding: var(--space-sm) var(--space-md);
cursor: pointer;
display: flex;
flex-direction: column;
gap: var(--space-xs);
transition: background var(--transition-fast);
}
.chat-skill-menu-item:hover,
.chat-skill-menu-item--highlighted {
background: var(--card-hover);
}
.chat-skill-menu-item:focus-visible {
outline: none;
box-shadow: var(--focus-ring-strong);
background: var(--card-hover);
}
.chat-skill-menu-item-name {
font-size: 0.8125rem;
color: var(--text);
font-family: var(--font-mono);
}
.chat-skill-menu-item-description {
font-size: 0.75rem;
color: var(--text-muted);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: calc((var(--space-xl) * 10) + var(--space-lg) + var(--space-xs));
}
.chat-skill-menu-empty {
padding: var(--space-sm) var(--space-md);
color: var(--text-muted);
font-size: 0.8125rem;
}
.chat-input-textarea {
flex: 1;
resize: none;
border: 1px solid var(--border);
border-radius: 12px;
padding: 10px 14px;
background: var(--bg);
color: var(--text);
font-size: 14px;
font-family: inherit;
line-height: 1.4;
max-height: 120px;
min-height: 40px;
}
.chat-input-textarea:focus {
outline: none;
border-color: var(--accent);
}
.chat-input-send {
width: 36px;
height: 36px;
border-radius: 50%;
border: none;
background: var(--accent);
color: var(--accent-text, #fff);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.chat-input-send:disabled {
opacity: 0.4;
cursor: not-allowed;
}
.chat-input-stop {
width: calc(var(--space-xl) * 2);
height: calc(var(--space-xl) * 2);
border-radius: var(--radius-md);
border: none;
background: color-mix(in srgb, var(--color-error) 15%, transparent);
color: var(--color-error);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
transition: background var(--transition-fast), transform var(--transition-fast), color var(--transition-fast);
}
.chat-input-stop:hover {
background: color-mix(in srgb, var(--color-error) 25%, transparent);
}
.chat-input-stop:focus-visible {
outline: none;
box-shadow: var(--focus-ring-strong);
}
.chat-input-stop:active {
transform: scale(0.97);
}
/* === Chat Pending Message === */
.chat-pending-message {
display: flex;
align-items: center;
gap: var(--space-sm);
margin-top: var(--space-xs);
padding: var(--space-xs) var(--space-sm);
border-radius: var(--radius-sm);
background: color-mix(in srgb, var(--todo) 10%, transparent);
color: var(--text-muted);
font-size: 12px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.chat-pending-message span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.chat-pending-message-dismiss {
background: none;
border: none;
color: var(--text-dim);
cursor: pointer;
padding: var(--space-xs);
line-height: 1;
flex-shrink: 0;
font-size: 14px;
}
.chat-pending-message-dismiss:hover {
color: var(--text-muted);
}
/* The mobile-only "New Chat" footer button is hidden on desktop; the
desktop layout uses the .chat-sidebar-header button instead. */
.chat-sidebar-footer {
display: none;
}
/* === Mobile: one pane at a time =========================================
Sidebar (session list) and thread are siblings of .chat-view. On mobile
we show whichever one is "active" full-width: when the sidebar is
visible, the thread is hidden; when the sidebar is hidden (a session is
open), the sidebar is collapsed via .chat-sidebar--hidden and the
thread takes the full viewport. The thread already renders a back
button (ChevronLeft) on mobile to flip back to the session list. */
@media (max-width: 768px) {
.chat-sidebar {
width: 100%;
min-width: 0;
border-right: none;
}
/* When the sidebar is shown, the thread is hidden so only the session
list is visible. When the sidebar is hidden, the thread fills the
viewport. Adjacent-sibling selector keeps logic in CSS only. */
.chat-sidebar:not(.chat-sidebar--hidden) + .chat-thread {
display: none;
}
/* On mobile, the "New Chat" affordance moves to a full-width pinned
footer. The desktop top-header button is hidden to free the screen
space for the search field and session list. */
.chat-sidebar-header {
display: none;
}
.chat-sidebar-footer {
display: block;
padding: var(--space-sm) var(--space-md);
padding-bottom: max(var(--space-sm), env(safe-area-inset-bottom, 0));
border-top: 1px solid var(--border);
background: var(--bg-secondary);
}
.chat-sidebar-footer .chat-sidebar-footer-btn {
width: 100%;
justify-content: center;
min-height: 40px;
}
}