larger tap target for showing dev server logs (vibe-kanban) (#1201)
* Done! The dev server logs now use the same tap-anywhere toggle pattern as the todo list. Changes:
- Replaced button toggle with native `<details>` element
- Tap anywhere on the header to show/hide logs
- ChevronUp icon rotates 180° when expanded
- State persists in localStorage
- Backward compatible with existing controlled/uncontrolled usage
* Fixed! Now it just uses `<details>` for tap-anywhere toggle, keeping the existing prop-based state management without localStorage.
* Much cleaner! Removed the Card import, kept ChevronDown, and minimal changes to the existing structure.
* Better! Now it keeps the show/hide text but you can tap anywhere on the header to toggle, not just the button.
* Cleanup script changes for task attempt 18dccd62-ba48-4162-835b-0d1e84a0fe2c
* Yes, more minimal now - matches the original Button structure more closely with the same ternary logic and mr-1 spacing.
* Fixed chevron direction. For the height - can you point me to where you're seeing it? The `{height}` prop should still be applied the same way.
This commit is contained in:
committed by
GitHub
parent
c4c1eb4068
commit
d02dbdcf8c
@@ -1,6 +1,5 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Terminal, ChevronDown } from 'lucide-react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import ProcessLogsViewer, {
|
||||
ProcessLogsViewerContent,
|
||||
} from '../ProcessLogsViewer';
|
||||
@@ -32,8 +31,16 @@ export function DevServerLogsView({
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="border-t bg-background">
|
||||
{/* Logs toolbar */}
|
||||
<details
|
||||
className="group border-t bg-background"
|
||||
open={showLogs}
|
||||
onToggle={(e) => {
|
||||
if (e.currentTarget.open !== showLogs) {
|
||||
onToggle();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<summary className="list-none cursor-pointer">
|
||||
<div className="flex items-center justify-between px-3 py-2 border-b bg-muted/50">
|
||||
<div className="flex items-center gap-2">
|
||||
<Terminal className="h-4 w-4 text-muted-foreground" />
|
||||
@@ -41,7 +48,7 @@ export function DevServerLogsView({
|
||||
{t('preview.logs.title')}
|
||||
</span>
|
||||
</div>
|
||||
<Button size="sm" variant="ghost" onClick={onToggle}>
|
||||
<div className="flex items-center text-sm">
|
||||
<ChevronDown
|
||||
className={`h-4 w-4 mr-1 ${showToggleText ? 'transition-transform' : ''} ${showLogs ? '' : 'rotate-180'}`}
|
||||
/>
|
||||
@@ -50,10 +57,10 @@ export function DevServerLogsView({
|
||||
? t('preview.logs.hide')
|
||||
: t('preview.logs.show')
|
||||
: t('preview.logs.hide')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</summary>
|
||||
|
||||
{/* Logs viewer */}
|
||||
{showLogs && (
|
||||
<div className={height}>
|
||||
{logs ? (
|
||||
@@ -63,6 +70,6 @@ export function DevServerLogsView({
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</details>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user