Skip to content

Commit 66e29ac

Browse files
[cueweb] Encode mailto: spaces as %20 (not +) in Email Artist + Request Cores
- URLSearchParams.toString() encodes spaces as "+", but mailto: per RFC 6068 only treats "%20" as space - so subject + body would arrive in the mail client with literal "+" characters. - request-cores-dialog: corrupted the padEnd-aligned Layer Name / Minimum Memory / Min Cores table. - email-artist-dialog: same bug (identical mailto pattern). - Both now normalize with .replace(/\+/g, "%20") before window.location.href, with a comment citing RFC 6068.
1 parent 04e8338 commit 66e29ac

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

cueweb/components/ui/email-artist-dialog.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,12 @@ export function EmailArtistDialog() {
139139
if (bcc.trim()) params.set("bcc", bcc.trim());
140140
if (subject) params.set("subject", subject);
141141
if (body) params.set("body", body);
142-
const qs = params.toString();
142+
// URLSearchParams encodes spaces as "+", but per RFC 6068 mailto: URIs
143+
// do NOT decode "+" as space - only "%20" is treated that way - so
144+
// every space in the subject and body would arrive as a literal "+"
145+
// in the user's mail client. Normalize before handing the URL to
146+
// the browser.
147+
const qs = params.toString().replace(/\+/g, "%20");
143148
const url = qs
144149
? `mailto:${encodeURIComponent(to.trim())}?${qs}`
145150
: `mailto:${encodeURIComponent(to.trim())}`;

cueweb/components/ui/request-cores-dialog.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,13 @@ export function RequestCoresDialog() {
208208
if (bcc.trim()) params.set("bcc", bcc.trim());
209209
if (subject) params.set("subject", subject);
210210
if (body) params.set("body", body);
211-
const qs = params.toString();
211+
// URLSearchParams encodes spaces as "+", but per RFC 6068 mailto: URIs
212+
// do NOT decode "+" as space - only "%20" is treated that way - so
213+
// every space in the subject and body (including the padEnd spaces
214+
// that align the Layer Name / Minimum Memory / Min Cores columns)
215+
// would arrive as a literal "+" character in the user's mail client.
216+
// Normalize before handing the URL to the browser.
217+
const qs = params.toString().replace(/\+/g, "%20");
212218
const url = qs
213219
? `mailto:${encodeURIComponent(to.trim())}?${qs}`
214220
: `mailto:${encodeURIComponent(to.trim())}`;

0 commit comments

Comments
 (0)