From 897421e7c4fdcac8e4ccece10a2400449c02b8a2 Mon Sep 17 00:00:00 2001
From: h
Date: Wed, 14 Oct 2026 03:28:29 +0200
Subject: [PATCH] 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
---
.../lib/components/disk/SelectionBar.svelte | 10 ++++++++-
.../lib/components/disk/StoragePanel.svelte | 22 ++++++++-----------
.../src/lib/components/disk/TrashPanel.svelte | 18 ++++++++-------
frontend/src/lib/styles/dark-theme.scss | 1 +
frontend/src/lib/styles/variables.scss | 1 +
5 files changed, 30 insertions(+), 22 deletions(-)
diff --git a/frontend/src/lib/components/disk/SelectionBar.svelte b/frontend/src/lib/components/disk/SelectionBar.svelte
index ce11a2d..21b07fb 100644
--- a/frontend/src/lib/components/disk/SelectionBar.svelte
+++ b/frontend/src/lib/components/disk/SelectionBar.svelte
@@ -3,12 +3,13 @@
interface Props {
children: Snippet;
+ failure?: string | null;
note?: string;
title: string;
warn?: boolean;
}
- let { title, note, warn = false, children }: Props = $props();
+ let { title, note, warn = false, failure, children }: Props = $props();
@@ -17,6 +18,9 @@
{#if note}
{note}
{/if}
+ {#if failure}
+
{failure}
+ {/if}
{@render children()}
@@ -63,5 +67,9 @@
&.warn {
color: var(--color-storage-warning);
}
+
+ &.failed {
+ color: var(--color-error);
+ }
}
diff --git a/frontend/src/lib/components/disk/StoragePanel.svelte b/frontend/src/lib/components/disk/StoragePanel.svelte
index 024c40e..0a82056 100644
--- a/frontend/src/lib/components/disk/StoragePanel.svelte
+++ b/frontend/src/lib/components/disk/StoragePanel.svelte
@@ -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}
0 ? `${chosenGone} не скачать заново` : undefined)}
+ failure={problem}
+ note={chosenGone > 0 ? `${chosenGone} не скачать заново` : undefined}
title="{filesLabel(chosen.length)} · {formatBytes(chosenBytes)}"
warn
>
@@ -399,10 +396,9 @@
{:else if undo}
{:else if problem}
-
+
{:else if problem && doomed === null}
-
+
{/if}
{#if problem}
-
-
- {problem}.
-
+ {problem}.
{/if}
{/if}
@@ -439,10 +436,15 @@
font-size: 0.9375rem;
line-height: 1.45;
- &.rest {
+ &.rest,
+ &.failed {
margin-top: 0.75rem;
}
+ &.failed {
+ color: var(--color-error);
+ }
+
&.warn {
display: flex;
gap: 0.625rem;
diff --git a/frontend/src/lib/styles/dark-theme.scss b/frontend/src/lib/styles/dark-theme.scss
index d3ac27c..e9b7a2f 100644
--- a/frontend/src/lib/styles/dark-theme.scss
+++ b/frontend/src/lib/styles/dark-theme.scss
@@ -5,6 +5,7 @@ html.theme-dark {
--color-storage-audio: #c98500;
--color-storage-other: #3987e5;
--color-storage-warning: #fb8c00;
+ --color-storage-trash: #6c6c6c;
--storage-tile-mix: 90%;
--color-primary: #8774e1;
--color-primary-opacity: #8378db1e;
diff --git a/frontend/src/lib/styles/variables.scss b/frontend/src/lib/styles/variables.scss
index 128eb1e..22b78d1 100644
--- a/frontend/src/lib/styles/variables.scss
+++ b/frontend/src/lib/styles/variables.scss
@@ -139,6 +139,7 @@
--color-storage-audio: #a36a00;
--color-storage-other: #2a78c8;
--color-storage-warning: #a85a00;
+ --color-storage-trash: #939799;
--storage-tile-mix: 100%;
--color-yellow: #{$color-yellow};