Skip to content

Commit e6ecdff

Browse files
committed
finished details sidebar for LMPs
1 parent 6898834 commit e6ecdff

File tree

3 files changed

+39
-21
lines changed

3 files changed

+39
-21
lines changed

ell-studio/src/components/LMPDetailsSidePanel.js

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function LMPDetailsSidePanel({ lmp, uses, versionHistory }) {
4747
<div className="space-y-4">
4848
<div className="bg-[#161b22] p-3 rounded">
4949
<div className="flex justify-between items-center mb-2">
50-
<h3 className="text-sm font-semibold text-white">Version</h3>
50+
<h3 className="text-md font-semibold text-white">Version</h3>
5151
<VersionBadge version={lmp.version_number + 1} hash={lmp.lmp_id} />
5252
</div>
5353
<StatItem icon={FiClock} label="Created" value={getTimeAgo(new Date(lmp.created_at))} />
@@ -58,15 +58,15 @@ function LMPDetailsSidePanel({ lmp, uses, versionHistory }) {
5858

5959
{lmp.lm_kwargs && (
6060
<div className="bg-[#161b22] p-3 rounded">
61-
<h3 className="text-sm font-semibold mb-2 text-white">LM Keywords</h3>
61+
<h3 className="text-md font-semibold mb-2 text-white">LM Keywords</h3>
6262
<pre className="overflow-x-auto text-xs text-gray-300">
6363
<code>{JSON.stringify(lmp.lm_kwargs, null, 2)}</code>
6464
</pre>
6565
</div>
6666
)}
6767

6868
<div className="bg-[#161b22] p-3 rounded">
69-
<h3 className="text-sm font-semibold mb-2 text-white">Uses</h3>
69+
<h3 className="text-md font-semibold mb-2 text-white">Uses</h3>
7070
{uses && uses.length > 0 ? (
7171
<ul className="space-y-1">
7272
{uses.filter(use => !!use).map((use) => (
@@ -101,19 +101,33 @@ function LMPDetailsSidePanel({ lmp, uses, versionHistory }) {
101101

102102
<div className="bg-[#161b22] p-3 rounded">
103103
<h3 className="text-sm font-semibold mb-2 text-white">Version History</h3>
104-
<div className="space-y-1 max-h-48 overflow-y-auto">
104+
<div className="space-y-2 max-h-48 overflow-y-auto">
105105
{versionHistory.map((version, index) => (
106106
<Link
107107
key={version.lmp_id}
108108
to={`/lmp/${version.name}/${version.lmp_id}`}
109-
className={`block text-xs ${version.lmp_id === lmp.lmp_id ? 'text-blue-400 font-semibold' : 'text-gray-400'} hover:text-white`}
109+
className={`block p-2 rounded ${
110+
version.lmp_id === lmp.lmp_id
111+
? 'bg-blue-900 bg-opacity-30'
112+
: 'hover:bg-gray-800'
113+
}`}
110114
>
111-
<div className="flex justify-between items-center">
112-
<span>v{versionHistory.length - index}</span>
113-
<span>{getTimeAgo(new Date(version.created_at))}</span>
115+
<div className="flex justify-between items-center text-sm">
116+
<span className={`font-semibold ${
117+
version.lmp_id === lmp.lmp_id ? 'text-blue-400' : 'text-white'
118+
}`}>
119+
v{versionHistory.length - index}
120+
</span>
121+
<span className="text-gray-400 text-xs">
122+
<FiCalendar className="inline mr-1" size={12} />
123+
{format(new Date(version.created_at), 'MMM d, yyyy')}
124+
</span>
114125
</div>
115126
{version.commit_message && (
116-
<p className="text-gray-500 truncate">{version.commit_message}</p>
127+
<p className="text-gray-400 text-xs mt-1 truncate">
128+
<FiGitCommit className="inline mr-1" size={12} />
129+
{version.commit_message}
130+
</p>
117131
)}
118132
</Link>
119133
))}

ell-studio/src/components/MetricChart.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ function MetricChart({ rawData, dataKey, color, title, yAxisLabel, aggregation="
182182
return (
183183
<div className="bg-[#161b22] p-4 rounded-lg shadow-lg">
184184
<div className="flex justify-between items-center mb-4">
185-
<h3 className="text-lg font-semibold text-white">{title}</h3>
185+
<h3 className="text-md font-semibold text-white">{title}</h3>
186186
<select
187-
className="bg-[#0d1117] text-white border border-gray-700 rounded px-2 py-1"
187+
className="bg-[#0d1117] text-white text-sm border border-gray-700 rounded px-2 py-1"
188188
value={selectedTimeRange}
189189
onChange={(e) => setSelectedTimeRange(e.target.value)}
190190
>
@@ -195,11 +195,11 @@ function MetricChart({ rawData, dataKey, color, title, yAxisLabel, aggregation="
195195
))}
196196
</select>
197197
</div>
198-
<div className="h-80">
198+
<div className="h-64">
199199
<ResponsiveContainer width="100%" height="100%">
200200
<AreaChart
201201
data={aggregatedData}
202-
margin={{ top: 10, right: 30, left: 0, bottom: 0 }}
202+
margin={{ top: 5, right: 20, left: 0, bottom: 0 }}
203203
>
204204
<defs>
205205
<linearGradient id={`color${title}`} x1="0" y1="0" x2="0" y2="1">
@@ -210,17 +210,18 @@ function MetricChart({ rawData, dataKey, color, title, yAxisLabel, aggregation="
210210
<XAxis
211211
dataKey="date"
212212
stroke="#4a5568"
213-
tick={{ fill: "#4a5568" }}
213+
tick={{ fill: "#4a5568", fontSize: 10 }}
214214
tickFormatter={formatXAxis}
215215
/>
216216
<YAxis
217217
stroke="#4a5568"
218-
tick={{ fill: "#4a5568" }}
218+
tick={{ fill: "#4a5568", fontSize: 10 }}
219219
label={{
220220
value: yAxisLabel,
221221
angle: -90,
222222
position: "insideLeft",
223223
fill: "#4a5568",
224+
fontSize: 12,
224225
}}
225226
/>
226227
<CartesianGrid strokeDasharray="3 3" stroke="#2d3748" />
@@ -229,11 +230,12 @@ function MetricChart({ rawData, dataKey, color, title, yAxisLabel, aggregation="
229230
backgroundColor: "#1f2937",
230231
border: "none",
231232
color: "#fff",
233+
fontSize: 12,
232234
}}
233235
labelFormatter={(label) => format(new Date(label), "PPpp")}
234236
formatter={formatTooltip}
235237
/>
236-
<Legend />
238+
<Legend wrapperStyle={{ fontSize: 12 }} />
237239
<Area
238240
type="monotone"
239241
dataKey={dataKey}
@@ -244,7 +246,7 @@ function MetricChart({ rawData, dataKey, color, title, yAxisLabel, aggregation="
244246
/>
245247
<Brush
246248
dataKey="date"
247-
height={30}
249+
height={20}
248250
stroke={color}
249251
fill="#161b22"
250252
onChange={handleZoom}

ell-studio/src/pages/LMP.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,13 @@ function LMP() {
291291
<>
292292
<ResizableHandle withHandle />
293293
<ResizablePanel defaultSize={30} minSize={20}>
294-
<LMPDetailsSidePanel
295-
lmp={lmp}
294+
<div className="h-full overflow-y-auto hide-scrollbar">
295+
<LMPDetailsSidePanel
296+
lmp={lmp}
296297
uses={uses}
297-
versionHistory={versionHistory}
298-
/>
298+
versionHistory={versionHistory}
299+
/>
300+
</div>
299301
</ResizablePanel>
300302
</>
301303
)}

0 commit comments

Comments
 (0)