realign buttons

This commit is contained in:
Peter Steinberger 2025-06-27 00:03:22 +02:00
parent f839822a01
commit f41b54799a

View file

@ -401,13 +401,15 @@ export class SessionList extends LitElement {
if (exitedSessions.length === 0 && runningSessions.length === 0) return '';
return html`
<div class="flex flex-col items-center gap-2 mt-8 pb-4 px-4">
<!-- First row: Show/Hide Exited -->
<div class="flex flex-col gap-2 mt-8 pb-4 px-4 w-full">
<!-- First row: Show/Hide Exited and Clean Exited (when visible) -->
${
exitedSessions.length > 0
? html`
<div class="flex gap-2 w-full">
<!-- Show/Hide Exited button -->
<button
class="font-mono text-xs sm:text-sm px-3 sm:px-6 py-2 rounded-lg border transition-all duration-200 ${
class="font-mono text-xs sm:text-sm px-3 sm:px-6 py-2 rounded-lg border transition-all duration-200 flex-1 ${
this.hideExited
? 'border-dark-border bg-dark-bg-secondary text-dark-text-muted hover:bg-dark-bg-tertiary hover:text-dark-text'
: 'border-dark-border bg-dark-bg-tertiary text-dark-text hover:bg-dark-bg-secondary'
@ -417,7 +419,7 @@ export class SessionList extends LitElement {
new CustomEvent('hide-exited-change', { detail: !this.hideExited })
)}
>
<div class="flex items-center gap-2 sm:gap-3">
<div class="flex items-center justify-center gap-2 sm:gap-3">
<span class="hidden sm:inline"
>${this.hideExited ? 'Show' : 'Hide'} Exited (${exitedSessions.length})</span
>
@ -439,29 +441,13 @@ export class SessionList extends LitElement {
</div>
</div>
</button>
`
: ''
}
<!-- Second row: Kill All and Clean Exited (when visible) -->
<div class="flex justify-center items-center gap-2 sm:gap-4">
<!-- Clean Exited button (only when Show Exited is active) -->
${
runningSessions.length > 0
!this.hideExited
? html`
<button
class="font-mono text-xs sm:text-sm px-3 sm:px-6 py-2 rounded-lg border transition-all duration-200 border-status-error bg-dark-bg-secondary text-status-error hover:bg-dark-bg-tertiary hover:border-status-error"
@click=${() => this.dispatchEvent(new CustomEvent('kill-all-sessions'))}
>
Kill All (${runningSessions.length})
</button>
`
: ''
}
${
!this.hideExited && exitedSessions.length > 0
? html`
<button
class="font-mono text-xs sm:text-sm px-3 sm:px-6 py-2 rounded-lg border transition-all duration-200 border-dark-border bg-dark-bg-secondary text-status-warning hover:bg-dark-bg-tertiary hover:border-status-warning"
class="font-mono text-xs sm:text-sm px-3 sm:px-6 py-2 rounded-lg border transition-all duration-200 flex-1 border-dark-border bg-dark-bg-secondary text-status-warning hover:bg-dark-bg-tertiary hover:border-status-warning"
@click=${this.handleCleanupExited}
?disabled=${this.cleaningExited}
>
@ -478,6 +464,23 @@ export class SessionList extends LitElement {
: ''
}
</div>
`
: ''
}
<!-- Second row: Kill All button (full width) -->
${
runningSessions.length > 0
? html`
<button
class="font-mono text-xs sm:text-sm px-3 sm:px-6 py-2 rounded-lg border transition-all duration-200 w-full border-status-error bg-dark-bg-secondary text-status-error hover:bg-dark-bg-tertiary hover:border-status-error"
@click=${() => this.dispatchEvent(new CustomEvent('kill-all-sessions'))}
>
Kill All (${runningSessions.length})
</button>
`
: ''
}
</div>
`;
}