fix: make the Delete Chat shortcut work whenever a chat is open, not only while its sidebar row is rendered (#30165)

This commit is contained in:
G30 2026-09-21 10:21:19 -04:00 • committed by GitHub
parent a9541c18ca
commit bc50026f7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 14 deletions

View file

@ -149,6 +149,19 @@
</button>
</Menu>
{/if}
{#if !$temporaryChatEnabled && ($user?.role === 'admin' || ($user?.permissions?.chat?.delete ?? true))}
<button
id="delete-chat-button"
aria-label={$i18n.t('Delete')}
class="hidden"
on:click={() => {
deleteChatHandler(chat.id);
}}
>
<EllipsisHorizontal className="size-4.5" strokeWidth="1.5" />
</button>
{/if}
</div>
{:else}
<div class="pointer-events-none invisible flex max-w-full min-w-0 items-center gap-2">

View file

@ -782,20 +782,6 @@
<MoreHorizontalIcon className="size-3.5" strokeWidth="2" />
</button>
</ChatMenu>
{#if id === $chatId && ($user?.role === 'admin' || ($user?.permissions?.chat?.delete ?? true))}
<!-- Shortcut support using "delete-chat-button" id -->
<button
id="delete-chat-button"
aria-label={$i18n.t('Delete')}
class="hidden"
on:click={() => {
showDeleteConfirm = true;
}}
>
<MoreHorizontalIcon className="size-3.5" strokeWidth="2" />
</button>
{/if}
</div>
{/if}
</div>