From 1dde7dfc5b46a1e6c4078d2c75c23409838953e1 Mon Sep 17 00:00:00 2001 From: Muyue Date: Sat, 18 Oct 2025 23:52:07 +0200 Subject: [PATCH] Improve session discovery UI with intuitive navigation - Add stats bar showing completed/in-progress/total sessions count - Add status filter tabs (All, Completed, In Progress) - Add horizontal carousel display for recent sessions - Add 'View All Sessions' expandable button - Add visual divider between recent sessions and new session form - Improve session cards with better information display - Make sessions more discoverable and easier to access - Add filtering and sorting capabilities for better UX --- .../src/components/CollaborativeInput.vue | 346 ++++++++++++++++-- 1 file changed, 325 insertions(+), 21 deletions(-) diff --git a/frontend/src/components/CollaborativeInput.vue b/frontend/src/components/CollaborativeInput.vue index 9bc27f4..ef9dd53 100644 --- a/frontend/src/components/CollaborativeInput.vue +++ b/frontend/src/components/CollaborativeInput.vue @@ -12,6 +12,8 @@ const agentCount = ref(7) const isCreating = ref(false) const previousSessions = ref([]) const loadingPreviousSessions = ref(false) +const showAllSessions = ref(false) +const sessionStatusFilter = ref('all') // 'all', 'completed', 'ongoing', 'created' onMounted(async () => { loadingPreviousSessions.value = true @@ -37,6 +39,28 @@ const agentOptions = computed(() => { })) }) +const filteredSessions = computed(() => { + let filtered = previousSessions.value + + if (sessionStatusFilter.value !== 'all') { + filtered = filtered.filter(s => s.status === sessionStatusFilter.value) + } + + return filtered +}) + +const displayedSessions = computed(() => { + return showAllSessions.value ? filteredSessions.value : filteredSessions.value.slice(0, 6) +}) + +const completedCount = computed(() => { + return previousSessions.value.filter(s => s.status === 'completed').length +}) + +const ongoingCount = computed(() => { + return previousSessions.value.filter(s => s.status === 'ongoing').length +}) + const handleFileSelect = (event) => { const file = event.target.files?.[0] if (file) { @@ -112,6 +136,88 @@ const removeFile = () => {

+ +
+
+
+ Completed + {{ completedCount }} +
+
+ In Progress + {{ ongoingCount }} +
+
+ Total + {{ previousSessions.length }} +
+
+ + +
+ + + +
+ + +
+ +
+ +
+ +
+
+ + +
+ Or start a new session +
+
@@ -201,27 +307,6 @@ const removeFile = () => { - -
-

Recent Sessions

-
-
-
- #{{ session.sessionId }} - {{ session.status }} -
-

{{ session.prompt.substring(0, 100) }}...

-

{{ new Date(session.createdAt).toLocaleDateString() }}

-
-
-
- @@ -617,6 +702,225 @@ const removeFile = () => { font-size: 0.85rem; } +/* Quick Access Section */ +.quick-access-section { + margin-bottom: 2rem; +} + +.stats-bar { + display: flex; + gap: 1.5rem; + margin-bottom: 1.5rem; + padding: 1rem 1.5rem; + background: rgba(102, 126, 234, 0.08); + border: 1px solid rgba(102, 126, 234, 0.2); + border-radius: 12px; + backdrop-filter: blur(10px); +} + +.stat { + display: flex; + flex-direction: column; + align-items: center; +} + +.stat-label { + font-size: 0.8rem; + color: rgba(255, 255, 255, 0.5); + text-transform: uppercase; + letter-spacing: 0.5px; + font-weight: 600; +} + +.stat-value { + font-size: 1.8rem; + color: rgba(102, 126, 234, 0.95); + font-weight: 700; + margin-top: 0.25rem; +} + +.filter-tabs { + display: flex; + gap: 0.75rem; + margin-bottom: 1.5rem; + flex-wrap: wrap; +} + +.filter-btn { + padding: 0.6rem 1.2rem; + background: rgba(255, 255, 255, 0.05); + border: 1px solid rgba(255, 255, 255, 0.1); + color: rgba(255, 255, 255, 0.6); + border-radius: 8px; + cursor: pointer; + font-size: 0.9rem; + font-weight: 500; + transition: all 0.3s ease; + backdrop-filter: blur(5px); +} + +.filter-btn:hover { + background: rgba(102, 126, 234, 0.2); + border-color: rgba(102, 126, 234, 0.4); + color: rgba(255, 255, 255, 0.8); +} + +.filter-btn.active { + background: rgba(102, 126, 234, 0.3); + border-color: rgba(102, 126, 234, 0.6); + color: rgba(255, 255, 255, 0.95); + box-shadow: 0 0 15px rgba(102, 126, 234, 0.2); +} + +.recent-sessions-scroll { + overflow-x: auto; + margin-bottom: 1rem; + padding-bottom: 0.5rem; +} + +.sessions-carousel { + display: flex; + gap: 1rem; + min-width: min-content; +} + +.session-card-horizontal { + display: flex; + align-items: center; + gap: 1rem; + min-width: 350px; + padding: 1rem; + background: rgba(102, 126, 234, 0.1); + border: 1px solid rgba(102, 126, 234, 0.3); + border-radius: 12px; + cursor: pointer; + transition: all 0.3s ease; + backdrop-filter: blur(10px); +} + +.session-card-horizontal:hover { + background: rgba(102, 126, 234, 0.15); + border-color: rgba(102, 126, 234, 0.5); + transform: translateY(-2px); + box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2); +} + +.session-card-horizontal.status-completed { + border-color: rgba(76, 175, 80, 0.3); + background: rgba(76, 175, 80, 0.05); +} + +.session-card-horizontal.status-completed:hover { + background: rgba(76, 175, 80, 0.12); + border-color: rgba(76, 175, 80, 0.5); + box-shadow: 0 8px 20px rgba(76, 175, 80, 0.15); +} + +.card-left { + flex-shrink: 0; +} + +.card-main { + flex: 1; + min-width: 0; +} + +.session-prompt-short { + margin: 0; + color: rgba(255, 255, 255, 0.8); + font-size: 0.95rem; + font-weight: 500; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.session-meta { + margin: 0.25rem 0 0 0; + color: rgba(255, 255, 255, 0.4); + font-size: 0.8rem; +} + +.card-right { + flex-shrink: 0; +} + +.status-badge { + display: inline-flex; + align-items: center; + padding: 0.4rem 0.8rem; + background: rgba(76, 175, 80, 0.2); + color: rgba(76, 175, 80, 0.9); + border-radius: 20px; + font-size: 0.75rem; + font-weight: 600; + text-transform: capitalize; + white-space: nowrap; +} + +.session-card-horizontal.status-ongoing .status-badge { + background: rgba(102, 126, 234, 0.2); + color: rgba(102, 126, 234, 0.9); +} + +.view-all-container { + text-align: center; + margin-top: 1rem; +} + +.view-all-btn { + padding: 0.7rem 1.5rem; + background: rgba(102, 126, 234, 0.15); + border: 1px solid rgba(102, 126, 234, 0.3); + color: rgba(102, 126, 234, 0.9); + border-radius: 8px; + cursor: pointer; + font-size: 0.9rem; + font-weight: 600; + transition: all 0.3s ease; + backdrop-filter: blur(5px); +} + +.view-all-btn:hover { + background: rgba(102, 126, 234, 0.25); + border-color: rgba(102, 126, 234, 0.5); + box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15); +} + +.divider { + text-align: center; + margin: 2rem 0; + position: relative; +} + +.divider span { + background: linear-gradient( + -45deg, + #0f0c29 0%, + #302b63 25%, + #24243e 50%, + #302b63 75%, + #0f0c29 100% + ); + padding: 0 1rem; + color: rgba(255, 255, 255, 0.4); + font-size: 0.9rem; + font-weight: 500; + position: relative; + z-index: 1; +} + +.divider::before { + content: ''; + position: absolute; + top: 50%; + left: 0; + right: 0; + height: 1px; + background: linear-gradient(to right, transparent, rgba(102, 126, 234, 0.2), transparent); + z-index: 0; +} + @media (max-width: 768px) { .collaborative-input { padding: 1rem;