fix(collab): keep every panel on screen, and stop leaking spool and links

The desktop layout rendered notes and links as a pair and dropped whichever of
the two was on its own, so turning the new Links feature off on an otherwise
default install made the Notes panel disappear. Both rows are now split by kind
and rendered only when they hold something, and one function decides what a
panel id renders, because the branch that lost a panel did so by not listing it.

The message and its attachment rows are written in one transaction. The caller
has already committed the image bytes by then, so a message that landed without
them left those bytes with nothing pointing at them and nothing to sweep them.
Deleting one now drops the blobs after the rows are gone rather than before.

A body the Zod pipe rejects used to leave up to four spooled images on disk:
pipes run after interceptors, so multer had already written them and the
handler's own cleanup was never reached. An interceptor removes them on any
failure before the handler, which also covers every other schema mismatch, and
the length check that could never fire is gone.

Adding, pinning and deleting a link now says something when it fails instead of
raising an unhandled rejection, the list has real types, and the rejected-image
toast is translated in all 23 locales rather than shipping English everywhere.
The picking, previewing and clearing of chat images moved into one hook both
shells use: it was copied into two, and both rebuilt every preview on each
change and leaked an object URL per image per pick.

Tests: the four link routes end to end with the validation pipe the harness was
missing, the image filter against the disguised-extension case, and the layout
combinations that drop a panel.
This commit is contained in:
Maurice
2026-09-08 22:42:22 +02:00
committed by Maurice
parent 07bb899c50
commit 7e3b9fd039
34 changed files with 429 additions and 118 deletions
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': 'الاستطلاعات',
'collab.tabs.links': 'الروابط',
'collab.links.add': 'إضافة رابط',
'collab.chat.imageRejected': 'يُسمح فقط بصور JPEG وPNG وGIF وWebP حتى 10 ميغابايت',
'collab.links.cancel': 'إلغاء',
'collab.links.save': 'حفظ الرابط',
'collab.links.titlePlaceholder': 'عنوان الرابط',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': 'Enquetes',
'collab.tabs.links': 'Links',
'collab.links.add': 'Adicionar link',
'collab.chat.imageRejected': 'Apenas imagens JPEG, PNG, GIF e WebP de até 10 MB são permitidas',
'collab.links.cancel': 'Cancelar',
'collab.links.save': 'Salvar link',
'collab.links.titlePlaceholder': 'Título do link',
+1
View File
@@ -6,6 +6,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': 'Enquestes',
'collab.tabs.links': 'Enllaços',
'collab.links.add': 'Afegeix un enllaç',
'collab.chat.imageRejected': "Només s'admeten imatges JPEG, PNG, GIF i WebP de fins a 10 MB",
'collab.links.cancel': 'Cancel·la',
'collab.links.save': 'Desa l\'enllaç',
'collab.links.titlePlaceholder': 'Títol de l\'enllaç',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': 'Hlasování',
'collab.tabs.links': 'Odkazy',
'collab.links.add': 'Přidat odkaz',
'collab.chat.imageRejected': 'Povoleny jsou pouze obrázky JPEG, PNG, GIF a WebP do 10 MB',
'collab.links.cancel': 'Zrušit',
'collab.links.save': 'Uložit odkaz',
'collab.links.titlePlaceholder': 'Název odkazu',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': 'Umfragen',
'collab.tabs.links': 'Links',
'collab.links.add': 'Link hinzufügen',
'collab.chat.imageRejected': 'Nur JPEG, PNG, GIF und WebP bis 10 MB sind erlaubt',
'collab.links.cancel': 'Abbrechen',
'collab.links.save': 'Link speichern',
'collab.links.titlePlaceholder': 'Linktitel',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': 'Polls',
'collab.tabs.links': 'Links',
'collab.links.add': 'Add link',
'collab.chat.imageRejected': 'Only JPEG, PNG, GIF and WebP images up to 10 MB are allowed',
'collab.links.cancel': 'Cancel',
'collab.links.save': 'Save link',
'collab.links.titlePlaceholder': 'Link title',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': 'Encuestas',
'collab.tabs.links': 'Enlaces',
'collab.links.add': 'Añadir enlace',
'collab.chat.imageRejected': 'Solo se permiten imágenes JPEG, PNG, GIF y WebP de hasta 10 MB',
'collab.links.cancel': 'Cancelar',
'collab.links.save': 'Guardar enlace',
'collab.links.titlePlaceholder': 'Título del enlace',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': 'Sondages',
'collab.tabs.links': 'Liens',
'collab.links.add': 'Ajouter un lien',
'collab.chat.imageRejected': "Seules les images JPEG, PNG, GIF et WebP jusqu'à 10 Mo sont autorisées",
'collab.links.cancel': 'Annuler',
'collab.links.save': 'Enregistrer le lien',
'collab.links.titlePlaceholder': 'Titre du lien',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': 'Δημοσκοπήσεις',
'collab.tabs.links': 'Σύνδεσμοι',
'collab.links.add': 'Προσθήκη συνδέσμου',
'collab.chat.imageRejected': 'Επιτρέπονται μόνο εικόνες JPEG, PNG, GIF και WebP έως 10 MB',
'collab.links.cancel': 'Ακύρωση',
'collab.links.save': 'Αποθήκευση συνδέσμου',
'collab.links.titlePlaceholder': 'Τίτλος συνδέσμου',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': 'Szavazások',
'collab.tabs.links': 'Linkek',
'collab.links.add': 'Link hozzáadása',
'collab.chat.imageRejected': 'Csak legfeljebb 10 MB méretű JPEG, PNG, GIF és WebP képek engedélyezettek',
'collab.links.cancel': 'Mégse',
'collab.links.save': 'Link mentése',
'collab.links.titlePlaceholder': 'Link címe',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': 'Polling',
'collab.tabs.links': 'Tautan',
'collab.links.add': 'Tambah tautan',
'collab.chat.imageRejected': 'Hanya gambar JPEG, PNG, GIF, dan WebP hingga 10 MB yang diizinkan',
'collab.links.cancel': 'Batal',
'collab.links.save': 'Simpan tautan',
'collab.links.titlePlaceholder': 'Judul tautan',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': 'Sondaggi',
'collab.tabs.links': 'Link',
'collab.links.add': 'Aggiungi link',
'collab.chat.imageRejected': 'Sono ammesse solo immagini JPEG, PNG, GIF e WebP fino a 10 MB',
'collab.links.cancel': 'Annulla',
'collab.links.save': 'Salva link',
'collab.links.titlePlaceholder': 'Titolo del link',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': '投票',
'collab.tabs.links': 'リンク',
'collab.links.add': 'リンクを追加',
'collab.chat.imageRejected': 'JPEG、PNG、GIF、WebP の画像のみ、10 MB までです',
'collab.links.cancel': 'キャンセル',
'collab.links.save': 'リンクを保存',
'collab.links.titlePlaceholder': 'リンクのタイトル',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': '투표',
'collab.tabs.links': '링크',
'collab.links.add': '링크 추가',
'collab.chat.imageRejected': 'JPEG, PNG, GIF, WebP 이미지만 최대 10 MB까지 허용됩니다',
'collab.links.cancel': '취소',
'collab.links.save': '링크 저장',
'collab.links.titlePlaceholder': '링크 제목',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': 'Polls',
'collab.tabs.links': 'Links',
'collab.links.add': 'Link toevoegen',
'collab.chat.imageRejected': 'Alleen JPEG-, PNG-, GIF- en WebP-afbeeldingen tot 10 MB zijn toegestaan',
'collab.links.cancel': 'Annuleren',
'collab.links.save': 'Link opslaan',
'collab.links.titlePlaceholder': 'Linktitel',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': 'Ankiety',
'collab.tabs.links': 'Linki',
'collab.links.add': 'Dodaj link',
'collab.chat.imageRejected': 'Dozwolone są tylko obrazy JPEG, PNG, GIF i WebP do 10 MB',
'collab.links.cancel': 'Anuluj',
'collab.links.save': 'Zapisz link',
'collab.links.titlePlaceholder': 'Tytuł linku',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': 'Опросы',
'collab.tabs.links': 'Ссылки',
'collab.links.add': 'Добавить ссылку',
'collab.chat.imageRejected': 'Допускаются только изображения JPEG, PNG, GIF и WebP размером до 10 МБ',
'collab.links.cancel': 'Отмена',
'collab.links.save': 'Сохранить ссылку',
'collab.links.titlePlaceholder': 'Название ссылки',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': 'Omröstningar',
'collab.tabs.links': 'Länkar',
'collab.links.add': 'Lägg till länk',
'collab.chat.imageRejected': 'Endast JPEG-, PNG-, GIF- och WebP-bilder upp till 10 MB tillåts',
'collab.links.cancel': 'Avbryt',
'collab.links.save': 'Spara länk',
'collab.links.titlePlaceholder': 'Länktitel',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': 'Anketler',
'collab.tabs.links': 'Bağlantılar',
'collab.links.add': 'Bağlantı ekle',
'collab.chat.imageRejected': 'Yalnızca 10 MB boyutuna kadar JPEG, PNG, GIF ve WebP görselleri kabul edilir',
'collab.links.cancel': 'İptal',
'collab.links.save': 'Bağlantıyı kaydet',
'collab.links.titlePlaceholder': 'Bağlantı başlığı',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': 'Опитування',
'collab.tabs.links': 'Посилання',
'collab.links.add': 'Додати посилання',
'collab.chat.imageRejected': 'Дозволено лише зображення JPEG, PNG, GIF і WebP розміром до 10 МБ',
'collab.links.cancel': 'Скасувати',
'collab.links.save': 'Зберегти посилання',
'collab.links.titlePlaceholder': 'Назва посилання',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': 'Thăm dò ý kiến',
'collab.tabs.links': 'Liên kết',
'collab.links.add': 'Thêm liên kết',
'collab.chat.imageRejected': 'Chỉ chấp nhận ảnh JPEG, PNG, GIF và WebP tối đa 10 MB',
'collab.links.cancel': 'Hủy',
'collab.links.save': 'Lưu liên kết',
'collab.links.titlePlaceholder': 'Tiêu đề liên kết',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': '投票',
'collab.tabs.links': '連結',
'collab.links.add': '新增連結',
'collab.chat.imageRejected': '僅支援 10 MB 以內的 JPEG、PNG、GIF 和 WebP 圖片',
'collab.links.cancel': '取消',
'collab.links.save': '儲存連結',
'collab.links.titlePlaceholder': '連結標題',
+1
View File
@@ -14,6 +14,7 @@ const collab: TranslationStrings = {
'collab.tabs.polls': '投票',
'collab.tabs.links': '链接',
'collab.links.add': '添加链接',
'collab.chat.imageRejected': '仅支持 10 MB 以内的 JPEG、PNG、GIF 和 WebP 图片',
'collab.links.cancel': '取消',
'collab.links.save': '保存链接',
'collab.links.titlePlaceholder': '链接标题',