403eb49de0
The .btn-new-conv class has flex:1 for the sidebar row layout, but when reused inside .no-conversation (a column flex), it stretched vertically to fill the entire viewport — appearing as a giant purple rectangle. Override with flex:none in the no-conversation context. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
679 lines
20 KiB
Vue
679 lines
20 KiB
Vue
<script setup lang="ts">
|
|
import { onMounted, onUnmounted, ref, computed, watch, nextTick } from "vue";
|
|
import { useRoute, useRouter } from "vue-router";
|
|
import { useChatStore } from "@/stores/chat";
|
|
import ChatPanel from "@/components/ChatPanel.vue";
|
|
|
|
const route = useRoute();
|
|
const router = useRouter();
|
|
const store = useChatStore();
|
|
|
|
const summarizing = ref(false);
|
|
const sidebarOpen = ref(false);
|
|
|
|
let prevConvId: number | null = null;
|
|
|
|
const convId = computed(() => {
|
|
const id = route.params.id;
|
|
return id ? Number(id) : null;
|
|
});
|
|
|
|
function formatConvDate(dateStr: string): string {
|
|
const date = new Date(dateStr);
|
|
const now = new Date();
|
|
const diffMs = now.getTime() - date.getTime();
|
|
const diffMin = Math.floor(diffMs / 60_000);
|
|
const diffHrs = Math.floor(diffMs / 3_600_000);
|
|
|
|
if (diffMin < 1) return "Just now";
|
|
if (diffMin < 60) return `${diffMin}m ago`;
|
|
if (diffHrs < 10) return `${diffHrs}h ago`;
|
|
if (date.getFullYear() === now.getFullYear()) {
|
|
return date.toLocaleDateString(undefined, { month: "short", day: "numeric" });
|
|
}
|
|
return date.toLocaleDateString(undefined, { month: "short", day: "numeric", year: "numeric" });
|
|
}
|
|
|
|
interface ConvGroup { label: string; convs: typeof store.conversations }
|
|
|
|
const groupedConversations = computed((): ConvGroup[] => {
|
|
const now = new Date();
|
|
const startOfToday = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
const startOfYesterday = new Date(startOfToday.getTime() - 86_400_000);
|
|
const startOfWeek = new Date(startOfToday.getTime() - 6 * 86_400_000);
|
|
const startOfMonth = new Date(now.getFullYear(), now.getMonth(), 1);
|
|
|
|
const buckets: Record<string, typeof store.conversations> = {};
|
|
const order: string[] = [];
|
|
|
|
for (const conv of store.conversations) {
|
|
const d = new Date(conv.updated_at);
|
|
let key: string;
|
|
if (d >= startOfToday) {
|
|
key = "Today";
|
|
} else if (d >= startOfYesterday) {
|
|
key = "Yesterday";
|
|
} else if (d >= startOfWeek) {
|
|
key = "This week";
|
|
} else if (d >= startOfMonth) {
|
|
key = "This month";
|
|
} else {
|
|
key = d.toLocaleDateString(undefined, { month: "long", year: "numeric" });
|
|
}
|
|
if (!buckets[key]) { buckets[key] = []; order.push(key); }
|
|
buckets[key].push(conv);
|
|
}
|
|
|
|
return order.map((label) => ({ label, convs: buckets[label] }));
|
|
});
|
|
|
|
onMounted(async () => {
|
|
document.addEventListener("keydown", onGlobalKeydown);
|
|
await store.fetchConversations();
|
|
if (convId.value) {
|
|
if (store.currentConversation?.id !== convId.value) {
|
|
await store.fetchConversation(convId.value);
|
|
}
|
|
store.reconnectIfGenerating(convId.value);
|
|
} else {
|
|
await startNewConversation();
|
|
}
|
|
nextTick(() => chatPanelRef.value?.focus());
|
|
});
|
|
|
|
watch(convId, async (newId) => {
|
|
if (prevConvId && prevConvId !== newId) {
|
|
const prev = store.conversations.find((c) => c.id === prevConvId);
|
|
if (prev && prev.message_count === 0) {
|
|
store.deleteConversation(prevConvId);
|
|
}
|
|
}
|
|
prevConvId = newId ?? null;
|
|
|
|
if (newId) {
|
|
if (store.currentConversation?.id !== newId && !store.isStreamingConv(newId)) {
|
|
await store.fetchConversation(newId);
|
|
}
|
|
store.reconnectIfGenerating(newId);
|
|
} else {
|
|
await startNewConversation();
|
|
}
|
|
nextTick(() => chatPanelRef.value?.focus());
|
|
});
|
|
|
|
function toggleSidebar() {
|
|
sidebarOpen.value = !sidebarOpen.value;
|
|
}
|
|
|
|
async function selectConversation(id: number) {
|
|
sidebarOpen.value = false;
|
|
router.push(`/chat/${id}`);
|
|
}
|
|
|
|
async function startNewConversation() {
|
|
const conv = await store.createConversation();
|
|
router.push(`/chat/${conv.id}`);
|
|
}
|
|
|
|
async function newConversation() {
|
|
await startNewConversation();
|
|
}
|
|
|
|
// ── Bulk selection ────────────────────────────────────────────────────────────
|
|
const selectMode = ref(false);
|
|
const selectedIds = ref<Set<number>>(new Set());
|
|
const bulkConfirm = ref(false);
|
|
const bulkDeleting = ref(false);
|
|
|
|
function toggleSelectMode() {
|
|
selectMode.value = !selectMode.value;
|
|
selectedIds.value = new Set();
|
|
bulkConfirm.value = false;
|
|
}
|
|
|
|
function toggleSelectConv(id: number) {
|
|
if (selectedIds.value.has(id)) {
|
|
selectedIds.value.delete(id);
|
|
} else {
|
|
selectedIds.value.add(id);
|
|
}
|
|
selectedIds.value = new Set(selectedIds.value);
|
|
}
|
|
|
|
function selectAll() {
|
|
selectedIds.value = new Set(store.conversations.map((c) => c.id));
|
|
}
|
|
|
|
function clearSelection() {
|
|
selectedIds.value = new Set();
|
|
bulkConfirm.value = false;
|
|
}
|
|
|
|
async function bulkDelete() {
|
|
if (!bulkConfirm.value) { bulkConfirm.value = true; return; }
|
|
bulkDeleting.value = true;
|
|
try {
|
|
const ids = [...selectedIds.value];
|
|
await store.bulkDeleteConversations(ids);
|
|
if (ids.includes(convId.value ?? -1)) router.push("/chat");
|
|
selectedIds.value = new Set();
|
|
bulkConfirm.value = false;
|
|
selectMode.value = false;
|
|
} finally {
|
|
bulkDeleting.value = false;
|
|
}
|
|
}
|
|
|
|
async function removeConversation(id: number) {
|
|
await store.deleteConversation(id);
|
|
if (convId.value === id) {
|
|
router.push("/chat");
|
|
}
|
|
}
|
|
|
|
// ── Summarize ─────────────────────────────────────────────────────────────────
|
|
async function handleSummarize() {
|
|
if (!store.currentConversation || summarizing.value) return;
|
|
summarizing.value = true;
|
|
try {
|
|
await store.summarizeAsNote(store.currentConversation.id);
|
|
const { useToastStore } = await import("@/stores/toast");
|
|
useToastStore().show("Conversation summarized and saved as note");
|
|
} catch {
|
|
const { useToastStore } = await import("@/stores/toast");
|
|
useToastStore().show("Failed to summarize", "error");
|
|
} finally {
|
|
summarizing.value = false;
|
|
}
|
|
}
|
|
|
|
// ── Research modal ────────────────────────────────────────────────────────────
|
|
const showResearchModal = ref(false);
|
|
const researchTopic = ref("");
|
|
const chatPanelRef = ref<InstanceType<typeof ChatPanel> | null>(null);
|
|
|
|
function toggleResearchModal() {
|
|
showResearchModal.value = !showResearchModal.value;
|
|
if (showResearchModal.value) {
|
|
researchTopic.value = "";
|
|
nextTick(() => {
|
|
const el = document.querySelector(".research-topic-input") as HTMLInputElement;
|
|
el?.focus();
|
|
});
|
|
}
|
|
}
|
|
|
|
function submitResearch() {
|
|
const topic = researchTopic.value.trim();
|
|
if (!topic) return;
|
|
showResearchModal.value = false;
|
|
researchTopic.value = "";
|
|
// Prefill sends via ChatPanel — user sees it in the input, then it auto-submits
|
|
chatPanelRef.value?.send(`Research: ${topic}`);
|
|
}
|
|
|
|
// ── Keyboard ──────────────────────────────────────────────────────────────────
|
|
function onGlobalKeydown(e: KeyboardEvent) {
|
|
if (e.key !== "Escape") return;
|
|
if (showResearchModal.value) {
|
|
showResearchModal.value = false;
|
|
return;
|
|
}
|
|
if (sidebarOpen.value) {
|
|
sidebarOpen.value = false;
|
|
return;
|
|
}
|
|
router.push("/");
|
|
}
|
|
|
|
onUnmounted(() => {
|
|
document.removeEventListener("keydown", onGlobalKeydown);
|
|
if (prevConvId) {
|
|
const conv = store.conversations.find((c) => c.id === prevConvId);
|
|
if (conv && conv.message_count === 0) {
|
|
store.deleteConversation(prevConvId);
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<main class="chat-page">
|
|
<div
|
|
v-if="sidebarOpen"
|
|
class="sidebar-overlay"
|
|
@click="sidebarOpen = false"
|
|
></div>
|
|
<aside class="chat-sidebar" :class="{ open: sidebarOpen }">
|
|
<div class="sidebar-top-bar">
|
|
<button class="btn-new-conv" @click="newConversation">+ New Chat</button>
|
|
<button
|
|
class="btn-select-mode"
|
|
:class="{ active: selectMode }"
|
|
@click="toggleSelectMode"
|
|
title="Select conversations"
|
|
>Select</button>
|
|
</div>
|
|
|
|
<div v-if="selectMode" class="bulk-bar">
|
|
<span class="bulk-count">{{ selectedIds.size }} selected</span>
|
|
<button class="bulk-link" @click="selectAll">All</button>
|
|
<button class="bulk-link" @click="clearSelection">None</button>
|
|
<button
|
|
v-if="selectedIds.size"
|
|
class="bulk-delete-btn"
|
|
:class="{ confirm: bulkConfirm }"
|
|
:disabled="bulkDeleting"
|
|
@click="bulkDelete"
|
|
>
|
|
{{ bulkDeleting ? '...' : bulkConfirm ? `Delete ${selectedIds.size}?` : `Delete (${selectedIds.size})` }}
|
|
</button>
|
|
</div>
|
|
|
|
<div class="conv-list">
|
|
<template v-for="group in groupedConversations" :key="group.label">
|
|
<div class="conv-group-label">{{ group.label }}</div>
|
|
<div
|
|
v-for="conv in group.convs"
|
|
:key="conv.id"
|
|
class="conv-item"
|
|
:class="{ active: convId === conv.id, selected: selectedIds.has(conv.id) }"
|
|
@click="selectMode ? toggleSelectConv(conv.id) : selectConversation(conv.id)"
|
|
>
|
|
<input
|
|
v-if="selectMode"
|
|
type="checkbox"
|
|
class="conv-checkbox"
|
|
:checked="selectedIds.has(conv.id)"
|
|
@click.stop="toggleSelectConv(conv.id)"
|
|
/>
|
|
<div class="conv-info">
|
|
<span class="conv-title">{{ conv.title || "Untitled" }}</span>
|
|
<span class="conv-date">{{ formatConvDate(conv.updated_at) }}</span>
|
|
</div>
|
|
<button
|
|
v-if="!selectMode"
|
|
class="btn-delete-conv"
|
|
@click.stop="removeConversation(conv.id)"
|
|
title="Delete conversation"
|
|
>
|
|
×
|
|
</button>
|
|
</div>
|
|
</template>
|
|
<p v-if="!store.conversations.length" class="empty-msg">
|
|
No conversations yet
|
|
</p>
|
|
</div>
|
|
</aside>
|
|
|
|
<section class="chat-main">
|
|
<template v-if="store.currentConversation">
|
|
<div class="chat-header">
|
|
<button class="btn-sidebar-toggle hide-desktop" aria-label="Toggle sidebar" @click="toggleSidebar">
|
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<line x1="3" y1="6" x2="21" y2="6"/>
|
|
<line x1="3" y1="12" x2="21" y2="12"/>
|
|
<line x1="3" y1="18" x2="21" y2="18"/>
|
|
</svg>
|
|
</button>
|
|
<h2>{{ store.currentConversation.title || "New Chat" }}</h2>
|
|
|
|
<!-- Research modal trigger -->
|
|
<div class="research-wrapper">
|
|
<button
|
|
class="btn-attach"
|
|
@click="toggleResearchModal"
|
|
:disabled="store.streaming || !store.chatReady"
|
|
title="Research a topic"
|
|
>
|
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/>
|
|
</svg>
|
|
</button>
|
|
<div v-if="showResearchModal" class="research-modal">
|
|
<div class="research-modal-header">Research topic</div>
|
|
<input
|
|
class="research-topic-input"
|
|
v-model="researchTopic"
|
|
placeholder="e.g. quantum computing"
|
|
@keydown.enter="submitResearch"
|
|
@keydown.escape="showResearchModal = false"
|
|
/>
|
|
<div class="research-modal-actions">
|
|
<button class="btn-research-cancel" @click="showResearchModal = false">Cancel</button>
|
|
<button class="btn-research-go" @click="submitResearch" :disabled="!researchTopic.trim()">Go</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<button
|
|
v-if="store.currentConversation.messages.length"
|
|
class="btn-summarize"
|
|
@click="handleSummarize"
|
|
:disabled="summarizing || store.streaming"
|
|
>{{ summarizing ? "Summarizing..." : "Summarize as Note" }}</button>
|
|
</div>
|
|
|
|
<ChatPanel
|
|
ref="chatPanelRef"
|
|
variant="full"
|
|
:auto-focus="true"
|
|
class="chat-panel-fill"
|
|
/>
|
|
</template>
|
|
|
|
<div v-else class="no-conversation">
|
|
<button class="btn-sidebar-toggle no-conv-toggle hide-desktop" @click="toggleSidebar">
|
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<line x1="3" y1="6" x2="21" y2="6"/>
|
|
<line x1="3" y1="12" x2="21" y2="12"/>
|
|
<line x1="3" y1="18" x2="21" y2="18"/>
|
|
</svg>
|
|
</button>
|
|
<p>Select a conversation or start a new chat.</p>
|
|
<button class="btn-new-conv" @click="newConversation">
|
|
+ New Chat
|
|
</button>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.chat-page {
|
|
display: flex;
|
|
height: 100%;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.chat-sidebar {
|
|
width: var(--sidebar-width);
|
|
min-width: 200px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
background: var(--color-bg-secondary);
|
|
}
|
|
|
|
.sidebar-top-bar {
|
|
display: flex;
|
|
gap: 0.5rem;
|
|
padding: 0.75rem;
|
|
}
|
|
|
|
.btn-new-conv {
|
|
flex: 1;
|
|
padding: 0.5rem;
|
|
background: var(--color-primary);
|
|
color: #fff;
|
|
border: none;
|
|
border-radius: var(--radius-sm);
|
|
cursor: pointer;
|
|
font-size: 0.9rem;
|
|
transition: box-shadow 0.15s, opacity 0.15s;
|
|
}
|
|
.btn-new-conv:hover {
|
|
opacity: 0.9;
|
|
box-shadow: 0 0 14px rgba(129, 140, 248, 0.35);
|
|
}
|
|
|
|
.btn-select-mode {
|
|
background: none;
|
|
border: 1px solid var(--color-border);
|
|
border-radius: var(--radius-sm);
|
|
color: var(--color-text-muted);
|
|
font-size: 0.82rem;
|
|
padding: 0.4rem 0.6rem;
|
|
cursor: pointer;
|
|
white-space: nowrap;
|
|
}
|
|
.btn-select-mode:hover,
|
|
.btn-select-mode.active { border-color: var(--color-primary); color: var(--color-primary); }
|
|
|
|
.bulk-bar {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
padding: 0.3rem 0.75rem;
|
|
background: color-mix(in srgb, var(--color-primary) 6%, var(--color-bg-secondary));
|
|
border-bottom: 1px solid var(--color-border);
|
|
flex-shrink: 0;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.bulk-count { font-size: 0.75rem; color: var(--color-text-muted); flex-shrink: 0; }
|
|
.bulk-link {
|
|
background: none; border: none; color: var(--color-primary);
|
|
font-size: 0.75rem; cursor: pointer; padding: 0; text-decoration: underline;
|
|
}
|
|
.bulk-delete-btn {
|
|
margin-left: auto;
|
|
background: none;
|
|
border: 1px solid var(--color-danger, #e74c3c);
|
|
color: var(--color-danger, #e74c3c);
|
|
border-radius: 4px;
|
|
font-size: 0.75rem;
|
|
font-weight: 600;
|
|
padding: 0.2rem 0.55rem;
|
|
cursor: pointer;
|
|
}
|
|
.bulk-delete-btn:disabled { opacity: 0.5; cursor: default; }
|
|
.bulk-delete-btn.confirm { background: var(--color-danger, #e74c3c); color: #fff; }
|
|
|
|
.conv-checkbox {
|
|
flex-shrink: 0;
|
|
accent-color: var(--color-primary);
|
|
cursor: pointer;
|
|
width: 0.9rem;
|
|
height: 0.9rem;
|
|
}
|
|
.conv-item.selected {
|
|
background: color-mix(in srgb, var(--color-primary) 8%, var(--color-bg-secondary));
|
|
}
|
|
|
|
.conv-list {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
padding: 0 0.5rem 0.5rem;
|
|
}
|
|
.conv-group-label {
|
|
font-size: 0.68rem;
|
|
font-weight: 700;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.06em;
|
|
color: var(--color-text-muted);
|
|
padding: 0.6rem 0.75rem 0.2rem;
|
|
position: sticky;
|
|
top: 0;
|
|
background: var(--color-surface);
|
|
z-index: 1;
|
|
}
|
|
.conv-item {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 0.5rem 0.75rem;
|
|
border-radius: var(--radius-sm);
|
|
cursor: pointer;
|
|
margin-bottom: 0.25rem;
|
|
border-left: 3px solid transparent;
|
|
transition: background 0.15s, border-color 0.15s;
|
|
}
|
|
.conv-item:hover { background: rgba(99,102,241,0.05); border-left-color: var(--color-primary); }
|
|
.conv-item.active {
|
|
background: color-mix(in srgb, var(--color-primary) 15%, transparent);
|
|
color: var(--color-primary);
|
|
border-left-color: var(--color-primary);
|
|
}
|
|
.conv-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
|
|
.conv-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }
|
|
.conv-date { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 1px; }
|
|
.btn-delete-conv {
|
|
background: none; border: none; color: var(--color-text-muted);
|
|
cursor: pointer; font-size: 1.2rem; padding: 0 0.25rem; line-height: 1;
|
|
}
|
|
.btn-delete-conv:hover { color: var(--color-danger, #e74c3c); }
|
|
|
|
.chat-main {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* ChatPanel fills the remaining space in chat-main */
|
|
.chat-panel-fill {
|
|
flex: 1;
|
|
min-height: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.chat-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
padding: 0.75rem 1rem;
|
|
border-bottom: 1px solid var(--color-border);
|
|
flex-shrink: 0;
|
|
}
|
|
.chat-header h2 {
|
|
margin: 0;
|
|
font-size: 1.1rem;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.btn-summarize {
|
|
padding: 0.3rem 0.75rem;
|
|
background: var(--color-bg-secondary);
|
|
color: var(--color-text);
|
|
border: 1px solid var(--color-border);
|
|
border-radius: var(--radius-sm);
|
|
cursor: pointer;
|
|
font-size: 0.85rem;
|
|
white-space: nowrap;
|
|
}
|
|
.btn-summarize:hover:not(:disabled) {
|
|
background: var(--color-primary); color: #fff; border-color: var(--color-primary);
|
|
}
|
|
.btn-summarize:disabled { opacity: 0.6; cursor: default; }
|
|
|
|
.btn-attach {
|
|
background: none;
|
|
border: none;
|
|
cursor: pointer;
|
|
color: var(--color-text-muted);
|
|
opacity: 0.6;
|
|
padding: 0.2rem;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
.btn-attach:hover { opacity: 1; }
|
|
.btn-attach:disabled { opacity: 0.25; cursor: default; }
|
|
|
|
.research-wrapper { position: relative; }
|
|
.research-modal {
|
|
position: absolute;
|
|
top: calc(100% + 8px);
|
|
right: 0;
|
|
background: var(--color-bg-card);
|
|
border: 1px solid var(--color-border);
|
|
border-radius: var(--radius-md);
|
|
box-shadow: 0 4px 20px var(--color-shadow);
|
|
padding: 0.75rem;
|
|
min-width: 280px;
|
|
z-index: 20;
|
|
}
|
|
.research-modal-header {
|
|
font-size: 0.8rem;
|
|
font-weight: 600;
|
|
color: var(--color-text-muted);
|
|
margin-bottom: 0.5rem;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
}
|
|
.research-topic-input {
|
|
width: 100%;
|
|
padding: 0.45rem 0.65rem;
|
|
border: 1px solid var(--color-border);
|
|
border-radius: var(--radius-sm);
|
|
background: var(--color-bg);
|
|
color: var(--color-text);
|
|
font-size: 0.9rem;
|
|
outline: none;
|
|
font-family: inherit;
|
|
box-sizing: border-box;
|
|
}
|
|
.research-topic-input:focus { border-color: var(--color-primary); }
|
|
.research-modal-actions {
|
|
display: flex;
|
|
gap: 0.5rem;
|
|
margin-top: 0.5rem;
|
|
justify-content: flex-end;
|
|
}
|
|
.btn-research-cancel {
|
|
background: none; border: 1px solid var(--color-border);
|
|
border-radius: var(--radius-sm); padding: 0.3rem 0.65rem;
|
|
font-size: 0.85rem; cursor: pointer; color: var(--color-text-muted);
|
|
}
|
|
.btn-research-cancel:hover { border-color: var(--color-text-muted); }
|
|
.btn-research-go {
|
|
background: var(--color-primary); color: #fff; border: none;
|
|
border-radius: var(--radius-sm); padding: 0.3rem 0.75rem;
|
|
font-size: 0.85rem; cursor: pointer; font-weight: 600;
|
|
}
|
|
.btn-research-go:disabled { opacity: 0.4; cursor: default; }
|
|
.btn-research-go:not(:disabled):hover { opacity: 0.9; }
|
|
|
|
.no-conversation {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 1rem;
|
|
color: var(--color-text-muted);
|
|
}
|
|
.no-conversation .btn-new-conv {
|
|
flex: none;
|
|
}
|
|
|
|
.empty-msg {
|
|
color: var(--color-text-muted);
|
|
font-size: 0.9rem;
|
|
text-align: center;
|
|
padding: 2rem 1rem;
|
|
}
|
|
|
|
.btn-sidebar-toggle {
|
|
background: none; border: none; cursor: pointer;
|
|
color: var(--color-text-muted); padding: 0.2rem;
|
|
display: flex; align-items: center;
|
|
}
|
|
.btn-sidebar-toggle:hover { color: var(--color-text); }
|
|
|
|
.sidebar-overlay {
|
|
position: fixed; inset: 0; background: var(--color-overlay); z-index: 99;
|
|
}
|
|
|
|
@media (min-width: 768px) {
|
|
.hide-desktop { display: none; }
|
|
.chat-sidebar { position: relative; transform: none !important; }
|
|
}
|
|
|
|
@media (max-width: 767px) {
|
|
.chat-sidebar {
|
|
position: fixed; left: 0; top: 0; bottom: 0;
|
|
z-index: 100; transform: translateX(-100%);
|
|
transition: transform 0.25s ease;
|
|
box-shadow: 4px 0 16px rgba(0,0,0,0.2);
|
|
}
|
|
.chat-sidebar.open { transform: translateX(0); }
|
|
}
|
|
</style>
|