Skip to content

Commit 39d4a2f

Browse files
fix: improve dashboard UI (View as row, icon, chat markdown)
Address three dashboard UI issues from product feedback: 1. Hide View as row in immersive mode (DashboardWorkspace) - ProfileSwitch is now hidden when immersive mode is active - Reclaims vertical space in the dashboard editor - File: src/pages/Home.jsx 2. Change dashboard icon to monochrome outline style - Removed purple filled square background (#534AB7) - Now uses simple grey LineChart icon that matches app iconography - Files: src/components/sections/DashboardWorkspace.jsx, src/components/sections/DashboardWorkspace.module.css 3. Add markdown rendering to dashboard chat bubbles - Agent responses now render with ReactMarkdown + remark-gfm - Added CSS styles for bullets, code blocks, headers, links - Makes agent replies more scannable with proper structure - Files: src/components/sections/DashboardWorkspace.jsx, src/components/sections/DashboardWorkspace.module.css Co-authored-by: Venkat SF <venkatesh.sakamuri@stayflexi.com>
1 parent 17c60bb commit 39d4a2f

3 files changed

Lines changed: 68 additions & 11 deletions

File tree

‎src/components/sections/DashboardWorkspace.jsx‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { useState, useEffect, useRef, useCallback, lazy, Suspense } from 'react'
22
import { LineChart, ArrowUp, ChevronLeft, Sparkles, Check, Loader2, Brain, PencilRuler, Pencil, ClipboardCheck, TrendingUp, Users, PieChart, Layers, Code2, X, Copy, Undo2, Play, Database, History, RotateCcw, Eye, RefreshCw, ChevronDown, BellRing, Trash2 } from 'lucide-react'
3+
import ReactMarkdown from 'react-markdown'
4+
import remarkGfm from 'remark-gfm'
35
import DashboardArtifact from '@/components/DashboardArtifact'
46
import ShareMenu from './ShareMenu'
57
import { savedDashboardsAPI } from '@/lib/api/client'
@@ -506,7 +508,7 @@ export default function DashboardWorkspace({ connectionId, dashboard, onClose })
506508
<div className={styles.root}>
507509
<header className={styles.topbar}>
508510
<button className={styles.logoBtn} onClick={onClose} title="Back to dashboards" aria-label="Back to dashboards">
509-
<span className={styles.logoMark}><LineChart size={15} color="#fff" /></span>
511+
<LineChart size={18} className={styles.logoIcon} />
510512
</button>
511513
<button className={styles.crumbLink} onClick={onClose}>Dashboards</button>
512514
<span className={styles.sep}>/</span>
@@ -556,7 +558,11 @@ export default function DashboardWorkspace({ connectionId, dashboard, onClose })
556558
<div className={intro ? styles.agentScrollIntro : styles.agentScroll} ref={scrollRef}>
557559
{!intro && messages.map((msg, i) => (
558560
<div key={i} className={msg.role === 'user' ? styles.bubbleUser : (msg.error ? styles.bubbleErr : styles.bubbleAgent)}>
559-
{msg.text}
561+
{msg.role === 'agent' && !msg.error ? (
562+
<div className={styles.agentMarkdown}>
563+
<ReactMarkdown remarkPlugins={[remarkGfm]}>{msg.text}</ReactMarkdown>
564+
</div>
565+
) : msg.text}
560566
</div>
561567
))}
562568
{!intro && thinking && (

‎src/components/sections/DashboardWorkspace.module.css‎

Lines changed: 59 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,12 @@
3838
}
3939
.logoBtn:active { transform: scale(0.92); }
4040

41-
.logoMark {
42-
width: 26px;
43-
height: 26px;
44-
border-radius: 7px;
45-
background: #534AB7;
46-
display: flex;
47-
align-items: center;
48-
justify-content: center;
41+
.logoIcon {
42+
color: #555;
43+
flex-shrink: 0;
44+
transition: color 120ms ease-out;
4945
}
46+
.logoBtn:hover .logoIcon { color: #111; }
5047

5148
.crumbLink {
5249
border: none;
@@ -306,6 +303,60 @@
306303
animation: bubbleIn 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
307304
}
308305

306+
.agentMarkdown {
307+
font-size: 13px;
308+
line-height: 1.6;
309+
color: #26262a;
310+
}
311+
.agentMarkdown p { margin: 0 0 8px; }
312+
.agentMarkdown p:last-child { margin-bottom: 0; }
313+
.agentMarkdown ul, .agentMarkdown ol {
314+
margin: 6px 0;
315+
padding-left: 18px;
316+
}
317+
.agentMarkdown li {
318+
margin: 3px 0;
319+
}
320+
.agentMarkdown li::marker {
321+
color: #9a97ad;
322+
}
323+
.agentMarkdown strong {
324+
font-weight: 600;
325+
color: #111;
326+
}
327+
.agentMarkdown code {
328+
font-family: ui-monospace, "SF Mono", Menlo, monospace;
329+
font-size: 12px;
330+
background: #f5f5f7;
331+
padding: 1px 5px;
332+
border-radius: 4px;
333+
}
334+
.agentMarkdown pre {
335+
background: #f5f5f7;
336+
border-radius: 6px;
337+
padding: 10px 12px;
338+
overflow-x: auto;
339+
margin: 8px 0;
340+
}
341+
.agentMarkdown pre code {
342+
background: none;
343+
padding: 0;
344+
}
345+
.agentMarkdown h1, .agentMarkdown h2, .agentMarkdown h3 {
346+
font-size: 13px;
347+
font-weight: 600;
348+
margin: 10px 0 6px;
349+
color: #111;
350+
}
351+
.agentMarkdown h1:first-child, .agentMarkdown h2:first-child, .agentMarkdown h3:first-child {
352+
margin-top: 0;
353+
}
354+
.agentMarkdown a {
355+
color: #534AB7;
356+
text-decoration: none;
357+
}
358+
.agentMarkdown a:hover { text-decoration: underline; }
359+
309360
.bubbleUser {
310361
align-self: flex-end;
311362
max-width: 92%;

‎src/pages/Home.jsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export default function Home() {
7979

8080
{/* Main content — lazy-mount sections on first visit, then keep alive */}
8181
<div style={{ flex: 1, overflow: 'hidden', position: 'relative', display: 'flex', flexDirection: 'column' }}>
82-
{canSwitchProfile && <ProfileSwitch />}
82+
{canSwitchProfile && !immersive && <ProfileSwitch />}
8383
<div style={{ flex: 1, overflow: 'hidden', position: 'relative' }}>
8484
{visibleSections.map(([key, Section]) => {
8585
if (!mounted.has(key)) return null

0 commit comments

Comments
 (0)