fix(v2): lay the channels tab out like the users tab

The list sits straight on the tab, without a section card around it, and
Add channel goes under it on the left, as Add does under the users table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
zurdi
2026-09-23 17:01:55 +02:00
parent 645a4be217
commit 8ed1e4b669
19 changed files with 140 additions and 157 deletions

View File

@@ -51,7 +51,6 @@
"channels-empty": "Все още няма канали",
"channels-empty-hint": "Препращайте известията си към Discord, ntfy, имейл или всеки уебхук.",
"channels-load-failed": "Каналите ви не можаха да бъдат заредени",
"channels-section": "Канали за известия",
"dismiss-all": "Затвори всички",
"dismiss-all-body": "Всички известия ще бъдат премахнати.",
"dismiss-all-title": "Затваряне на всички известия?",

View File

@@ -51,7 +51,6 @@
"channels-empty": "Zatím žádné kanály",
"channels-empty-hint": "Přeposílejte oznámení na Discord, ntfy, e-mail nebo jakýkoli webhook.",
"channels-load-failed": "Vaše kanály se nepodařilo načíst",
"channels-section": "Kanály oznámení",
"dismiss-all": "Zavřít vše",
"dismiss-all-body": "Všechna oznámení budou odstraněna.",
"dismiss-all-title": "Zavřít všechna oznámení?",

View File

@@ -51,7 +51,6 @@
"channels-empty": "Noch keine Kanäle",
"channels-empty-hint": "Leite deine Benachrichtigungen an Discord, ntfy, E-Mail oder einen beliebigen Webhook weiter.",
"channels-load-failed": "Deine Kanäle konnten nicht geladen werden",
"channels-section": "Benachrichtigungskanäle",
"dismiss-all": "Alle verwerfen",
"dismiss-all-body": "Alle Benachrichtigungen werden entfernt.",
"dismiss-all-title": "Alle Benachrichtigungen verwerfen?",

View File

@@ -51,7 +51,6 @@
"channels-empty": "No channels yet",
"channels-empty-hint": "Forward your notifications to Discord, ntfy, email or any webhook.",
"channels-load-failed": "Could not load your channels",
"channels-section": "Notification channels",
"dismiss-all": "Dismiss all",
"dismiss-all-body": "Every notification will be removed.",
"dismiss-all-title": "Dismiss all notifications?",

View File

@@ -51,7 +51,6 @@
"channels-empty": "No channels yet",
"channels-empty-hint": "Forward your notifications to Discord, ntfy, email or any webhook.",
"channels-load-failed": "Could not load your channels",
"channels-section": "Notification channels",
"dismiss-all": "Dismiss all",
"dismiss-all-body": "Every notification will be removed.",
"dismiss-all-title": "Dismiss all notifications?",

View File

@@ -51,7 +51,6 @@
"channels-empty": "Aún no hay canales",
"channels-empty-hint": "Reenvía tus notificaciones a Discord, ntfy, correo o cualquier webhook.",
"channels-load-failed": "No se pudieron cargar tus canales",
"channels-section": "Canales de notificaciones",
"dismiss-all": "Descartar todas",
"dismiss-all-body": "Se eliminarán todas las notificaciones.",
"dismiss-all-title": "¿Descartar todas las notificaciones?",

View File

@@ -51,7 +51,6 @@
"channels-empty": "Aucun canal pour l'instant",
"channels-empty-hint": "Transférez vos notifications vers Discord, ntfy, l'e-mail ou n'importe quel webhook.",
"channels-load-failed": "Impossible de charger vos canaux",
"channels-section": "Canaux de notification",
"dismiss-all": "Tout ignorer",
"dismiss-all-body": "Toutes les notifications seront supprimées.",
"dismiss-all-title": "Ignorer toutes les notifications ?",

View File

@@ -51,7 +51,6 @@
"channels-empty": "Még nincsenek csatornák",
"channels-empty-hint": "Továbbítsd az értesítéseidet Discordra, ntfy-ra, e-mailbe vagy bármilyen webhookra.",
"channels-load-failed": "Nem sikerült betölteni a csatornáidat",
"channels-section": "Értesítési csatornák",
"dismiss-all": "Összes elvetése",
"dismiss-all-body": "Az összes értesítés törlődik.",
"dismiss-all-title": "Elveted az összes értesítést?",

View File

@@ -51,7 +51,6 @@
"channels-empty": "Ancora nessun canale",
"channels-empty-hint": "Inoltra le tue notifiche a Discord, ntfy, email o qualsiasi webhook.",
"channels-load-failed": "Impossibile caricare i tuoi canali",
"channels-section": "Canali di notifica",
"dismiss-all": "Ignora tutte",
"dismiss-all-body": "Tutte le notifiche verranno rimosse.",
"dismiss-all-title": "Ignorare tutte le notifiche?",

View File

@@ -51,7 +51,6 @@
"channels-empty": "チャンネルはまだありません",
"channels-empty-hint": "通知を Discord、ntfy、メール、または任意の Webhook に転送できます。",
"channels-load-failed": "チャンネルを読み込めませんでした",
"channels-section": "通知チャンネル",
"dismiss-all": "すべて閉じる",
"dismiss-all-body": "すべての通知が削除されます。",
"dismiss-all-title": "すべての通知を閉じますか?",

View File

@@ -51,7 +51,6 @@
"channels-empty": "아직 채널이 없습니다",
"channels-empty-hint": "알림을 Discord, ntfy, 이메일 또는 모든 웹훅으로 전달하세요.",
"channels-load-failed": "채널을 불러올 수 없습니다",
"channels-section": "알림 채널",
"dismiss-all": "모두 닫기",
"dismiss-all-body": "모든 알림이 삭제됩니다.",
"dismiss-all-title": "모든 알림을 닫으시겠습니까?",

View File

@@ -51,7 +51,6 @@
"channels-empty": "Brak kanałów",
"channels-empty-hint": "Przekazuj powiadomienia do Discorda, ntfy, na e-mail lub do dowolnego webhooka.",
"channels-load-failed": "Nie udało się wczytać Twoich kanałów",
"channels-section": "Kanały powiadomień",
"dismiss-all": "Odrzuć wszystkie",
"dismiss-all-body": "Wszystkie powiadomienia zostaną usunięte.",
"dismiss-all-title": "Odrzucić wszystkie powiadomienia?",

View File

@@ -51,7 +51,6 @@
"channels-empty": "Nenhum canal ainda",
"channels-empty-hint": "Encaminhe suas notificações para o Discord, ntfy, e-mail ou qualquer webhook.",
"channels-load-failed": "Não foi possível carregar seus canais",
"channels-section": "Canais de notificação",
"dismiss-all": "Dispensar todas",
"dismiss-all-body": "Todas as notificações serão removidas.",
"dismiss-all-title": "Dispensar todas as notificações?",

View File

@@ -51,7 +51,6 @@
"channels-empty": "Încă nu există canale",
"channels-empty-hint": "Redirecționează notificările către Discord, ntfy, e-mail sau orice webhook.",
"channels-load-failed": "Canalele tale nu au putut fi încărcate",
"channels-section": "Canale de notificare",
"dismiss-all": "Închide toate",
"dismiss-all-body": "Toate notificările vor fi eliminate.",
"dismiss-all-title": "Închizi toate notificările?",

View File

@@ -51,7 +51,6 @@
"channels-empty": "Каналов пока нет",
"channels-empty-hint": "Пересылайте уведомления в Discord, ntfy, на эл. почту или в любой вебхук.",
"channels-load-failed": "Не удалось загрузить ваши каналы",
"channels-section": "Каналы уведомлений",
"dismiss-all": "Закрыть все",
"dismiss-all-body": "Все уведомления будут удалены.",
"dismiss-all-title": "Закрыть все уведомления?",

View File

@@ -51,7 +51,6 @@
"channels-empty": "Henüz kanal yok",
"channels-empty-hint": "Bildirimlerinizi Discord, ntfy, e-posta veya herhangi bir webhook'a iletin.",
"channels-load-failed": "Kanallarınız yüklenemedi",
"channels-section": "Bildirim kanalları",
"dismiss-all": "Tümünü kapat",
"dismiss-all-body": "Tüm bildirimler kaldırılacak.",
"dismiss-all-title": "Tüm bildirimler kapatılsın mı?",

View File

@@ -51,7 +51,6 @@
"channels-empty": "暂无渠道",
"channels-empty-hint": "将你的通知转发到 Discord、ntfy、电子邮件或任意 Webhook。",
"channels-load-failed": "无法加载你的渠道",
"channels-section": "通知渠道",
"dismiss-all": "全部忽略",
"dismiss-all-body": "所有通知都将被移除。",
"dismiss-all-title": "忽略所有通知?",

View File

@@ -51,7 +51,6 @@
"channels-empty": "尚無管道",
"channels-empty-hint": "將你的通知轉發到 Discord、ntfy、電子郵件或任何 Webhook。",
"channels-load-failed": "無法載入你的管道",
"channels-section": "通知管道",
"dismiss-all": "全部關閉",
"dismiss-all-body": "所有通知都將被移除。",
"dismiss-all-title": "關閉所有通知?",

View File

@@ -16,7 +16,6 @@ import type { NotificationChannelSchema } from "@/__generated__";
import notificationChannelApi from "@/services/api/notificationChannel";
import { formatRelativeDate } from "@/utils";
import NotificationChannelDialog from "@/v2/components/Notifications/NotificationChannelDialog.vue";
import SettingsSection from "@/v2/components/Settings/SettingsSection.vue";
import { useConfirm } from "@/v2/composables/useConfirm";
import { useGridNav } from "@/v2/composables/useGridNav";
import { useSnackbar } from "@/v2/composables/useSnackbar";
@@ -191,150 +190,144 @@ async function remove(channel: NotificationChannelSchema) {
</script>
<template>
<SettingsSection
:title="t('notifications.channels-section')"
icon="mdi-send-variant-outline"
>
<template #header-actions>
<div class="r-v2-channels">
<div v-if="!loaded" class="r-v2-channels__list">
<RSkeletonBlock
v-for="n in 2"
:key="`sk-${n}`"
width="100%"
height="72px"
rounded="lg"
/>
</div>
<REmptyState
v-else-if="channels.length === 0"
icon="mdi-send-variant-outline"
:title="t('notifications.channels-empty')"
:hint="t('notifications.channels-empty-hint')"
/>
<ul v-else ref="listRoot" class="r-v2-channels__list">
<li
v-for="channel in channels"
:key="channel.id"
class="r-v2-channel"
:class="{ 'r-v2-channel--off': !channel.enabled }"
>
<div class="r-v2-channel__main">
<RAvatar
:icon="channelIcon(channel)"
variant="translucent"
size="36"
class="r-v2-channel__icon"
/>
<span class="r-v2-channel__text">
<span class="r-v2-channel__name">{{ channel.name }}</span>
<span class="r-v2-channel__target">{{ channel.target }}</span>
<span class="r-v2-channel__meta">
{{ filtersLabel(channel) }}
</span>
<span
v-if="channel.last_error"
class="r-v2-channel__meta r-v2-channel__meta--error"
>
<RIcon icon="mdi-alert-circle-outline" size="14" />
{{
t("notifications.channel-last-error", {
error: channel.last_error,
})
}}
</span>
<span
v-else-if="channel.last_delivered_at"
class="r-v2-channel__meta"
>
{{
t("notifications.channel-last-sent", {
when: formatRelativeDate(channel.last_delivered_at),
})
}}
</span>
</span>
<span class="r-v2-channel__actions">
<RSwitch
:model-value="channel.enabled"
:disabled="!channel.confirmed"
:aria-label="t('notifications.channel-enabled')"
@update:model-value="toggle(channel, $event)"
/>
<RBtn
variant="text"
size="small"
icon="mdi-send-check-outline"
:loading="busy.has(channel.id)"
:disabled="!channel.confirmed"
:aria-label="t('notifications.channel-test')"
@click="sendTest(channel)"
/>
<RBtn
variant="text"
size="small"
icon="mdi-pencil-outline"
:aria-label="t('notifications.channel-edit')"
@click="openDialog(channel)"
/>
<RBtn
variant="text"
size="small"
icon="mdi-delete-outline"
color="danger"
:aria-label="t('notifications.channel-delete')"
@click="remove(channel)"
/>
</span>
</div>
<div v-if="!channel.confirmed" class="r-v2-channel__confirm">
<span class="r-v2-channel__meta">
{{ t("notifications.channel-awaiting-code") }}
</span>
<div class="r-v2-channel__code">
<RTextField
v-model="codes[channel.id]"
class="r-v2-channel__code-input"
:placeholder="t('notifications.channel-code')"
:aria-label="t('notifications.channel-code')"
inputmode="numeric"
autocomplete="one-time-code"
:maxlength="16"
density="compact"
hide-details
mono
@keydown.enter="confirmCode(channel)"
/>
<RBtn
variant="flat"
color="primary"
size="small"
:loading="busy.has(channel.id)"
@click="confirmCode(channel)"
>
{{ t("common.confirm") }}
</RBtn>
<RBtn variant="text" size="small" @click="resendCode(channel)">
{{ t("notifications.channel-resend") }}
</RBtn>
</div>
</div>
</li>
</ul>
<div class="r-v2-channels__footer">
<RBtn
variant="flat"
color="primary"
size="small"
prepend-icon="mdi-plus"
@click="openDialog(null)"
>
{{ t("notifications.channel-add") }}
</RBtn>
</template>
<div class="r-v2-channels">
<div v-if="!loaded" class="r-v2-channels__list">
<RSkeletonBlock
v-for="n in 2"
:key="`sk-${n}`"
width="100%"
height="72px"
rounded="lg"
/>
</div>
<REmptyState
v-else-if="channels.length === 0"
icon="mdi-send-variant-outline"
:title="t('notifications.channels-empty')"
:hint="t('notifications.channels-empty-hint')"
/>
<ul v-else ref="listRoot" class="r-v2-channels__list">
<li
v-for="channel in channels"
:key="channel.id"
class="r-v2-channel"
:class="{ 'r-v2-channel--off': !channel.enabled }"
>
<div class="r-v2-channel__main">
<RAvatar
:icon="channelIcon(channel)"
variant="translucent"
size="36"
class="r-v2-channel__icon"
/>
<span class="r-v2-channel__text">
<span class="r-v2-channel__name">{{ channel.name }}</span>
<span class="r-v2-channel__target">{{ channel.target }}</span>
<span class="r-v2-channel__meta">
{{ filtersLabel(channel) }}
</span>
<span
v-if="channel.last_error"
class="r-v2-channel__meta r-v2-channel__meta--error"
>
<RIcon icon="mdi-alert-circle-outline" size="14" />
{{
t("notifications.channel-last-error", {
error: channel.last_error,
})
}}
</span>
<span
v-else-if="channel.last_delivered_at"
class="r-v2-channel__meta"
>
{{
t("notifications.channel-last-sent", {
when: formatRelativeDate(channel.last_delivered_at),
})
}}
</span>
</span>
<span class="r-v2-channel__actions">
<RSwitch
:model-value="channel.enabled"
:disabled="!channel.confirmed"
:aria-label="t('notifications.channel-enabled')"
@update:model-value="toggle(channel, $event)"
/>
<RBtn
variant="text"
size="small"
icon="mdi-send-check-outline"
:loading="busy.has(channel.id)"
:disabled="!channel.confirmed"
:aria-label="t('notifications.channel-test')"
@click="sendTest(channel)"
/>
<RBtn
variant="text"
size="small"
icon="mdi-pencil-outline"
:aria-label="t('notifications.channel-edit')"
@click="openDialog(channel)"
/>
<RBtn
variant="text"
size="small"
icon="mdi-delete-outline"
color="danger"
:aria-label="t('notifications.channel-delete')"
@click="remove(channel)"
/>
</span>
</div>
<div v-if="!channel.confirmed" class="r-v2-channel__confirm">
<span class="r-v2-channel__meta">
{{ t("notifications.channel-awaiting-code") }}
</span>
<div class="r-v2-channel__code">
<RTextField
v-model="codes[channel.id]"
class="r-v2-channel__code-input"
:placeholder="t('notifications.channel-code')"
:aria-label="t('notifications.channel-code')"
inputmode="numeric"
autocomplete="one-time-code"
:maxlength="16"
density="compact"
hide-details
mono
@keydown.enter="confirmCode(channel)"
/>
<RBtn
variant="flat"
color="primary"
size="small"
:loading="busy.has(channel.id)"
@click="confirmCode(channel)"
>
{{ t("common.confirm") }}
</RBtn>
<RBtn variant="text" size="small" @click="resendCode(channel)">
{{ t("notifications.channel-resend") }}
</RBtn>
</div>
</div>
</li>
</ul>
</div>
<NotificationChannelDialog
@@ -342,12 +335,20 @@ async function remove(channel: NotificationChannelSchema) {
:channel="editing"
@saved="onSaved"
/>
</SettingsSection>
</div>
</template>
<style scoped>
/* Bare Settings tab: the SettingsLayout content column owns the gutters. */
.r-v2-channels {
padding: var(--r-space-4);
display: flex;
flex-direction: column;
gap: 14px;
}
.r-v2-channels__footer {
display: flex;
justify-content: flex-start;
}
.r-v2-channels__list {