reorder context menu items

This commit is contained in:
vcoppe committed 2026-10-18 19:09:06 +02:00
1 parent 5bc35f30d9
commit c842da8dc1
1 file changed
+19 -18
@@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
import * as ContextMenu from '$lib/components/ui/context-menu'; import * as ContextMenu from '$lib/components/ui/context-menu';
import { import {
ExternalLink, ArrowUpRight,
FileX, FileX,
FolderOpen, FolderOpen,
FolderX, FolderX,
PencilLine, PenLine,
Plus, Plus,
Trash2, Trash2,
} from '@lucide/svelte'; } from '@lucide/svelte';
@@ -296,38 +296,39 @@
<FolderOpen size="16" /> <FolderOpen size="16" />
{i18n._('menu.explorer_menu.open')} {i18n._('menu.explorer_menu.open')}
</ContextMenu.Item> </ContextMenu.Item>
{#if openIds().length > 0} {/if}
<ContextMenu.Item onclick={() => closeFiles(openIds())}> <ContextMenu.Item onclick={() => engine.revealPath(path)}>
<FileX size="16" /> <ArrowUpRight size="16" />
{i18n._('menu.close')} {i18n._(isMac() ? 'menu.explorer_menu.reveal_finder' : 'menu.explorer_menu.reveal')}
</ContextMenu.Item> </ContextMenu.Item>
{/if}
<ContextMenu.Separator /> <ContextMenu.Separator />
{/if}
{#if kind !== 'root'} {#if kind !== 'root'}
<ContextMenu.Item <ContextMenu.Item
disabled={targets().length !== 1} disabled={targets().length !== 1}
onclick={() => (renaming.path = path)} onclick={() => (renaming.path = path)}
> >
<PencilLine size="16" /> <PenLine size="16" />
{i18n._('menu.explorer_menu.rename')} {i18n._('menu.explorer_menu.rename')}
</ContextMenu.Item> </ContextMenu.Item>
<ContextMenu.Item onclick={remove}>
<Trash2 size="16" />
{i18n._('menu.delete')}
</ContextMenu.Item>
<ContextMenu.Separator /> <ContextMenu.Separator />
{/if} {/if}
<ContextMenu.Item onclick={() => engine.revealPath(path)}>
<ExternalLink size="16" />
{i18n._(isMac() ? 'menu.explorer_menu.reveal_finder' : 'menu.explorer_menu.reveal')}
</ContextMenu.Item>
{#if kind === 'root'} {#if kind === 'root'}
<ContextMenu.Separator />
<ContextMenu.Item onclick={closeFolder}> <ContextMenu.Item onclick={closeFolder}>
<FolderX size="16" /> <FolderX size="16" />
{i18n._('menu.close_folder')} {i18n._('menu.close_folder')}
</ContextMenu.Item> </ContextMenu.Item>
{:else}
{#if kind === 'file' && openIds().length > 0}
<ContextMenu.Item onclick={() => closeFiles(openIds())}>
<FileX size="16" />
{i18n._('menu.close')}
</ContextMenu.Item>
<ContextMenu.Separator />
{/if}
<ContextMenu.Item onclick={remove}>
<Trash2 size="16" />
{i18n._('menu.delete')}
</ContextMenu.Item>
{/if} {/if}
</ContextMenu.Content> </ContextMenu.Content>
</ContextMenu.Root> </ContextMenu.Root>