feat: split contact email by purpose behind a toggle (v0.34.0)

Add a Settings "Split contact email by purpose" toggle (off by default).
When on, the editor exposes three email fields — Contact, Advertising,
and Game keys & playtest — and the description renders a grouped
"BUSINESS / CONTACT" block with one labeled line per non-empty field.
Off keeps the single "Business inquiries" line unchanged.

- New editor fields adEmail/gameKeyEmail (persist v17->v18); contactEmail
  is reused as the Contact line, so no saved data moves. The
  splitContactEmail toggle mirrors showThirdPartyAds end-to-end
  (settings persist v10->v11). Profiles persist v1->v2. All migrations
  are additive back-fills.
- +8 ui / +4 templates i18n keys across all six locales (983/563).
- 621 tests pass (613 + 8), typecheck/lint/locale validation green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
poli0981andClaude Opus 4.8 committed 2026-07-20 20:59:19 +07:00
1 parent 43d850d1d4
commit 633298c049
41 files changed
+450 -32

No files matched your search

+16
View File
@@ -2,6 +2,22 @@
All notable changes to YTDescGen ship as tagged releases on `main`.
## v0.34.0 — 2026-07-20
A **feature** release that lets creators publish a different email per purpose instead of a
single catch-all address — so viewers, sponsors, and studios each reach the right inbox.
### Added
- **Split contact email by purpose** ([src/pages/SettingsPage.tsx](src/pages/SettingsPage.tsx), [src/components/editor/ContactEmailEditor.tsx](src/components/editor/ContactEmailEditor.tsx)) — a new **Settings → Description** toggle (off by default). Off keeps today's single `📧 Business inquiries:` line, unchanged. On splits the editor's Contact Email field into three: **Contact** (general), **Advertising / sponsorship**, and **Game keys & playtest** — each accepting up to 3 comma-separated addresses via the existing email validator.
- **Grouped contact block** ([src/engine/description-builder.ts](src/engine/description-builder.ts)) — when the toggle is on, the description renders a localized `📧 BUSINESS / CONTACT` block with one labeled line per non-empty field (`📧 Contact:`, `🤝 Advertising:`, `🎮 Game keys & playtest:`). Empty fields are skipped and the whole block drops when all three are empty — same skip logic as the Community block. The existing `contactEmail` is reused as the Contact line, so no saved data moves.
### Under the hood
- Two editor fields (`adEmail`, `gameKeyEmail`) thread through defaults, the store (persist **v17 → v18**), `GeneratorInput`, the editor → engine mapping, template snapshots, and Profiles (persist **v1 → v2**) — guarded by the existing parity test. The `splitContactEmail` toggle mirrors `showThirdPartyAds` end-to-end: the settings store (persist **v10 → v11**, `SCHEMA_VERSIONS.settings` in lockstep), both output hooks, and the render options. Both migrations are additive `""` / `false` back-fills, so existing drafts, profiles, and settings upgrade untouched.
- Twelve i18n keys per locale added (8 ui + 4 templates) across all six locales (validator **983 ui / 563 templates**). typecheck, lint, locale validation, and **621 tests** (613 + 8: split render on/off/partial/empty, v18 migration back-fill/coerce/preserve) pass; verified live.
- Five manifests bumped 0.33.0 → 0.34.0.
## v0.33.0 — 2026-07-13
A **feature** release that turns the description's Community block into the channel's
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "yt-desc-gen",
"version": "0.33.0",
"version": "0.34.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "yt-desc-gen",
"version": "0.33.0",
"version": "0.34.0",
"license": "Apache-2.0",
"dependencies": {
"@tauri-apps/api": "^2.11.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "yt-desc-gen",
"version": "0.33.0",
"version": "0.34.0",
"private": true,
"license": "Apache-2.0",
"type": "module",
+1 -1
View File
@@ -5535,7 +5535,7 @@ dependencies = [
[[package]]
name = "yt-desc-gen"
version = "0.33.0"
version = "0.34.0"
dependencies = [
"tauri",
"tauri-build",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "yt-desc-gen"
version = "0.33.0"
version = "0.34.0"
description = "YouTube Gameplay Description Generator"
authors = ["poli0981"]
edition = "2021"
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/crates/tauri-cli/schema.json",
"productName": "YTDescGen",
"version": "0.33.0",
"version": "0.34.0",
"identifier": "com.skullmute.ytdescgen",
"build": {
"beforeBuildCommand": "npm run build",
@@ -0,0 +1,79 @@
import { useTranslation } from "react-i18next";
import { ValidatedInput } from "@components/ui/ValidatedInput";
import { useEditorStore } from "@store/editor-store";
import { useSettingsStore } from "@store/settings-store";
import { validateEmails } from "@utils/validation";
/**
* Contact email input(s). Two modes, driven by the `splitContactEmail`
* settings toggle:
*
* - off (default) — a single "Contact Email" field, exactly as before.
* Feeds the description's single "📧 Business inquiries" line.
* - on — three purpose fields (general / advertising / game keys &
* playtest) that feed the grouped "📧 BUSINESS / CONTACT" block. The
* general field reuses the existing `contactEmail`, so a value entered
* before the toggle was flipped carries over as the Contact address.
*
* Every input allows up to 3 comma-separated addresses via
* {@link validateEmails}, and a malformed value never reaches the
* generated description ({@link ValidatedInput} clears it on error).
*/
export function ContactEmailEditor() {
const { t } = useTranslation("ui");
const contactEmail = useEditorStore((s) => s.contactEmail);
const adEmail = useEditorStore((s) => s.adEmail);
const gameKeyEmail = useEditorStore((s) => s.gameKeyEmail);
const setField = useEditorStore((s) => s.set);
const splitContactEmail = useSettingsStore((s) => s.splitContactEmail);
if (!splitContactEmail) {
return (
<ValidatedInput
label={t("editor.contactEmail")}
placeholder={t("editor.contactEmailPlaceholder")}
value={contactEmail ?? ""}
onChange={(v) => setField("contactEmail", v)}
validate={validateEmails}
helpText={t("editor.contactEmailHelp")}
inputMode="email"
autoComplete="email"
/>
);
}
return (
<div className="flex flex-col gap-3">
<ValidatedInput
label={t("editor.contactEmail")}
placeholder={t("editor.contactEmailPlaceholder")}
value={contactEmail ?? ""}
onChange={(v) => setField("contactEmail", v)}
validate={validateEmails}
helpText={t("editor.contactEmailHelp")}
inputMode="email"
autoComplete="email"
/>
<ValidatedInput
label={t("editor.adEmail")}
placeholder={t("editor.adEmailPlaceholder")}
value={adEmail ?? ""}
onChange={(v) => setField("adEmail", v)}
validate={validateEmails}
helpText={t("editor.adEmailHelp")}
inputMode="email"
autoComplete="email"
/>
<ValidatedInput
label={t("editor.gameKeyEmail")}
placeholder={t("editor.gameKeyEmailPlaceholder")}
value={gameKeyEmail ?? ""}
onChange={(v) => setField("gameKeyEmail", v)}
validate={validateEmails}
helpText={t("editor.gameKeyEmailHelp")}
inputMode="email"
autoComplete="email"
/>
</div>
);
}
+2
View File
@@ -27,6 +27,8 @@ export function ProfileCard({ profile }: ProfileCardProps) {
loadProfile({
channelName: profile.channelName,
contactEmail: profile.contactEmail,
adEmail: profile.adEmail ?? "",
gameKeyEmail: profile.gameKeyEmail ?? "",
social: { ...(profile.social ?? {}) },
rig: { ...(profile.rig ?? {}) },
resolution: profile.resolution,
@@ -34,6 +34,8 @@ export function ProfileSaveForm({ open, onClose, editProfile }: ProfileSaveFormP
name: name.trim() || "Unnamed Profile",
channelName: editProfile?.channelName ?? editor.channelName,
contactEmail: editProfile?.contactEmail ?? editor.contactEmail,
adEmail: editProfile?.adEmail ?? editor.adEmail,
gameKeyEmail: editProfile?.gameKeyEmail ?? editor.gameKeyEmail,
social: editProfile?.social ?? { ...editor.social },
rig: editProfile?.rig ?? { ...editor.rig },
resolution: editProfile?.resolution ?? editor.resolution,
@@ -56,6 +56,8 @@ export function TemplateSaveForm({ open, onClose }: TemplateSaveFormProps) {
timestamps: editor.timestamps,
playlistLink: editor.playlistLink,
contactEmail: editor.contactEmail,
adEmail: editor.adEmail,
gameKeyEmail: editor.gameKeyEmail,
musicAttribution: editor.musicAttribution,
thumbnailText: editor.thumbnailText,
pinnedComment: editor.pinnedComment,
+13
View File
@@ -71,6 +71,17 @@ export interface EditorDefaults {
timestamps: string;
playlistLink: string;
contactEmail: string;
/**
* v0.34.0 email-split fields. When the `splitContactEmail` settings
* toggle is on, the description's contact block renders a labeled line
* per purpose: `contactEmail` (general), `adEmail` (advertising /
* sponsorship inquiries — distinct from the video-sponsor-credit
* fields `sponsorName` / `sponsorPlatform`), and `gameKeyEmail` (game
* keys & playtest invites). Each holds up to 3 comma-separated emails
* (same `validateEmails` cap as `contactEmail`). Empty by default.
*/
adEmail: string;
gameKeyEmail: string;
musicAttribution: string;
sponsorName: string;
sponsorPlatform: string;
@@ -193,6 +204,8 @@ export const DEFAULTS = {
timestamps: "",
playlistLink: "",
contactEmail: "",
adEmail: "",
gameKeyEmail: "",
musicAttribution: "",
sponsorName: "",
sponsorPlatform: "",
+29 -2
View File
@@ -251,6 +251,11 @@ export interface BuildDescriptionOptions {
/** When true and the active profile's `thirdPartyAdText` is non-empty,
* emits a "🤝 SPONSORS & PARTNERS" block (v0.11). */
showThirdPartyAds?: boolean;
/** When true, the contact block (§12) splits into a grouped
* "📧 BUSINESS / CONTACT" block with one labeled line per non-empty
* purpose field (`contactEmail` / `adEmail` / `gameKeyEmail`) instead
* of the single "📧 Business inquiries" line. v0.34.0. */
splitContactEmail?: boolean;
/** When true, appends an AI-translation disclaimer block for output
* languages outside the trusted set ({@link TRANSLATION_TRUSTED} —
* English / Vietnamese, which are human-reviewed). v0.24.0. */
@@ -279,6 +284,7 @@ export function buildDescription(
showUsagePolicy = false,
showSponsorCredit = false,
showThirdPartyAds = false,
splitContactEmail = false,
showGameCopyright = false,
showTranslationQuality = false,
tEn,
@@ -695,8 +701,29 @@ export function buildDescription(
sections.push(t("description.sections.playlist", { link: input.playlistLink }));
}
// 12. Contact
if (input.contactEmail && input.contactEmail.trim()) {
// 12. Contact. Two modes, gated by the `splitContactEmail` toggle:
// • off (default) — a single "📧 Business inquiries" line, unchanged.
// • on — a grouped "📧 BUSINESS / CONTACT" block with one labeled line
// per non-empty purpose field. Each line is skipped when its field
// is empty, and the whole block is skipped when all three are empty
// (same skip logic as the Community block above).
if (splitContactEmail) {
const emailLines: string[] = [];
if (input.contactEmail?.trim()) {
emailLines.push(t("description.sections.emailContact", { email: input.contactEmail }));
}
if (input.adEmail?.trim()) {
emailLines.push(t("description.sections.emailAd", { email: input.adEmail }));
}
if (input.gameKeyEmail?.trim()) {
emailLines.push(t("description.sections.emailGameKeys", { email: input.gameKeyEmail }));
}
if (emailLines.length > 0) {
sections.push(
`${t("description.sections.contactHeader")}\n${emailLines.join("\n")}`,
);
}
} else if (input.contactEmail && input.contactEmail.trim()) {
sections.push(t("description.sections.contact", { email: input.contactEmail }));
}
+7
View File
@@ -47,6 +47,12 @@ export interface RenderOptions extends TagOptions {
* music section (v0.11).
*/
showThirdPartyAds?: boolean;
/**
* When true, the description's contact block splits into up to three
* labeled lines by purpose (general / advertising / game keys &
* playtest) instead of the single "📧 Business inquiries" line. v0.34.0.
*/
splitContactEmail?: boolean;
/**
* When true and the editor's `pubDevName` is non-empty, the description
* emits a `© {publisher}. All rights reserved.` line right after the
@@ -94,6 +100,7 @@ export function renderAll(
showUsagePolicy: options?.showUsagePolicy,
showSponsorCredit: options?.showSponsorCredit,
showThirdPartyAds: options?.showThirdPartyAds,
splitContactEmail: options?.splitContactEmail,
showGameCopyright: options?.showGameCopyright,
showTranslationQuality: options?.showTranslationQuality,
tEn: options?.tEn,
+9
View File
@@ -656,6 +656,15 @@ export interface GeneratorInput {
timestamps?: string;
playlistLink?: string;
contactEmail?: string;
/**
* v0.34.0 email-split fields. Rendered as labeled lines inside the
* contact block when the `splitContactEmail` render option is on:
* `adEmail` (advertising / sponsorship inquiries — distinct from
* {@link sponsorName}) and `gameKeyEmail` (game keys & playtest
* invites). Each holds up to 3 comma-separated emails.
*/
adEmail?: string;
gameKeyEmail?: string;
/**
* Music / sound attribution credit. Free-form multiline string.
* When set, adds a "🎵 MUSIC / SOUND" section to the description
+2
View File
@@ -58,6 +58,8 @@ export function buildGeneratorInputFromEditor(
timestamps: state.timestamps,
playlistLink: state.playlistLink,
contactEmail: state.contactEmail,
adEmail: state.adEmail,
gameKeyEmail: state.gameKeyEmail,
musicAttribution: state.musicAttribution,
sponsorName: state.sponsorName,
sponsorPlatform: state.sponsorPlatform,
+3
View File
@@ -19,6 +19,7 @@ export function useGeneratedOutput(): GeneratorOutput {
showGameCopyright,
showThirdPartyAds,
showTranslationQuality,
splitContactEmail,
titleFormat,
} = useSettingsStore();
@@ -49,6 +50,7 @@ export function useGeneratedOutput(): GeneratorOutput {
showGameCopyright,
showThirdPartyAds,
showTranslationQuality,
splitContactEmail,
titleFormat,
tEn,
}),
@@ -67,6 +69,7 @@ export function useGeneratedOutput(): GeneratorOutput {
showGameCopyright,
showThirdPartyAds,
showTranslationQuality,
splitContactEmail,
titleFormat,
],
);
+3
View File
@@ -25,6 +25,7 @@ export function useMultilangOutput(
showGameCopyright,
showThirdPartyAds,
showTranslationQuality,
splitContactEmail,
titleFormat,
} = useSettingsStore();
@@ -54,6 +55,7 @@ export function useMultilangOutput(
showGameCopyright,
showThirdPartyAds,
showTranslationQuality,
splitContactEmail,
titleFormat,
tEn,
bilingualContentBlocks: false,
@@ -74,6 +76,7 @@ export function useMultilangOutput(
showGameCopyright,
showThirdPartyAds,
showTranslationQuality,
splitContactEmail,
titleFormat,
tEn,
]);
+6 -2
View File
@@ -54,6 +54,8 @@
"instagramGroupLink", "instagramGroupLinkPlaceholder",
"facebookGroupLink", "facebookGroupLinkPlaceholder",
"contactEmail", "contactEmailPlaceholder", "contactEmailHelp",
"adEmail", "adEmailPlaceholder", "adEmailHelp",
"gameKeyEmail", "gameKeyEmailPlaceholder", "gameKeyEmailHelp",
"musicAttribution", "musicAttributionPlaceholder",
"sponsorName", "sponsorNamePlaceholder",
"sponsorPlatform", "sponsorPlatformPlaceholder",
@@ -188,7 +190,7 @@
"presets": ["title", "createNew", "editPreset", "loadPreset", "deleteConfirm", "emptyState", "selectPreset", "noPresets", "exportPresets", "importPresets"],
"templates": ["title", "createNew", "saveAsTemplate", "templateName", "templateNamePlaceholder", "loadTemplate", "deleteConfirm", "emptyState", "saveHint", "savedAs", "appliedToast", "exportTemplates", "importTemplates"],
"history": ["title", "emptyState", "clearAll", "clearConfirm", "searchPlaceholder"],
"settings": ["title", "appearance", "defaults", "editorSettings", "tagSettings", "historySettings", "theme", "appLanguage", "defaultOutputLanguage", "showCharCount", "compactTagDisplay", "historyLimit", "multilingualTags", "trendingTags", "hashtagCount", "showQualityBadge", "showCopyright", "showGameCopyright", "showGameCopyrightHint", "showUsagePolicy", "showSponsorCredit", "showThirdPartyAds", "thirdPartyAdsHint", "showTranslationQuality", "showTranslationQualityHint", "titleFormatTitle", "descriptionSettingsTitle", "badgePosition", "badgePositionPrefix", "badgePositionMiddle", "badgePositionSuffix", "titleSeparator", "titleSeparatorEmDash", "titleSeparatorHyphen", "titleSeparatorColon", "titleSeparatorPipe", "badgeCase", "badgeCaseUpper", "badgeCaseLower", "showPinnedCommentTemplate", "pinnedCommentIncludeAskNextGame", "pinnedCommentIncludeGenrePlaylist", "genrePlaylistsTitle", "genrePlaylistsHelp", "genrePlaylistsEmptyHint", "logSettings", "logRetentionDays", "logRetentionHint"],
"settings": ["title", "appearance", "defaults", "editorSettings", "tagSettings", "historySettings", "theme", "appLanguage", "defaultOutputLanguage", "showCharCount", "compactTagDisplay", "historyLimit", "multilingualTags", "trendingTags", "hashtagCount", "showQualityBadge", "showCopyright", "showGameCopyright", "showGameCopyrightHint", "showUsagePolicy", "showSponsorCredit", "showThirdPartyAds", "thirdPartyAdsHint", "splitContactEmail", "splitContactEmailHint", "showTranslationQuality", "showTranslationQualityHint", "titleFormatTitle", "descriptionSettingsTitle", "badgePosition", "badgePositionPrefix", "badgePositionMiddle", "badgePositionSuffix", "titleSeparator", "titleSeparatorEmDash", "titleSeparatorHyphen", "titleSeparatorColon", "titleSeparatorPipe", "badgeCase", "badgeCaseUpper", "badgeCaseLower", "showPinnedCommentTemplate", "pinnedCommentIncludeAskNextGame", "pinnedCommentIncludeGenrePlaylist", "genrePlaylistsTitle", "genrePlaylistsHelp", "genrePlaylistsEmptyHint", "logSettings", "logRetentionDays", "logRetentionHint"],
"batch": ["title", "startPart", "endPart", "generateBatch", "copyAllBatch", "emptyState"],
"socialPost": ["title", "single", "bulk", "copyCaption", "emptyState", "trimmedHint", "overLimitHint", "exported", "exportFailed", "imported", "importFailed", "importedHeading"],
"socialPost.platforms": ["tiktok", "instagram_reels", "facebook_reels"],
@@ -226,7 +228,9 @@
"modList", "vnDonate",
"sponsorCredit", "thirdPartyAds", "music", "donate", "social",
"community",
"playlist", "contact", "cta",
"playlist", "contact",
"contactHeader", "emailContact", "emailAd", "emailGameKeys",
"cta",
"copyright", "usagePolicyHeader", "usagePolicy"
],
"description.videoSettings": ["styleLine", "styleLineNoEditor"],
+4
View File
@@ -123,6 +123,10 @@
"community": "💬 COMMUNITY / JOIN THE GROUP",
"playlist": "▶️ Watch the full series: {{link}}",
"contact": "📧 Business inquiries: {{email}}",
"contactHeader": "📧 BUSINESS / CONTACT",
"emailContact": "📧 Contact: {{email}}",
"emailAd": "🤝 Advertising: {{email}}",
"emailGameKeys": "🎮 Game keys & playtest: {{email}}",
"cta": "👍 Like | 🔔 Subscribe | ↗️ Share",
"copyright": "© {{year}} {{channelName}} — Video content only. Game, characters, music, and all related intellectual property belong to their respective owners. All rights reserved on this recording.",
"usagePolicyHeader": "📋 USAGE POLICY",
+8
View File
@@ -306,6 +306,12 @@
"facebookGroupLinkPlaceholder": "https://facebook.com/groups/yourid",
"contactEmail": "Contact Email",
"contactEmailPlaceholder": "business@example.com",
"adEmail": "Advertising / Sponsorship Email",
"adEmailPlaceholder": "sponsors@example.com",
"adEmailHelp": "Up to 3 emails, comma-separated",
"gameKeyEmail": "Game Keys & Playtest Email",
"gameKeyEmailPlaceholder": "games@example.com",
"gameKeyEmailHelp": "Up to 3 emails, comma-separated",
"musicAttribution": "Music / Sound Attribution",
"musicAttributionPlaceholder": "Music by Karl Casey @ White Bat Audio\nSFX from Freesound.org",
"sponsorName": "Sponsor (publisher / developer)",
@@ -1001,6 +1007,8 @@
"showSponsorCredit": "Show sponsor credit line in description (thanks for the key)",
"showThirdPartyAds": "Show third-party advertising block in description",
"thirdPartyAdsHint": "Set ad copy in your channel profile (Profiles → Edit).",
"splitContactEmail": "Split contact email by purpose",
"splitContactEmailHint": "Adds Advertising and Game keys & playtest email fields, shown as a grouped block in the description.",
"showTranslationQuality": "Show translation-quality notice",
"showTranslationQualityHint": "Adds an AI-translation disclaimer to descriptions generated in languages other than English and Vietnamese.",
"titleFormatTitle": "Title Format",
+4
View File
@@ -123,6 +123,10 @@
"community": "💬 COMUNIDAD / ÚNETE AL GRUPO",
"playlist": "▶️ Ver la serie completa: {{link}}",
"contact": "📧 Consultas comerciales: {{email}}",
"contactHeader": "📧 CONTACTO / NEGOCIOS",
"emailContact": "📧 Contacto: {{email}}",
"emailAd": "🤝 Publicidad: {{email}}",
"emailGameKeys": "🎮 Claves de juego y playtest: {{email}}",
"cta": "👍 Me gusta | 🔔 Suscríbete | ↗️ Comparte",
"copyright": "© {{year}} {{channelName}} — Solo el contenido del vídeo. El juego, los personajes, la música y toda la propiedad intelectual relacionada pertenecen a sus respectivos propietarios. Todos los derechos reservados sobre esta grabación.",
"usagePolicyHeader": "📋 POLÍTICA DE USO",
+8
View File
@@ -306,6 +306,12 @@
"facebookGroupLinkPlaceholder": "https://facebook.com/groups/yourid",
"contactEmail": "Correo de Contacto",
"contactEmailPlaceholder": "negocios@ejemplo.com",
"adEmail": "Email de publicidad / patrocinio",
"adEmailPlaceholder": "patrocinios@ejemplo.com",
"adEmailHelp": "Hasta 3 emails, separados por comas",
"gameKeyEmail": "Email de claves de juego y playtest",
"gameKeyEmailPlaceholder": "juegos@ejemplo.com",
"gameKeyEmailHelp": "Hasta 3 emails, separados por comas",
"musicAttribution": "Crédito Musical / Sonidos",
"musicAttributionPlaceholder": "Música: Karl Casey @ White Bat Audio\nEfectos: Freesound.org",
"sponsorName": "Patrocinador (editor / desarrollador)",
@@ -1001,6 +1007,8 @@
"showSponsorCredit": "Mostrar línea de agradecimiento al patrocinador (clave) en la descripción",
"showThirdPartyAds": "Mostrar bloque de anuncios de terceros en la descripción",
"thirdPartyAdsHint": "Configura el texto publicitario en el perfil del canal (Perfiles → Editar).",
"splitContactEmail": "Separar el email de contacto por finalidad",
"splitContactEmailHint": "Añade campos de email de Publicidad y Claves de juego y playtest, mostrados como un bloque agrupado en la descripción.",
"showTranslationQuality": "Mostrar aviso de calidad de traducción",
"showTranslationQualityHint": "Añade un aviso de traducción por IA a las descripciones generadas en idiomas distintos del inglés y el vietnamita.",
"titleFormatTitle": "Formato del título",
+4
View File
@@ -123,6 +123,10 @@
"community": "💬 コミュニティ / グループに参加",
"playlist": "▶️ シリーズ全体を見る:{{link}}",
"contact": "📧 お仕事の依頼:{{email}}",
"contactHeader": "📧 お仕事・お問い合わせ",
"emailContact": "📧 連絡先:{{email}}",
"emailAd": "🤝 広告:{{email}}",
"emailGameKeys": "🎮 ゲームキー・プレイテスト:{{email}}",
"cta": "👍 いいね | 🔔 チャンネル登録 | ↗️ シェア",
"copyright": "© {{year}} {{channelName}} — 動画コンテンツのみ。ゲーム、キャラクター、音楽、関連する知的財産はすべて各権利者に帰属します。本録画物の全権利は留保されます。",
"usagePolicyHeader": "📋 動画利用ポリシー",
+8
View File
@@ -306,6 +306,12 @@
"facebookGroupLinkPlaceholder": "https://facebook.com/groups/yourid",
"contactEmail": "連絡先メール",
"contactEmailPlaceholder": "business@example.com",
"adEmail": "広告・スポンサー用メール",
"adEmailPlaceholder": "sponsors@example.com",
"adEmailHelp": "最大3つのメール、カンマ区切り",
"gameKeyEmail": "ゲームキー・プレイテスト用メール",
"gameKeyEmailPlaceholder": "games@example.com",
"gameKeyEmailHelp": "最大3つのメール、カンマ区切り",
"musicAttribution": "音楽・サウンドクレジット",
"musicAttributionPlaceholder": "音楽: Karl Casey @ White Bat Audio\n効果音: Freesound.org",
"sponsorName": "スポンサー (パブリッシャー / デベロッパー)",
@@ -1001,6 +1007,8 @@
"showSponsorCredit": "説明欄にスポンサーへの感謝行を追加 (キー提供)",
"showThirdPartyAds": "説明欄にサードパーティ広告ブロックを表示",
"thirdPartyAdsHint": "広告コピーはチャンネルプロフィールに設定してください (プロフィール → 編集)。",
"splitContactEmail": "連絡先メールを用途別に分ける",
"splitContactEmailHint": "広告用とゲームキー・プレイテスト用のメール欄を追加し、説明欄にまとめて表示します。",
"showTranslationQuality": "翻訳品質の注記を表示",
"showTranslationQualityHint": "英語とベトナム語以外の言語で生成した説明にAI翻訳の注記を追加します。",
"titleFormatTitle": "タイトル書式",
+4
View File
@@ -123,6 +123,10 @@
"community": "💬 커뮤니티 / 그룹 참여",
"playlist": "▶️ 전체 시리즈 보기: {{link}}",
"contact": "📧 비즈니스 문의: {{email}}",
"contactHeader": "📧 비즈니스 / 문의",
"emailContact": "📧 연락처: {{email}}",
"emailAd": "🤝 광고: {{email}}",
"emailGameKeys": "🎮 게임 키 & 플레이테스트: {{email}}",
"cta": "👍 좋아요 | 🔔 구독 | ↗️ 공유",
"copyright": "© {{year}} {{channelName}} — 영상 콘텐츠에 한함. 게임, 캐릭터, 음악 및 관련 지식재산권은 각 권리자에게 귀속됩니다. 본 녹화물의 모든 권리를 보유합니다.",
"usagePolicyHeader": "📋 영상 사용 정책",
+8
View File
@@ -306,6 +306,12 @@
"facebookGroupLinkPlaceholder": "https://facebook.com/groups/yourid",
"contactEmail": "문의 이메일",
"contactEmailPlaceholder": "business@example.com",
"adEmail": "광고 / 협찬 이메일",
"adEmailPlaceholder": "sponsors@example.com",
"adEmailHelp": "최대 3개 이메일, 쉼표로 구분",
"gameKeyEmail": "게임 키 & 플레이테스트 이메일",
"gameKeyEmailPlaceholder": "games@example.com",
"gameKeyEmailHelp": "최대 3개 이메일, 쉼표로 구분",
"musicAttribution": "음악 / 사운드 크레딧",
"musicAttributionPlaceholder": "음악: Karl Casey @ White Bat Audio\n효과음: Freesound.org",
"sponsorName": "스폰서 (퍼블리셔 / 개발사)",
@@ -1001,6 +1007,8 @@
"showSponsorCredit": "설명란에 스폰서 감사 문구 추가 (키 제공)",
"showThirdPartyAds": "설명란에 써드파티 광고 블록 표시",
"thirdPartyAdsHint": "광고 문구는 채널 프로필에 입력하세요 (프로필 → 편집).",
"splitContactEmail": "연락처 이메일을 용도별로 분리",
"splitContactEmailHint": "광고 및 게임 키 & 플레이테스트 이메일 필드를 추가하고 설명란에 묶음 블록으로 표시합니다.",
"showTranslationQuality": "번역 품질 안내 표시",
"showTranslationQualityHint": "영어와 베트남어 외의 언어로 생성된 설명에 AI 번역 안내를 추가합니다.",
"titleFormatTitle": "제목 형식",
+4
View File
@@ -123,6 +123,10 @@
"community": "💬 CỘNG ĐỒNG / THAM GIA NHÓM",
"playlist": "▶️ Xem toàn bộ series: {{link}}",
"contact": "📧 Liên hệ hợp tác: {{email}}",
"contactHeader": "📧 LIÊN HỆ CÔNG VIỆC",
"emailContact": "📧 Liên hệ: {{email}}",
"emailAd": "🤝 Quảng cáo: {{email}}",
"emailGameKeys": "🎮 Key game & mời playtest: {{email}}",
"cta": "👍 Like | 🔔 Đăng ký | ↗️ Chia sẻ",
"copyright": "© {{year}} {{channelName}} — Bản quyền chỉ áp dụng cho nội dung video. Game, nhân vật, âm nhạc và mọi tài sản trí tuệ liên quan thuộc về chủ sở hữu tương ứng. Mọi quyền được bảo lưu với bản ghi này.",
"usagePolicyHeader": "📋 ĐIỀU KIỆN DÙNG VIDEO",
+8
View File
@@ -306,6 +306,12 @@
"facebookGroupLinkPlaceholder": "https://facebook.com/groups/yourid",
"contactEmail": "Email liên hệ",
"contactEmailPlaceholder": "business@example.com",
"adEmail": "Email quảng cáo / tài trợ",
"adEmailPlaceholder": "sponsors@example.com",
"adEmailHelp": "Tối đa 3 email, cách nhau bằng dấu phẩy",
"gameKeyEmail": "Email key game & mời playtest",
"gameKeyEmailPlaceholder": "games@example.com",
"gameKeyEmailHelp": "Tối đa 3 email, cách nhau bằng dấu phẩy",
"musicAttribution": "Credit nhạc / âm thanh",
"musicAttributionPlaceholder": "Nhạc: Karl Casey @ White Bat Audio\nSFX: Freesound.org",
"sponsorName": "Sponsor (publisher / developer)",
@@ -1001,6 +1007,8 @@
"showSponsorCredit": "Hiện dòng cảm ơn sponsor (tặng key) trong description",
"showThirdPartyAds": "Hiện block quảng cáo bên thứ 3 trong description",
"thirdPartyAdsHint": "Nhập nội dung quảng cáo trong Hồ sơ kênh (Profiles → Sửa).",
"splitContactEmail": "Tách email liên hệ theo mục đích",
"splitContactEmailHint": "Thêm ô email Quảng cáo và Key game & mời playtest, hiển thị thành một khối gộp trong phần mô tả.",
"showTranslationQuality": "Hiện ghi chú chất lượng bản dịch",
"showTranslationQualityHint": "Thêm ghi chú về dịch thuật bằng AI vào mô tả ở các ngôn ngữ khác ngoài tiếng Anh và tiếng Việt.",
"titleFormatTitle": "Định dạng tiêu đề",
+4
View File
@@ -123,6 +123,10 @@
"community": "💬 社区 / 加入群组",
"playlist": "▶️ 观看完整系列:{{link}}",
"contact": "📧 商务合作:{{email}}",
"contactHeader": "📧 商务 / 联系",
"emailContact": "📧 联系:{{email}}",
"emailAd": "🤝 广告:{{email}}",
"emailGameKeys": "🎮 游戏密钥 & 试玩:{{email}}",
"cta": "👍 点赞 | 🔔 订阅 | ↗️ 分享",
"copyright": "© {{year}} {{channelName}} — 仅限视频内容。游戏、角色、音乐及相关知识产权归各自所有者所有。保留本录像的所有权利。",
"usagePolicyHeader": "📋 视频使用规则",
+8
View File
@@ -306,6 +306,12 @@
"facebookGroupLinkPlaceholder": "https://facebook.com/groups/yourid",
"contactEmail": "联系邮箱",
"contactEmailPlaceholder": "business@example.com",
"adEmail": "广告 / 赞助邮箱",
"adEmailPlaceholder": "sponsors@example.com",
"adEmailHelp": "最多3个邮箱,用逗号分隔",
"gameKeyEmail": "游戏密钥 & 试玩邀请邮箱",
"gameKeyEmailPlaceholder": "games@example.com",
"gameKeyEmailHelp": "最多3个邮箱,用逗号分隔",
"musicAttribution": "音乐 / 音效署名",
"musicAttributionPlaceholder": "音乐:Karl Casey @ White Bat Audio\n音效:Freesound.org",
"sponsorName": "赞助商 (发行商 / 开发商)",
@@ -1001,6 +1007,8 @@
"showSponsorCredit": "在描述中添加赞助商感谢行(提供激活码)",
"showThirdPartyAds": "在描述中显示第三方广告区块",
"thirdPartyAdsHint": "广告文案请在频道配置中设置(配置文件 → 编辑)。",
"splitContactEmail": "按用途拆分联系邮箱",
"splitContactEmailHint": "添加广告和游戏密钥 & 试玩邮箱字段,在描述中以分组区块显示。",
"showTranslationQuality": "显示翻译质量提示",
"showTranslationQualityHint": "为以英语和越南语以外语言生成的简介添加 AI 翻译说明。",
"titleFormatTitle": "标题格式",
+3 -11
View File
@@ -11,6 +11,7 @@ import { RigEditor } from "@components/editor/RigEditor";
import { SocialEditor } from "@components/editor/SocialEditor";
import { VietnameseDonateEditor } from "@components/editor/VietnameseDonateEditor";
import { CommunityEditor } from "@components/editor/CommunityEditor";
import { ContactEmailEditor } from "@components/editor/ContactEmailEditor";
import { ContentWarningChecklist } from "@components/editor/ContentWarningChecklist";
import { PlaythroughNotesForm } from "@components/editor/PlaythroughNotesForm";
import { TechNotesChecklist } from "@components/editor/TechNotesChecklist";
@@ -29,7 +30,7 @@ import { useEditorStore } from "@store/editor-store";
import { useSettingsStore } from "@store/settings-store";
import { useTranslation } from "react-i18next";
import { useDocumentTitle } from "@hooks/use-document-title";
import { validateEmails, validatePlaylistUrl } from "@utils/validation";
import { validatePlaylistUrl } from "@utils/validation";
import { RotateCcw } from "lucide-react";
import { useState } from "react";
@@ -111,16 +112,7 @@ export function EditorPage() {
inputMode="url"
autoComplete="off"
/>
<ValidatedInput
label={t("editor.contactEmail")}
placeholder={t("editor.contactEmailPlaceholder")}
value={store.contactEmail ?? ""}
onChange={(v) => store.set("contactEmail", v)}
validate={validateEmails}
helpText={t("editor.contactEmailHelp")}
inputMode="email"
autoComplete="email"
/>
<ContactEmailEditor />
</Accordion>
<Accordion
+10
View File
@@ -333,6 +333,16 @@ export function SettingsPage() {
{t("settings.thirdPartyAdsHint")}
</p>
)}
<Toggle
label={t("settings.splitContactEmail")}
checked={settings.splitContactEmail}
onChange={(v) => settings.setSetting("splitContactEmail", v)}
/>
{settings.splitContactEmail && (
<p className="-mt-1 ml-14 text-xs text-text-muted">
{t("settings.splitContactEmailHint")}
</p>
)}
<Toggle
label={t("settings.showTranslationQuality")}
checked={settings.showTranslationQuality}
+25 -1
View File
@@ -96,6 +96,12 @@ export interface EditorData {
timestamps: string;
playlistLink: string;
contactEmail: string;
/** v0.34.0 email-split fields — see {@link DEFAULTS.editor}. Rendered
* as labeled lines in the contact block when `splitContactEmail` is
* on. `adEmail` = advertising/sponsorship inquiries (distinct from
* `sponsorName`); `gameKeyEmail` = game keys & playtest invites. */
adEmail: string;
gameKeyEmail: string;
musicAttribution: string;
sponsorName: string;
sponsorPlatform: string;
@@ -355,6 +361,8 @@ const initialState: EditorData = {
timestamps: DEFAULTS.editor.timestamps,
playlistLink: DEFAULTS.editor.playlistLink,
contactEmail: DEFAULTS.editor.contactEmail,
adEmail: DEFAULTS.editor.adEmail,
gameKeyEmail: DEFAULTS.editor.gameKeyEmail,
musicAttribution: DEFAULTS.editor.musicAttribution,
sponsorName: DEFAULTS.editor.sponsorName,
sponsorPlatform: DEFAULTS.editor.sponsorPlatform,
@@ -533,7 +541,14 @@ export const useEditorStore = create<EditorState>()(
// moved OUT of the generic `social` map: the migration lifts a
// legacy `social.fb_group` value into `facebookGroupLink` and
// drops the dead key. Other fields back-fill to "".
version: 17,
// v17 → v18: v0.34.0. Email split — `adEmail` (advertising /
// sponsorship inquiries) and `gameKeyEmail` (game keys &
// playtest invites) joined the schema. Both render as labeled
// lines in the contact block when the `splitContactEmail`
// settings toggle is on. Additive: both back-fill to "".
// Non-string values coerce to "". The existing `contactEmail`
// is reused as the general-contact line, so no data moves.
version: 18,
migrate: (persistedState, version) =>
migrateEditorState(persistedState, version),
partialize: (state) => ({
@@ -573,6 +588,8 @@ export const useEditorStore = create<EditorState>()(
timestamps: state.timestamps,
playlistLink: state.playlistLink,
contactEmail: state.contactEmail,
adEmail: state.adEmail,
gameKeyEmail: state.gameKeyEmail,
musicAttribution: state.musicAttribution,
sponsorName: state.sponsorName,
sponsorPlatform: state.sponsorPlatform,
@@ -883,6 +900,13 @@ export function migrateEditorState(
delete (social as Record<string, unknown>).fb_group;
}
}
if (version < 18) {
// v0.34.0 Email split. Additive back-fill + defensive coercion. The
// existing `contactEmail` is reused as the general-contact line, so
// there's nothing to lift — just seed the two new purpose fields.
if (typeof state.adEmail !== "string") state.adEmail = "";
if (typeof state.gameKeyEmail !== "string") state.gameKeyEmail = "";
}
return { ...initialState, ...state } as EditorData;
}
+22 -8
View File
@@ -15,12 +15,19 @@ import type { GraphicsPreset } from "@config/graphics-settings";
* persisted shapes — pre-v0.11 profiles get a `""` back-fill via the
* profile-store v0→v1 migrate fn. Held on the profile (not per-video)
* because partner / affiliate copy is channel-stable.
*
* v0.34.0: `adEmail` / `gameKeyEmail` joined the schema (the email-split
* fields). Channel-stable business addresses, so persisted on the profile
* like `contactEmail`. Pre-v0.34 profiles get a `""` back-fill via the
* v1→v2 migrate fn.
*/
export interface Profile {
id: string;
name: string;
channelName: string;
contactEmail: string;
adEmail: string;
gameKeyEmail: string;
social: Record<string, string>;
rig: Record<string, string>;
resolution: string;
@@ -98,16 +105,23 @@ export const useProfileStore = create<ProfileState>()(
// v0 (unversioned) → v1: v0.11 added `thirdPartyAdText`. The store
// had no version field before — anything `version < 1` is treated
// as "pre-v0.11" and gets the empty-string back-fill.
version: 1,
// v1 → v2: v0.34.0 added `adEmail` / `gameKeyEmail` (email split).
// Additive — pre-v0.34 profiles get a `""` back-fill.
version: 2,
migrate: (persistedState: unknown, version: number) => {
if (!persistedState || typeof persistedState !== "object") return persistedState;
if (version < 1) {
const state = persistedState as { profiles?: Array<Record<string, unknown>> };
if (Array.isArray(state.profiles)) {
state.profiles = state.profiles.map((p) =>
typeof p.thirdPartyAdText === "string" ? p : { ...p, thirdPartyAdText: "" },
);
}
const state = persistedState as { profiles?: Array<Record<string, unknown>> };
if (version < 1 && Array.isArray(state.profiles)) {
state.profiles = state.profiles.map((p) =>
typeof p.thirdPartyAdText === "string" ? p : { ...p, thirdPartyAdText: "" },
);
}
if (version < 2 && Array.isArray(state.profiles)) {
state.profiles = state.profiles.map((p) => ({
...p,
adEmail: typeof p.adEmail === "string" ? p.adEmail : "",
gameKeyEmail: typeof p.gameKeyEmail === "string" ? p.gameKeyEmail : "",
}));
}
return persistedState as { profiles: Profile[] };
},
+10
View File
@@ -51,6 +51,15 @@ export interface SettingsData {
* default so existing users don't see a new block after upgrade.
*/
showTranslationQuality: boolean;
/**
* v0.34.0 opt-in toggle. When true, the description's contact block
* splits into up to three labeled lines by purpose — general
* (`contactEmail`), advertising / sponsorship (`adEmail`), and game
* keys & playtest (`gameKeyEmail`) — and the editor exposes the two
* extra fields. Off by default so existing users keep the single
* "📧 Business inquiries" line and see no new fields after upgrade.
*/
splitContactEmail: boolean;
/**
* When true, Output + Batch render a generated pinned-comment
* template alongside the user's freeform pinnedComment field. Default
@@ -139,6 +148,7 @@ export const initialSettings: SettingsData = {
showGameCopyright: false,
showThirdPartyAds: false,
showTranslationQuality: false,
splitContactEmail: false,
showPinnedCommentTemplate: false,
pinnedCommentIncludeAskNextGame: true,
pinnedCommentIncludeGenrePlaylist: false,
+5 -1
View File
@@ -70,7 +70,10 @@ export const useSettingsStore = create<SettingsState>()(
// path as v8.
// v9 → v10: v0.17.0 added `logRetentionDays`. Additive — defaults to
// 7 days; `healSettings` clamps incoming values to [1, 90].
version: 10,
// v10 → v11: v0.34.0 added `splitContactEmail`. Additive — the
// `initialSettings` spread in `healSettings` back-fills the default
// (false), so no explicit per-version migration step is required.
version: 11,
migrate: (persistedState: unknown): SettingsData => healSettings(persistedState),
partialize: (state) => extractData(state),
onRehydrateStorage: () => {
@@ -117,6 +120,7 @@ export function extractData(state: SettingsData): SettingsData {
showGameCopyright: state.showGameCopyright,
showThirdPartyAds: state.showThirdPartyAds,
showTranslationQuality: state.showTranslationQuality,
splitContactEmail: state.splitContactEmail,
showPinnedCommentTemplate: state.showPinnedCommentTemplate,
pinnedCommentIncludeAskNextGame: state.pinnedCommentIncludeAskNextGame,
pinnedCommentIncludeGenrePlaylist: state.pinnedCommentIncludeGenrePlaylist,
+5
View File
@@ -79,6 +79,11 @@ export interface TemplateSnapshot {
timestamps: string;
playlistLink: string;
contactEmail: string;
/** v0.34.0 email-split fields. Optional for back-compat with pre-v0.34
* templates — `loadTemplate` spreads `...snapshot` onto editor state, so
* a missing key keeps the editor's existing value. */
adEmail?: string;
gameKeyEmail?: string;
musicAttribution: string;
thumbnailText: string;
pinnedComment: string;
+1 -1
View File
@@ -61,7 +61,7 @@ export const SCHEMA_VERSIONS: Record<ExportType, number> = {
profile: 1, // v0.11 added `thirdPartyAdText`
preset: 2, // v0.5 added `genres[]` (was `genre`)
template: 1, // v0.11 vendor-coercion
settings: 10, // matches settings-store persist version
settings: 11, // matches settings-store persist version
history: 2, // v0.5 added `genres[]` to HistoryEntry
social: 1, // v0.24.0 cross-post caption bundle (generated captions)
};
+66
View File
@@ -1012,6 +1012,72 @@ describe("buildDescription", () => {
expect(result).toContain("Business inquiries: test@example.com");
});
describe("splitContactEmail", () => {
it("keeps the single business line when the toggle is off (default)", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
contactEmail: "contact@example.com",
adEmail: "ads@example.com",
gameKeyEmail: "games@example.com",
}),
t,
);
expect(result).toContain("Business inquiries: contact@example.com");
// The extra purpose fields are ignored while the toggle is off.
expect(result).not.toContain("BUSINESS / CONTACT");
expect(result).not.toContain("ads@example.com");
expect(result).not.toContain("games@example.com");
});
it("renders a grouped block with one labeled line per non-empty field", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
contactEmail: "contact@example.com",
adEmail: "ads@example.com",
gameKeyEmail: "games@example.com",
}),
t,
{ splitContactEmail: true },
);
expect(result).toContain("BUSINESS / CONTACT");
expect(result).toContain("Contact: contact@example.com");
expect(result).toContain("Advertising: ads@example.com");
expect(result).toContain("Game keys & playtest: games@example.com");
// The single-line form must not also appear.
expect(result).not.toContain("Business inquiries:");
});
it("skips a purpose line whose field is empty", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
contactEmail: "contact@example.com",
adEmail: "",
gameKeyEmail: "games@example.com",
}),
t,
{ splitContactEmail: true },
);
expect(result).toContain("BUSINESS / CONTACT");
expect(result).toContain("Contact: contact@example.com");
expect(result).toContain("Game keys & playtest: games@example.com");
expect(result).not.toContain("Advertising:");
});
it("omits the whole block when all three fields are empty", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ contactEmail: "", adEmail: "", gameKeyEmail: "" }),
t,
{ splitContactEmail: true },
);
expect(result).not.toContain("BUSINESS / CONTACT");
expect(result).not.toContain("Business inquiries:");
});
});
it("generates part description correctly", () => {
const t = createMockT("en");
const result = buildDescription(
+51
View File
@@ -385,3 +385,54 @@ describe("migrateEditorState — v16 → v17 (v0.33.0 Community expansion)", ()
expect(result.social.fb_group).toBeUndefined();
});
});
describe("migrateEditorState — v17 → v18 (v0.34.0 Email split)", () => {
// Route v9 through every prior migration, then strip the v18 keys so the
// v18 block is what supplies them.
function makeV17Persisted(
overrides: Record<string, unknown> = {},
): Record<string, unknown> {
const full = migrateEditorState(makeV9Persisted(), 9) as unknown as Record<
string,
unknown
>;
delete full.adEmail;
delete full.gameKeyEmail;
return { ...full, ...overrides };
}
it("back-fills the new email fields with empty strings", () => {
const result = migrateEditorState(makeV17Persisted(), 17);
expect(result.adEmail).toBe("");
expect(result.gameKeyEmail).toBe("");
});
it("coerces non-string persisted values to empty strings", () => {
const result = migrateEditorState(
makeV17Persisted({ adEmail: 42, gameKeyEmail: null }),
17,
);
expect(result.adEmail).toBe("");
expect(result.gameKeyEmail).toBe("");
});
it("preserves valid persisted email values", () => {
const result = migrateEditorState(
makeV17Persisted({
adEmail: "ads@example.com",
gameKeyEmail: "games@example.com",
}),
17,
);
expect(result.adEmail).toBe("ads@example.com");
expect(result.gameKeyEmail).toBe("games@example.com");
});
it("leaves the existing contactEmail untouched (reused as the Contact line)", () => {
const result = migrateEditorState(
makeV17Persisted({ contactEmail: "hello@channel.com" }),
17,
);
expect(result.contactEmail).toBe("hello@channel.com");
});
});
+1
View File
@@ -80,6 +80,7 @@ describe("healSettings", () => {
showSponsorCredit: true,
showThirdPartyAds: false,
showTranslationQuality: true,
splitContactEmail: true,
titleFormat: {
badgePosition: "prefix" as const,
separator: "hyphen" as const,