Skip to content

Commit 925057b

Browse files
CopilotBoshen
andauthored
Improve UI: Move bundle size tab first, remove file types, implement enhanced navigation design (#41)
* Initial plan * Complete UI improvements: reorder tabs, remove file types, enhance affordance Co-authored-by: Boshen <[email protected]> * Remove background from navigation tabs Co-authored-by: Boshen <[email protected]> * Remove border-based visual feedback from navigation tabs Co-authored-by: Boshen <[email protected]> * Revert button changes and remove background from dashboard nav container Co-authored-by: Boshen <[email protected]> * u --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Boshen <[email protected]> Co-authored-by: Boshen <[email protected]>
1 parent 9181a47 commit 925057b

File tree

2 files changed

+61
-86
lines changed

2 files changed

+61
-86
lines changed

apps/dashboard/src/App.css

Lines changed: 54 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -51,72 +51,98 @@
5151
.header-subtitle {
5252
display: block;
5353
}
54-
54+
5555
.header-content {
5656
justify-content: flex-start;
5757
gap: 2rem;
5858
}
59-
59+
6060
.logo h1 {
6161
font-size: 1.75rem;
6262
}
6363
}
6464

6565
/* Navigation */
6666
.dashboard-nav {
67-
background: white;
68-
border: 1px solid #e5e5e5;
67+
background: transparent;
6968
padding: 1.25rem 2rem;
70-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
7169
display: flex;
72-
gap: 1rem;
70+
gap: 0.5rem;
7371
max-width: 1200px;
7472
margin: 0 auto;
73+
border-radius: 0.75rem;
74+
margin-top: -0.5rem;
75+
position: relative;
76+
z-index: 10;
7577
}
7678

77-
78-
7979
.nav-button {
8080
display: flex;
8181
align-items: center;
8282
gap: 0.625rem;
8383
padding: 1rem 2rem;
84-
border: 1px solid #d1d5db;
85-
background: white;
86-
border-radius: 0.5rem;
84+
border: 2px solid transparent;
85+
background: transparent;
86+
border-radius: 0.75rem;
8787
cursor: pointer;
8888
font-weight: 600;
8989
font-size: 0.95rem;
90-
transition: all 0.2s ease;
91-
color: #374151;
90+
transition: all 0.3s ease;
91+
color: #64748b;
9292
text-transform: capitalize;
9393
letter-spacing: -0.025em;
94+
position: relative;
95+
overflow: hidden;
96+
min-width: 140px;
97+
justify-content: center;
9498
}
9599

96-
100+
.nav-button::before {
101+
content: '';
102+
position: absolute;
103+
top: 0;
104+
left: -100%;
105+
width: 100%;
106+
height: 100%;
107+
background: linear-gradient(90deg,
108+
transparent,
109+
rgba(255, 255, 255, 0.6),
110+
transparent);
111+
transition: left 0.5s ease;
112+
}
97113

98114
.nav-button:hover {
99-
background: #f9fafb;
100-
border-color: #6b7280;
101-
color: #111827;
102-
transform: translateY(-1px);
103-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
115+
background: transparent;
116+
border-color: #94a3b8;
117+
color: #475569;
118+
transform: translateY(-2px);
119+
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
120+
}
121+
122+
.nav-button:hover::before {
123+
left: 100%;
104124
}
105125

106126
.nav-button.active {
107-
background: #000000;
127+
background: transparent;
108128
border-color: #000000;
109-
color: white;
110-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
129+
color: #000000;
130+
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
131+
transform: translateY(-1px);
111132
}
112133

113134
.nav-button.active::before {
114-
background: linear-gradient(90deg,
115-
transparent,
116-
rgba(255, 255, 255, 0.2),
135+
background: linear-gradient(90deg,
136+
transparent,
137+
rgba(255, 255, 255, 0.2),
117138
transparent);
118139
}
119140

141+
.nav-button.active:hover {
142+
transform: translateY(-3px);
143+
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
144+
}
145+
120146
/* Main Content */
121147
.dashboard-main {
122148
max-width: 1200px;
@@ -216,15 +242,15 @@
216242
flex-direction: column;
217243
gap: 0.5rem;
218244
}
219-
245+
220246
.dashboard-main {
221247
padding: 1rem;
222248
}
223-
249+
224250
.chart-container {
225251
padding: 1rem;
226252
}
227-
253+
228254
.stats-grid {
229255
grid-template-columns: 1fr;
230256
}

apps/dashboard/src/App.tsx

Lines changed: 7 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useState } from 'react'
22
import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer, Cell } from 'recharts'
3-
import { BarChart3, Clock, Package, FileText } from 'lucide-react'
3+
import { BarChart3, Clock, Package } from 'lucide-react'
44
import './App.css'
55
import rolldownStats from '../../../rolldown-version-stats.json'
66

@@ -41,27 +41,8 @@ const bundleSizeDiffData = rolldownStats.map((stat, index) => {
4141
}
4242
})
4343

44-
// Calculate file type breakdown from all versions
45-
const fileTypeStats = rolldownStats.reduce((acc, stat) => {
46-
stat.files.forEach(file => {
47-
if (!acc[file.type]) {
48-
acc[file.type] = 0
49-
}
50-
acc[file.type] += file.size
51-
})
52-
return acc
53-
}, {} as Record<string, number>)
54-
55-
const fileTypeData = Object.entries(fileTypeStats).map(([type, size]) => ({
56-
name: type.toUpperCase(),
57-
js: type === 'js' ? Math.round(size / 1024) : 0,
58-
css: type === 'css' ? Math.round(size / 1024) : 0,
59-
html: type === 'html' ? Math.round(size / 1024) : 0,
60-
other: type === 'other' ? Math.round(size / 1024) : 0,
61-
})).filter(item => item.js > 0 || item.css > 0 || item.html > 0 || item.other > 0)
62-
6344
function App() {
64-
const [selectedMetric, setSelectedMetric] = useState('buildTime')
45+
const [selectedMetric, setSelectedMetric] = useState('bundleSize')
6546

6647
// Custom tooltip formatter for bundle size differences
6748
const bundleSizeDiffTooltipFormatter = (value: any, name: string, props: any) => {
@@ -80,9 +61,8 @@ function App() {
8061
}
8162

8263
const metrics = [
83-
{ id: 'buildTime', name: 'Build Time', icon: Clock, data: buildTimeData, color: '#000000' },
8464
{ id: 'bundleSize', name: 'Bundle Size', icon: Package, data: bundleSizeDiffData, color: '#374151' },
85-
{ id: 'fileTypes', name: 'File Types', icon: FileText, data: fileTypeData, color: '#6b7280' },
65+
{ id: 'buildTime', name: 'Build Time', icon: Clock, data: buildTimeData, color: '#000000' },
8666
]
8767

8868
const currentMetric = metrics.find(m => m.id === selectedMetric) || metrics[0]
@@ -119,38 +99,7 @@ function App() {
11999
<div className="chart-container">
120100
<h2>{currentMetric.name}</h2>
121101
<ResponsiveContainer width="100%" height={400}>
122-
{selectedMetric === 'fileTypes' ? (
123-
<BarChart data={currentMetric.data}>
124-
<CartesianGrid strokeDasharray="3 3" stroke="#e5e7eb" />
125-
<XAxis
126-
dataKey="name"
127-
tick={{ fill: '#374151', fontSize: 12 }}
128-
axisLine={{ stroke: '#d1d5db' }}
129-
tickLine={{ stroke: '#d1d5db' }}
130-
/>
131-
<YAxis
132-
tick={{ fill: '#374151', fontSize: 12 }}
133-
axisLine={{ stroke: '#d1d5db' }}
134-
tickLine={{ stroke: '#d1d5db' }}
135-
/>
136-
<Tooltip
137-
contentStyle={{
138-
backgroundColor: 'white',
139-
border: '1px solid #d1d5db',
140-
borderRadius: '0.5rem',
141-
color: '#111827',
142-
boxShadow: '0 4px 8px rgba(0, 0, 0, 0.1)'
143-
}}
144-
/>
145-
<Legend
146-
wrapperStyle={{ color: '#374151' }}
147-
/>
148-
<Bar dataKey="js" fill="#000000" name="JavaScript (KB)" />
149-
<Bar dataKey="css" fill="#374151" name="CSS (KB)" />
150-
<Bar dataKey="html" fill="#6b7280" name="HTML (KB)" />
151-
<Bar dataKey="other" fill="#9ca3af" name="Other (KB)" />
152-
</BarChart>
153-
) : selectedMetric === 'bundleSize' ? (
102+
{selectedMetric === 'bundleSize' ? (
154103
<BarChart data={currentMetric.data}>
155104
<CartesianGrid strokeDasharray="3 3" stroke="#e5e7eb" />
156105
<XAxis
@@ -240,9 +189,9 @@ function App() {
240189
<span className="stat-change positive">v{rolldownStats[rolldownStats.length - 1]?.version}</span>
241190
</div>
242191
<div className="stat-card">
243-
<h3>Total File Types</h3>
244-
<p className="stat-value">{fileTypeData.length}</p>
245-
<span className="stat-change positive">JS, CSS, HTML, Other</span>
192+
<h3>Bundle Size Range</h3>
193+
<p className="stat-value">{Math.round((Math.max(...rolldownStats.map(s => s.totalSize)) - Math.min(...rolldownStats.map(s => s.totalSize))) / 1024)}KB</p>
194+
<span className="stat-change positive">Size Variation</span>
246195
</div>
247196
<div className="stat-card">
248197
<h3>Versions Tested</h3>

0 commit comments

Comments
 (0)