Toolbar buttons show text labels when the panel is wide

Container query on the panel (Tailwind v4 @container): Copy, Edit, Rename and
Delete grow labels at >=30rem panel width; New folder, New file and
Permissions stay icon-only (self-explanatory icons). Tooltips unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Jokin
2026-07-11 20:30:24 +02:00
co-authored by Claude Fable 5
parent e4f7ca86f7
commit 06dbe14d76
2 changed files with 11 additions and 6 deletions
+10 -5
View File
@@ -29,27 +29,31 @@
<div class="flex-1"></div> <div class="flex-1"></div>
<!-- panel actions: act on THIS panel --> <!-- panel actions: act on THIS panel. Frequent/destructive verbs grow text
labels when the panel is wide enough (container query). -->
<button <button
(click)="copyToOther()" (click)="copyToOther()"
[title]="side() === 'left' ? 'Copy to right panel (F5)' : 'Copy to left panel (F5)'" [title]="side() === 'left' ? 'Copy to right panel (F5)' : 'Copy to left panel (F5)'"
class="grid size-6 shrink-0 place-items-center rounded-md text-muted-foreground hover:bg-accent hover:text-primary" class="flex h-6 shrink-0 items-center rounded-md px-1 text-muted-foreground hover:bg-accent hover:text-primary"
> >
<ng-icon [name]="copyIcon()" size="0.95rem" /> <ng-icon [name]="copyIcon()" size="0.95rem" />
<span class="ml-1 hidden text-[11px] @[30rem]:inline">Copy</span>
</button> </button>
<button <button
(click)="run('edit')" (click)="run('edit')"
title="Edit file (F4)" title="Edit file (F4)"
class="grid size-6 shrink-0 place-items-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground" class="flex h-6 shrink-0 items-center rounded-md px-1 text-muted-foreground hover:bg-accent hover:text-foreground"
> >
<ng-icon name="mynaFileText" size="0.9rem" /> <ng-icon name="mynaFileText" size="0.9rem" />
<span class="ml-1 hidden text-[11px] @[30rem]:inline">Edit</span>
</button> </button>
<button <button
(click)="run('rename')" (click)="run('rename')"
title="Rename (F2)" title="Rename (F2)"
class="grid size-6 shrink-0 place-items-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground" class="flex h-6 shrink-0 items-center rounded-md px-1 text-muted-foreground hover:bg-accent hover:text-foreground"
> >
<ng-icon name="mynaEdit" size="0.9rem" /> <ng-icon name="mynaEdit" size="0.9rem" />
<span class="ml-1 hidden text-[11px] @[30rem]:inline">Rename</span>
</button> </button>
<button <button
(click)="run('mkdir')" (click)="run('mkdir')"
@@ -75,9 +79,10 @@
<button <button
(click)="run('delete')" (click)="run('delete')"
title="Delete (F8 / Del)" title="Delete (F8 / Del)"
class="grid size-6 shrink-0 place-items-center rounded-md text-muted-foreground hover:bg-accent hover:text-destructive" class="flex h-6 shrink-0 items-center rounded-md px-1 text-muted-foreground hover:bg-accent hover:text-destructive"
> >
<ng-icon name="mynaTrash" size="0.9rem" /> <ng-icon name="mynaTrash" size="0.9rem" />
<span class="ml-1 hidden text-[11px] @[30rem]:inline">Delete</span>
</button> </button>
@if (menuOpen()) { @if (menuOpen()) {
+1 -1
View File
@@ -21,7 +21,7 @@ import { TransfersService } from '../transfers.service';
selector: 'app-file-panel', selector: 'app-file-panel',
imports: [NgIcon], imports: [NgIcon],
templateUrl: './file-panel.html', templateUrl: './file-panel.html',
host: { class: 'flex min-w-0 flex-1 flex-col overflow-hidden' }, host: { class: '@container flex min-w-0 flex-1 flex-col overflow-hidden' },
}) })
export class FilePanel { export class FilePanel {
readonly side = input.required<Side>(); readonly side = input.required<Side>();