feat: enhance ClaudeLogsSection and TeamDetailView with improved search and layout

- Updated ClaudeLogsSection to conditionally render search and filter components based on log availability, enhancing user experience.
- Adjusted TeamDetailView layout by adding padding to the action container for better alignment and visual consistency.
- Improved handling of empty log states in ClaudeLogsSection to provide clearer user feedback.
This commit is contained in:
iliya 2026-03-07 13:51:34 +02:00
parent 821c3019be
commit f97ab7c6ce
2 changed files with 33 additions and 29 deletions

View file

@ -452,32 +452,36 @@ export const ClaudeLogsSection = ({ teamName }: ClaudeLogsSectionProps): React.J
)} )}
</span> </span>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<div className="flex w-48 items-center gap-1.5 rounded-md border border-[var(--color-border)] bg-transparent px-2 py-1"> {data.total > 0 ? (
<Search size={12} className="shrink-0 text-[var(--color-text-muted)]" /> <>
<input <div className="flex w-48 items-center gap-1.5 rounded-md border border-[var(--color-border)] bg-transparent px-2 py-1">
type="text" <Search size={12} className="shrink-0 text-[var(--color-text-muted)]" />
placeholder="Search logs..." <input
value={searchQuery} type="text"
onChange={(e) => setSearchQuery(e.target.value)} placeholder="Search logs..."
className="min-w-0 flex-1 bg-transparent text-xs text-[var(--color-text)] placeholder:text-[var(--color-text-muted)] focus:outline-none" value={searchQuery}
/> onChange={(e) => setSearchQuery(e.target.value)}
{searchQuery && ( className="min-w-0 flex-1 bg-transparent text-xs text-[var(--color-text)] placeholder:text-[var(--color-text-muted)] focus:outline-none"
<button />
type="button" {searchQuery && (
className="shrink-0 rounded p-0.5 text-[var(--color-text-muted)] transition-colors hover:bg-[var(--color-surface-raised)] hover:text-[var(--color-text)]" <button
onClick={() => setSearchQuery('')} type="button"
aria-label="Clear search" className="shrink-0 rounded p-0.5 text-[var(--color-text-muted)] transition-colors hover:bg-[var(--color-surface-raised)] hover:text-[var(--color-text)]"
> onClick={() => setSearchQuery('')}
<X size={14} /> aria-label="Clear search"
</button> >
)} <X size={14} />
</div> </button>
<ClaudeLogsFilterPopover )}
filter={filter} </div>
open={filterOpen} <ClaudeLogsFilterPopover
onOpenChange={setFilterOpen} filter={filter}
onApply={setFilter} open={filterOpen}
/> onOpenChange={setFilterOpen}
onApply={setFilter}
/>
</>
) : null}
{pendingNewCount > 0 && ( {pendingNewCount > 0 && (
<Button <Button
variant="outline" variant="outline"
@ -533,9 +537,9 @@ export const ClaudeLogsSection = ({ teamName }: ClaudeLogsSectionProps): React.J
} }
/> />
) : null} ) : null}
{!error && data.lines.length === 0 ? ( {!error && data.lines.length === 0 && isAlive ? (
<p className="p-2 text-xs text-[var(--color-text-muted)]"> <p className="p-2 text-xs text-[var(--color-text-muted)]">
{loading ? 'Loading…' : isAlive ? 'No logs captured.' : 'Team is not running.'} {loading ? 'Loading…' : 'No logs captured.'}
</p> </p>
) : null} ) : null}
{!error && data.lines.length > 0 && filteredText.trim().length === 0 ? ( {!error && data.lines.length > 0 && filteredText.trim().length === 0 ? (

View file

@ -1476,7 +1476,7 @@ export const TeamDetailView = ({ teamName }: TeamDetailViewProps): React.JSX.Ele
} }
defaultOpen defaultOpen
action={ action={
<div className="flex items-center gap-2 pl-2"> <div className="flex items-center gap-2 pl-2 pr-2">
<div className="flex w-36 items-center gap-1.5 rounded-md border border-[var(--color-border)] bg-transparent px-2 py-1"> <div className="flex w-36 items-center gap-1.5 rounded-md border border-[var(--color-border)] bg-transparent px-2 py-1">
<Search size={12} className="shrink-0 text-[var(--color-text-muted)]" /> <Search size={12} className="shrink-0 text-[var(--color-text-muted)]" />
<input <input