'..' parent row in the file list

Synthetic cursor-navigable first row (hidden at /) — Enter/double-click goes to
the parent like the toolbar button. Excluded from selection, rename, delete,
chmod, and transfers; shown with an up-arrow icon.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Jokin
2026-07-11 19:14:24 +02:00
co-authored by Claude Fable 5
parent 83202ff414
commit 20e5703d29
4 changed files with 14 additions and 7 deletions
+3 -3
View File
@@ -16,12 +16,12 @@ export class FileActionsService {
private readonly toast = inject(ToastService);
private readonly dialogs = inject(DialogsService);
/** Selection if non-empty, else the cursor entry. */
/** Selection if non-empty, else the cursor entry. Never the ".." parent row. */
targets(panel: PanelState): FileEntry[] {
const selected = panel.selectedEntries();
if (selected.length) return selected;
const atCursor = panel.sorted()[panel.cursor()];
return atCursor ? [atCursor] : [];
return atCursor && atCursor.name !== '..' ? [atCursor] : [];
}
mkdir(panel: PanelState): void {
@@ -58,7 +58,7 @@ export class FileActionsService {
rename(panel: PanelState): void {
const entry = panel.sorted()[panel.cursor()];
if (!entry) return;
if (!entry || entry.name === '..') return;
this.dialogs.prompt.set({
title: `Rename "${entry.name}"`,
initial: entry.name,