Skip to content

Commit 56ae2ab

Browse files
authored
Bottom drawer taller by default, compact toolbar (#35)
* feat: taller bottom drawer default and compact log viewer toolbar Increase default expanded height from 400px to 550px so the bottom drawer shows more content by default. Make the LogViewerToolbar more compact by switching buttons to xs size, reducing icon sizes to 12px, and tightening padding/gaps. * fix: clamp drawer height to viewport, fix clear button hit target Clamp expandDrawerToHeight to window.innerHeight so the 550px default doesn't overflow on short viewports. Restore the clear-search button hit target to 24px to match the xs IconButton default.
1 parent af00025 commit 56ae2ab

2 files changed

Lines changed: 41 additions & 43 deletions

File tree

ui/layouts/core/main/BottomDrawer/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const drawerExpandedHeightStorageKey = 'omniview.bottomDrawer.expandedHeight';
3737
*/
3838
const BottomDrawerContainer: React.FC = () => {
3939
const minHeight = 32;
40-
const defaultHeight = 400;
40+
const defaultHeight = 550;
4141

4242
const { tabs, focused } = useBottomDrawer();
4343
const hasTabs = tabs.length > 0;
@@ -96,9 +96,7 @@ const BottomDrawerContainer: React.FC = () => {
9696
return;
9797
}
9898

99-
if (height < minHeight) {
100-
height = minHeight;
101-
}
99+
height = Math.min(Math.max(height, minHeight), window.innerHeight);
102100

103101
// Track the last non-minimized, non-fullscreen height for restore
104102
if (height > minHeight && height < window.innerHeight) {

ui/providers/BottomDrawer/containers/LogViewer/LogViewerToolbar.tsx

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ const LogViewerToolbar: React.FC<Props> = ({
144144
sx={{
145145
display: 'flex',
146146
alignItems: 'center',
147-
gap: 0.5,
148-
px: 1,
149-
py: 0.5,
147+
gap: 0.25,
148+
px: 0.75,
149+
py: 0.25,
150150
borderBottom: '1px solid',
151151
borderColor: 'divider',
152152
bgcolor: 'background.surface',
153-
minHeight: 32,
153+
minHeight: 28,
154154
flexShrink: 0,
155155
}}
156156
>
@@ -160,14 +160,14 @@ const LogViewerToolbar: React.FC<Props> = ({
160160

161161
{/* Search */}
162162
<TextField
163-
size="sm"
163+
size="xs"
164164
placeholder="Search in logs"
165165
autoFocus
166166
autoComplete="off"
167167
inputProps={{ 'data-search-input': true }}
168168
value={searchQuery}
169169
onChange={(value) => onSearchChange(value)}
170-
startAdornment={<LuSearch size={14} />}
170+
startAdornment={<LuSearch size={12} />}
171171
endAdornment={
172172
<>
173173
{matchCount > 0 ? (
@@ -181,13 +181,13 @@ const LogViewerToolbar: React.FC<Props> = ({
181181
) : null}
182182
{searchQuery && (
183183
<IconButton
184-
size="sm"
184+
size="xs"
185185
emphasis="ghost"
186186
color="neutral"
187187
onClick={() => onSearchChange('')}
188-
sx={{ minWidth: 0, minHeight: 0, width: 20, height: 20 }}
188+
sx={{ minWidth: 24, minHeight: 24, width: 24, height: 24 }}
189189
>
190-
<LuX size={12} />
190+
<LuX size={10} />
191191
</IconButton>
192192
)}
193193
</>
@@ -205,31 +205,31 @@ const LogViewerToolbar: React.FC<Props> = ({
205205

206206
<Tooltip content="Case sensitive">
207207
<IconButton
208-
size="sm"
208+
size="xs"
209209
emphasis={caseSensitive ? 'soft' : 'ghost'}
210210
color={caseSensitive ? 'primary' : 'neutral'}
211211
onClick={onToggleCaseSensitive}
212212
>
213-
<LuCaseSensitive size={14} />
213+
<LuCaseSensitive size={12} />
214214
</IconButton>
215215
</Tooltip>
216216

217217
<Tooltip content="Regex">
218218
<IconButton
219-
size="sm"
219+
size="xs"
220220
emphasis={isRegex ? 'soft' : 'ghost'}
221221
color={isRegex ? 'primary' : 'neutral'}
222222
onClick={onToggleRegex}
223223
>
224-
<LuRegex size={14} />
224+
<LuRegex size={12} />
225225
</IconButton>
226226
</Tooltip>
227227

228-
<IconButton size="sm" emphasis="ghost" disabled={matchCount === 0} {...prevHold}>
229-
<LuChevronUp size={14} />
228+
<IconButton size="xs" emphasis="ghost" disabled={matchCount === 0} {...prevHold}>
229+
<LuChevronUp size={12} />
230230
</IconButton>
231-
<IconButton size="sm" emphasis="ghost" disabled={matchCount === 0} {...nextHold}>
232-
<LuChevronDown size={14} />
231+
<IconButton size="xs" emphasis="ghost" disabled={matchCount === 0} {...nextHold}>
232+
<LuChevronDown size={12} />
233233
</IconButton>
234234

235235
<Divider orientation="vertical" sx={{ mx: 0.5 }} />
@@ -240,69 +240,69 @@ const LogViewerToolbar: React.FC<Props> = ({
240240
{/* Controls */}
241241
<Tooltip content="Timestamps">
242242
<IconButton
243-
size="sm"
243+
size="xs"
244244
emphasis={showTimestamps ? 'soft' : 'ghost'}
245245
color={showTimestamps ? 'primary' : 'neutral'}
246246
onClick={onToggleTimestamps}
247247
>
248-
<LuClock size={14} />
248+
<LuClock size={12} />
249249
</IconButton>
250250
</Tooltip>
251251

252252
<Tooltip content="Source badges">
253253
<IconButton
254-
size="sm"
254+
size="xs"
255255
emphasis={showSources ? 'soft' : 'ghost'}
256256
color={showSources ? 'primary' : 'neutral'}
257257
onClick={onToggleSources}
258258
>
259-
<LuTag size={14} />
259+
<LuTag size={12} />
260260
</IconButton>
261261
</Tooltip>
262262

263263
<Tooltip content="Line numbers">
264264
<IconButton
265-
size="sm"
265+
size="xs"
266266
emphasis={showLineNumbers ? 'soft' : 'ghost'}
267267
color={showLineNumbers ? 'primary' : 'neutral'}
268268
onClick={onToggleLineNumbers}
269269
>
270-
<LuHash size={14} />
270+
<LuHash size={12} />
271271
</IconButton>
272272
</Tooltip>
273273

274274
<Tooltip content="Word wrap">
275275
<IconButton
276-
size="sm"
276+
size="xs"
277277
emphasis={wrap ? 'soft' : 'ghost'}
278278
color={wrap ? 'primary' : 'neutral'}
279279
onClick={onToggleWrap}
280280
>
281-
<LuWrapText size={14} />
281+
<LuWrapText size={12} />
282282
</IconButton>
283283
</Tooltip>
284284

285285
<Tooltip content={colorize ? 'ANSI colors on' : 'ANSI colors off'}>
286286
<IconButton
287-
size="sm"
287+
size="xs"
288288
emphasis={colorize ? 'soft' : 'ghost'}
289289
color={colorize ? 'primary' : 'neutral'}
290290
onClick={onToggleColorize}
291291
aria-label="Toggle ANSI colors"
292292
aria-pressed={colorize}
293293
>
294-
<LuPalette size={14} />
294+
<LuPalette size={12} />
295295
</IconButton>
296296
</Tooltip>
297297

298298
<Tooltip content={follow ? 'Following' : 'Follow output'}>
299299
<IconButton
300-
size="sm"
300+
size="xs"
301301
emphasis={follow ? 'soft' : 'ghost'}
302302
color={follow ? 'primary' : 'neutral'}
303303
onClick={onToggleFollow}
304304
>
305-
<LuArrowDownToLine size={14} />
305+
<LuArrowDownToLine size={12} />
306306
</IconButton>
307307
</Tooltip>
308308

@@ -313,50 +313,50 @@ const LogViewerToolbar: React.FC<Props> = ({
313313

314314
<Tooltip content={paused ? 'Resume' : 'Pause'}>
315315
<IconButton
316-
size="sm"
316+
size="xs"
317317
emphasis={paused ? 'soft' : 'ghost'}
318318
color={paused ? 'warning' : 'neutral'}
319319
onClick={onTogglePaused}
320320
>
321-
{paused ? <LuPlay size={14} /> : <LuPause size={14} />}
321+
{paused ? <LuPlay size={12} /> : <LuPause size={12} />}
322322
</IconButton>
323323
</Tooltip>
324324

325325
<Divider orientation="vertical" sx={{ mx: 0.5 }} />
326326

327327
<Tooltip content={copyFeedback === 'visible' ? 'Copied!' : `Copy visible lines (${isMac ? '⌘⇧V' : 'Ctrl+Shift+V'})`}>
328328
<IconButton
329-
size="sm"
329+
size="xs"
330330
emphasis={copyFeedback === 'visible' ? 'soft' : 'ghost'}
331331
color={copyFeedback === 'visible' ? 'success' : 'neutral'}
332332
onClick={onCopyVisible}
333333
aria-label="Copy visible lines"
334334
>
335-
{copyFeedback === 'visible' ? <LuClipboardCheck size={14} /> : <LuCopy size={14} />}
335+
{copyFeedback === 'visible' ? <LuClipboardCheck size={12} /> : <LuCopy size={12} />}
336336
</IconButton>
337337
</Tooltip>
338338

339339
<Tooltip content={copyFeedback === 'all' ? 'Copied!' : `Copy all lines (${isMac ? '⌘⇧C' : 'Ctrl+Shift+C'})`}>
340340
<IconButton
341-
size="sm"
341+
size="xs"
342342
emphasis={copyFeedback === 'all' ? 'soft' : 'ghost'}
343343
color={copyFeedback === 'all' ? 'success' : 'neutral'}
344344
onClick={onCopyAll}
345345
aria-label="Copy all lines"
346346
>
347-
{copyFeedback === 'all' ? <LuClipboardCheck size={14} /> : <LuClipboard size={14} />}
347+
{copyFeedback === 'all' ? <LuClipboardCheck size={12} /> : <LuClipboard size={12} />}
348348
</IconButton>
349349
</Tooltip>
350350

351351
<Tooltip content="Download">
352-
<IconButton size="sm" emphasis="ghost" onClick={onDownload}>
353-
<LuDownload size={14} />
352+
<IconButton size="xs" emphasis="ghost" onClick={onDownload}>
353+
<LuDownload size={12} />
354354
</IconButton>
355355
</Tooltip>
356356

357357
<Tooltip content="Clear">
358-
<IconButton size="sm" emphasis="ghost" onClick={onClear}>
359-
<LuTrash2 size={14} />
358+
<IconButton size="xs" emphasis="ghost" onClick={onClear}>
359+
<LuTrash2 size={12} />
360360
</IconButton>
361361
</Tooltip>
362362

0 commit comments

Comments
 (0)