Compare commits

..
Author SHA1 Message Date
Lotus CIandClaude Opus 5.5 6f7a8f64e2 fix(settings): valid HTML in setting tiles; start uploads in an effect (#291)
CI / Build & Quality Checks (pull_request) Successful in 4m24s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 11s
CI / Playwright smoke (e2e) (pull_request) Successful in 15m43s
SettingTile rendered its description in a <p>, and many tiles pass
blocks (badges, Box, Text), so Settings had <div>/<p> inside <p> and
React warned on every page. Render it as a <div>. 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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
2026-10-17 23:51:19 -04:00
3 changed files with 16 additions and 15 deletions
@@ -43,7 +43,9 @@ export function SettingTile({ title, description, before, after, children }: Set
</Text> </Text>
)} )}
{description && ( {description && (
<Text className={BreakWord} size="T200" priority="300"> // [Gitea #291] A <div>, not a <p>: many tiles pass blocks (badges,
// <Box>, <Text>) as the description, which is invalid inside a <p>.
<Text as="div" className={BreakWord} size="T200" priority="300">
{description} {description}
</Text> </Text>
)} )}
@@ -310,9 +310,13 @@ export function UploadCardRenderer({
const { file } = upload; const { file } = upload;
const fileSizeExceeded = file.size >= allowSize; const fileSizeExceeded = file.size >= allowSize;
if (upload.status === UploadStatus.Idle && !fileSizeExceeded) { // [Gitea #291] Start in an effect, not during render: the desktop taskbar
startUpload(); // 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) => { const handleSpoiler = (marked: boolean) => {
setMetadata(fileItem, { ...metadata, markedAsSpoiler: marked }); setMetadata(fileItem, { ...metadata, markedAsSpoiler: marked });
+6 -11
View File
@@ -50,14 +50,6 @@ type FlatClip = {
* A management toggle reveals the pack editors (personal + this room, if * A management toggle reveals the pack editors (personal + this room, if
* permitted). Space-wide packs are managed from Space settings. * permitted). Space-wide packs are managed from Space settings.
*/ */
/** [EC#13, EC#47] Why the fork refused to play a clip, for the user. */
export const soundboardRefusalText = (reason: string | undefined): string => {
if (reason === 'muted') return 'Unmute your microphone to play a soundboard clip.';
if (reason === 'not_permitted')
return "The soundboard isn't available in this voice channel (only microphone audio is allowed here).";
return 'Could not play that clip.';
};
export function CallSoundboard({ callEmbed }: CallSoundboardProps) { export function CallSoundboard({ callEmbed }: CallSoundboardProps) {
const mx = useMatrixClient(); const mx = useMatrixClient();
const { room } = callEmbed; const { room } = callEmbed;
@@ -130,10 +122,13 @@ export function CallSoundboard({ callEmbed }: CallSoundboardProps) {
.catch(() => undefined); .catch(() => undefined);
const result = await callEmbed.control.injectAudio(url, vol, clipBytes); const result = await callEmbed.control.injectAudio(url, vol, clipBytes);
if (!result.played) { if (!result.played) {
// [EC#13, EC#47] Refused fork-side (mic muted, or the room's token // [EC#13] Refused fork-side (only reason today: local mic muted) —
// only allows the microphone source, as in audio-only rooms) —
// don't play it locally either, or the user would think it went out. // don't play it locally either, or the user would think it went out.
setError(soundboardRefusalText(result.reason)); setError(
result.reason === 'muted'
? 'Unmute your microphone to play a soundboard clip.'
: 'Could not play that clip.',
);
done(); done();
return; return;
} }