fix(frontend): storage failures use the error colour next to the warning, shared mark on its own line in the list, trash key is visible

This commit is contained in:
hh committed 2026-10-14 03:28:29 +02:00
1 parent 3223f62dea
commit 897421e7c4
5 files changed
+30 -22

No files matched your search

@@ -86,10 +86,6 @@
return chats.byId(chatId)?.title ?? `Чат ${chatId}`;
}
function tail(file: StorageFile): string {
return file.refs > 1 ? messagesLabel(file.refs) : formatListDate(file.date);
}
async function loadSummary() {
try {
summary = await getStorageSummary();
@@ -324,6 +320,7 @@
fileName={file.file_name}
kind={file.kind}
mime={file.mime}
note={file.refs > 1 ? messagesLabel(file.refs) : undefined}
onopen={() => open(index)}
ontoggle={() => toggle(file.media_id)}
refetchable={file.refetchable}
@@ -331,7 +328,7 @@
size={file.file_size}
src={mediaUrl(file.media_id)}
sub={chatTitle(file.chat_id)}
tail={tail(file)}
tail={formatListDate(file.date)}
weight={heaviest > 0 ? file.file_size / heaviest : 0}
>
{#snippet menu()}
@@ -378,8 +375,8 @@
{#if chosen.length > 0}
<SelectionBar
note={problem ??
(chosenGone > 0 ? `${chosenGone} не скачать заново` : undefined)}
failure={problem}
note={chosenGone > 0 ? `${chosenGone} не скачать заново` : undefined}
title="{filesLabel(chosen.length)} · {formatBytes(chosenBytes)}"
warn
>
@@ -399,10 +396,9 @@
</SelectionBar>
{:else if undo}
<SelectionBar
note={problem ??
`${formatBytes(undo.outcome.bytes)} освободится через 7 дней`}
failure={problem}
note="{formatBytes(undo.outcome.bytes)} освободится через 7 дней"
title="{filesLabel(undo.outcome.files)} в корзине"
warn={problem !== null}
>
<Button onclick={restoreLast} smaller variant="text">
<Icon name="undo" size="1.25rem" />
@@ -410,7 +406,7 @@
</Button>
</SelectionBar>
{:else if problem}
<SelectionBar title={problem}>
<SelectionBar failure={problem} title="Не получилось">
<Button
onclick={() => {
problem = null;
@@ -479,7 +475,7 @@
border-radius: 2px;
&.trashed {
background-color: rgba(var(--color-text-secondary-rgb), 0.35);
background-color: var(--color-storage-trash);
}
&:first-child {
@@ -604,7 +600,7 @@
width: 0.5rem;
height: 0.5rem;
border-radius: 50%;
background-color: rgba(var(--color-text-secondary-rgb), 0.35);
background-color: var(--color-storage-trash);
}
&:focus-visible {