channels ux cleanup and create-flow recovery

This commit is contained in:
DrygMira
2026-04-14 02:08:44 +03:00
parent 07e57b8563
commit 126b4ba3a1
22 changed files with 2322 additions and 664 deletions
+12 -1
View File
@@ -7,6 +7,11 @@ export function normalizeChannelDisplayName(value) {
return String(value).trim().replace(/\s+/g, ' ');
}
export function normalizeChannelDescription(value) {
if (value == null) return '';
return String(value).trim().replace(/\s+/g, ' ');
}
export function toCanonicalChannelSlug(value) {
const normalized = normalizeChannelDisplayName(value);
if (!normalized) return '';
@@ -76,4 +81,10 @@ export function channelNameErrorText(code) {
}
}
export function channelDescriptionErrorText(value) {
const normalized = normalizeChannelDescription(value);
if (new TextEncoder().encode(normalized).length > 200) {
return 'Описание слишком длинное: максимум 200 байт UTF-8.';
}
return '';
}