feat(frontend): feed of deleted and edited messages above the chat list and per chat in the changes panel

This commit is contained in:
hh committed 2026-10-19 03:00:12 +00:00
1 parent 010fa29ce0
commit 9f16e2aa56
23 files changed
+1915 -71

No files matched your search

+33 -26
View File
@@ -4,6 +4,7 @@
import BotsPanel from "#lib/components/bots/BotsPanel.svelte";
import StoragePanel from "#lib/components/disk/StoragePanel.svelte";
import TrashPanel from "#lib/components/disk/TrashPanel.svelte";
import ChatChanges from "#lib/components/feed/ChatChanges.svelte";
import JobsPanel from "#lib/components/jobs/JobsPanel.svelte";
import PolicyEditor from "#lib/components/policy/PolicyEditor.svelte";
import AnalyticsPanel from "#lib/components/presence/AnalyticsPanel.svelte";
@@ -21,35 +22,37 @@
import WatchesPanel from "#lib/components/watches/WatchesPanel.svelte";
import WebhooksPanel from "#lib/components/watches/WebhooksPanel.svelte";
import { t } from "#lib/i18n/locale.svelte.js";
import type { MessageKey } from "#lib/i18n/messages.js";
import { accounts } from "#lib/stores/accounts.svelte.js";
import { chats } from "#lib/stores/chats.svelte.js";
import { policyUi } from "#lib/stores/policy.svelte.js";
import { storageUi } from "#lib/stores/storage.svelte.js";
import { type RightPanel, ui } from "#lib/stores/ui.svelte.js";
const titles: Record<RightPanel, string> = $derived({
alerts: t("settings.alerts"),
annotations: "Заметки",
bots: "Боты",
callbacks: "Callback-данные",
jobs: "Бэкфилл и задачи",
links: "Ссылки",
policy: "Политика захвата",
presence: "Аналитика",
profile: "Профиль",
reactions: "Реакции",
readers: t("read.readers.title"),
search: "Поиск",
shares: "Файлы по ссылке",
storage: "Хранилище",
"storage-chat": "Файлы чата",
"storage-trash": "Корзина",
stories: "Сторис",
"stories-all": "Все сторис",
versions: "Версии",
watches: t("settings.watches"),
webhooks: t("watches.webhooks"),
});
const titles: Record<RightPanel, MessageKey> = {
alerts: "settings.alerts",
annotations: "panel.annotations",
bots: "settings.bots",
callbacks: "panel.callbacks",
changes: "feed.changes",
jobs: "settings.jobs",
links: "panel.links",
policy: "settings.policy",
presence: "chat.analytics",
profile: "chat.profile",
reactions: "panel.reactions",
readers: "read.readers.title",
search: "panel.search",
shares: "settings.shares",
storage: "settings.storage",
"storage-chat": "panel.chatFiles",
"storage-trash": "panel.trash",
stories: "settings.stories",
"stories-all": "panel.allStories",
versions: "panel.versions",
watches: "settings.watches",
webhooks: "watches.webhooks",
};
const parents: Partial<Record<RightPanel, RightPanel>> = {
"storage-chat": "storage",
@@ -66,14 +69,14 @@
ui.rightPanel === "storage-chat" && storageUi.chatId !== null
? chats.byId(storageUi.chatId)
: undefined;
return chat?.title ?? titles[ui.rightPanel];
return chat?.title ?? t(titles[ui.rightPanel]);
});
</script>
<header class="right-header">
{#if parent}
<Button
aria-label="Назад"
aria-label={t("common.back")}
onclick={() => ui.openPanel(parent)}
round
smaller
@@ -83,7 +86,7 @@
</Button>
{:else}
<Button
aria-label="Закрыть"
aria-label={t("common.close")}
onclick={() => ui.closePanel()}
round
smaller
@@ -98,6 +101,10 @@
<div class="right-body custom-scroll">
{#if ui.rightPanel === "profile"}
<ProfilePanel />
{:else if ui.rightPanel === "changes"}
{#key accounts.selectedId}
<ChatChanges />
{/key}
{:else if ui.rightPanel === "policy"}
{#key `${accounts.selectedId}:${policyUi.revision}`}
<PolicyEditor />