From 6f7a8f64e2b8ebc1ef4e7deb8b8e505c408e7394 Mon Sep 17 00:00:00 2001 From: Lotus CI Date: Sat, 17 Oct 2026 23:51:19 -0400 Subject: [PATCH] fix(settings): valid HTML in setting tiles; start uploads in an effect (#291) SettingTile rendered its description in a

, and many tiles pass blocks (badges, Box, Text), so Settings had

/

inside

and React warned on every page. Render it as a

. UploadCardRenderer called startUpload() during render, which now updates the desktop taskbar-progress hook mid-render; start it from an effect instead. Refs #291 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5 --- src/app/components/setting-tile/SettingTile.tsx | 4 +++- src/app/components/upload-card/UploadCardRenderer.tsx | 10 +++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/app/components/setting-tile/SettingTile.tsx b/src/app/components/setting-tile/SettingTile.tsx index f22fcd995..36c1dcce0 100644 --- a/src/app/components/setting-tile/SettingTile.tsx +++ b/src/app/components/setting-tile/SettingTile.tsx @@ -43,7 +43,9 @@ export function SettingTile({ title, description, before, after, children }: Set )} {description && ( - + // [Gitea #291] A
, not a

: many tiles pass blocks (badges, + // , ) as the description, which is invalid inside a

. + {description} )} diff --git a/src/app/components/upload-card/UploadCardRenderer.tsx b/src/app/components/upload-card/UploadCardRenderer.tsx index c399d08c3..2b0dd7d0a 100644 --- a/src/app/components/upload-card/UploadCardRenderer.tsx +++ b/src/app/components/upload-card/UploadCardRenderer.tsx @@ -310,9 +310,13 @@ export function UploadCardRenderer({ const { file } = upload; const fileSizeExceeded = file.size >= allowSize; - if (upload.status === UploadStatus.Idle && !fileSizeExceeded) { - startUpload(); - } + // [Gitea #291] Start in an effect, not during render: the desktop taskbar + // progress hook subscribes to the upload atoms, so a render-time start + // updated another component mid-render (React warning on every image send). + const idle = upload.status === UploadStatus.Idle; + useEffect(() => { + if (idle && !fileSizeExceeded) startUpload(); + }, [idle, fileSizeExceeded, startUpload]); const handleSpoiler = (marked: boolean) => { setMetadata(fileItem, { ...metadata, markedAsSpoiler: marked });