diff --git a/apps/desktop/scripts/screens.ts b/apps/desktop/scripts/screens.ts index 2226825..078d188 100644 --- a/apps/desktop/scripts/screens.ts +++ b/apps/desktop/scripts/screens.ts @@ -85,33 +85,6 @@ for (const theme of themes) { await page.locator('.fchip').first().click(); await page.getByPlaceholder(/Search apps|Uygulama, bundle/).fill(''); } - if (!only.length || only.includes('tf-edit')) { - // TestFlight: What to Test editor of the newest build - await page.goto(`${base}/?start=app:testflight&theme=${theme}&lang=${lang}`); - await settle(page); - await page.getByRole('button', { name: /What to Test|Neyi test etmeli/ }).first().click(); - await page.getByRole('textbox').first().fill('New combo meter and the calmer night palette. Please try level 31 at a 20x combo.'); - await page.waitForTimeout(200); - await page.evaluate(() => document.getElementById('content')?.scrollBy({ top: 330 })); - await page.waitForTimeout(200); - await shot('tf-edit'); - } - if (!only.length || only.includes('reply-edit')) { - // Reviews: the reply editor of the approved draft, edited (not saved yet) - await page.goto(`${base}/?start=app:reviews&theme=${theme}&lang=${lang}`); - await settle(page); - await page.locator('textarea.reply-edit').fill('Sorry about the lost streak! The fix for the crash at high combos is in 2.4.0, in review now. Thank you for the level number.'); - await page.waitForTimeout(200); - await shot('reply-edit'); - } - if (!only.length || only.includes('write-toast')) { - // a write running: halt the Play rollout (owner action), caught with its progress toast - await page.goto(`${base}/?start=app:releases&theme=${theme}&lang=${lang}`); - await settle(page); - await page.getByRole('button', { name: /^Halt$|^Durdur$/ }).first().click(); - await page.waitForTimeout(450); - await shot('write-toast'); - } if (!only.length || only.includes('import')) { // Import apps running, with its progress toast await page.goto(`${base}/?start=accounts&theme=${theme}&lang=${lang}`); diff --git a/apps/desktop/src-tauri/src/commands.rs b/apps/desktop/src-tauri/src/commands.rs index c53baa7..f685852 100644 --- a/apps/desktop/src-tauri/src/commands.rs +++ b/apps/desktop/src-tauri/src/commands.rs @@ -138,7 +138,7 @@ pub async fn sidecar_call(window: WebviewWindow, app: AppHandle, state: State<'_ let mut p = policy::sanitize_js_call(&method, kind, ¶ms.unwrap_or(Value::Null)).map_err(Fail::host)?; let args = p.get("args").cloned().unwrap_or_else(|| json!({})); let mut cache_project = None; - if matches!(kind, Some(Kind::Read | Kind::Write | Kind::Owner)) { + if matches!(kind, Some(Kind::Read | Kind::Write)) { let id = project_id.ok_or_else(|| Fail::host(format!("{method} needs a project")))?; if id.starts_with("store:") { // a store-only app: store reads only, through the sidecar's generated config @@ -242,26 +242,8 @@ pub fn dialog_summary(title: &str, description: &str, project: &str, network: bo s } -/// Summary of an owner action: users see it right away, so the dialog says so in plain words. -pub fn owner_summary(title: &str, description: &str, project: &str) -> String { - format!("{title} · {project}\n\n{description}\n\nThis is your decision: it changes what users get on the store right away. storebound does it only because you press the button below.") -} - -/// Dialog title and the confirm button of a write: owner actions name the action on the button. -pub fn dialog_labels(kind: Kind, title: &str) -> (String, String) { - if kind == Kind::Owner { - (format!("Owner action: {title}"), format!("Yes: {title}")) - } else { - (format!("Apply: {title}"), "Apply".to_string()) - } -} - /// Native Apply / Cancel dialog; true on Apply. async fn confirm_dialog(window: &WebviewWindow, title: String, text: String) -> Res { - confirm_dialog_with(window, title, text, "Apply".into()).await -} - -async fn confirm_dialog_with(window: &WebviewWindow, title: String, text: String, ok: String) -> Res { let w = window.clone(); tauri::async_runtime::spawn_blocking(move || { w.app_handle() @@ -269,7 +251,7 @@ async fn confirm_dialog_with(window: &WebviewWindow, title: String, text: String .message(text) .title(title) .kind(MessageDialogKind::Warning) - .buttons(MessageDialogButtons::OkCancelCustom(ok, "Cancel".into())) + .buttons(MessageDialogButtons::OkCancelCustom("Apply".into(), "Cancel".into())) .parent(&w) .blocking_show() }) @@ -284,11 +266,9 @@ pub async fn write_with_confirm(window: WebviewWindow, app: AppHandle, state: St guard(&window)?; let job = job_of(job)?; let r = state.sidecar.get(&app).await?; - let kind = r.kind(&method); - if !matches!(kind, Some(Kind::Write | Kind::Owner)) || method == "project.init" { + if r.kind(&method) != Some(Kind::Write) || method == "project.init" { return Err(Fail::host(format!("{method} is not a write method of an app folder"))); } - let kind = kind.unwrap_or(Kind::Write); let d = r.descriptor(&method).cloned().ok_or_else(|| Fail::host("unknown method"))?; let args = match args.unwrap_or(json!({})) { Value::Object(o) => Value::Object(o), @@ -303,11 +283,14 @@ pub async fn write_with_confirm(window: WebviewWindow, app: AppHandle, state: St if dry["ok"] != Value::Bool(true) { return Ok(json!({ "confirmed": false, "stage": "dry-run", "dryRun": dry })); } - let summary = if kind == Kind::Owner { owner_summary(&d.title, &d.description, &proj.name) } else { dialog_summary(&d.title, &d.description, &proj.name, d.network, d.destructive) }; - let text = format!("{summary}\n\nDry run ({}):\n{}", dry["command"].as_str().unwrap_or_default(), dialog_excerpt(dry["output"].as_str().unwrap_or_default())); + let text = format!( + "{}\n\nDry run ({}):\n{}", + dialog_summary(&d.title, &d.description, &proj.name, d.network, d.destructive), + dry["command"].as_str().unwrap_or_default(), + dialog_excerpt(dry["output"].as_str().unwrap_or_default()) + ); let home = app.path().home_dir().ok().map(|h| h.to_string_lossy().to_string()); - let (title, ok) = dialog_labels(kind, &d.title); - if !confirm_dialog_with(&window, title, tilde(&text, home.as_deref()), ok).await? { + if !confirm_dialog(&window, format!("Apply: {}", d.title), tilde(&text, home.as_deref())).await? { return Ok(json!({ "confirmed": false, "stage": "dialog", "dryRun": dry })); } let bound = json!({ "project": proj.path, "args": args }); diff --git a/apps/desktop/src-tauri/src/policy.rs b/apps/desktop/src-tauri/src/policy.rs index a603df8..d1a0e37 100644 --- a/apps/desktop/src-tauri/src/policy.rs +++ b/apps/desktop/src-tauri/src/policy.rs @@ -53,9 +53,6 @@ pub enum Kind { Session, /// Account-scoped store reads (apps.list, account.check): the host runs them with one account's key. Account, - /// Owner actions (rollout share, phased release, sending one approved reply): like writes, a dry run from the - /// window; the real run only through `write_with_confirm`, whose dialog says that users see it at once. - Owner, } impl Kind { @@ -67,7 +64,6 @@ impl Kind { "portfolio" => Kind::Portfolio, "session" => Kind::Session, "account" => Kind::Account, - "owner" => Kind::Owner, _ => return None, }) } @@ -100,7 +96,7 @@ pub fn sanitize_js_call(method: &str, kind: Option, params: &Value) -> Res } } let mut out = obj.clone(); - if matches!(kind, Kind::Write | Kind::Owner) { + if kind == Kind::Write { out.insert("dryRun".into(), Value::Bool(true)); } Ok(Value::Object(out)) diff --git a/apps/desktop/src-tauri/tests/d3_writes.rs b/apps/desktop/src-tauri/tests/d3_writes.rs deleted file mode 100644 index b522221..0000000 --- a/apps/desktop/src-tauri/tests/d3_writes.rs +++ /dev/null @@ -1,60 +0,0 @@ -//! Desktop D3 writes: owner actions are dry runs from the window like every write; only `write_with_confirm` runs them, -//! after a dialog that names the action on its button and says users see it at once. Tokens are bound to exactly the -//! method and the { project, args } sent (the same vector as the TypeScript side checks). -use serde_json::json; -use storebound_desktop::commands::{dialog_labels, dialog_summary, owner_summary}; -use storebound_desktop::confirm::{canonical, mac, mint}; -use storebound_desktop::policy::{sanitize_js_call, Kind}; - -#[test] -fn owner_actions_are_dry_runs_from_the_window() { - let p = sanitize_js_call("owner.play_rollout", Some(Kind::Owner), &json!({ "args": { "action": "complete" } })).unwrap(); - assert_eq!(p["dryRun"], json!(true)); - for bad in [json!({ "dryRun": false }), json!({ "confirmToken": "sbt1.x" }), json!({ "credentials": {} }), json!({ "project": "/x" })] { - assert!(sanitize_js_call("owner.reply_send", Some(Kind::Owner), &bad).is_err(), "{bad}"); - } - assert_eq!(Kind::parse("owner"), Some(Kind::Owner)); - let w = sanitize_js_call("reviews.reply", Some(Kind::Write), &json!({ "args": { "file": "play-1.md", "text": "Thanks" } })).unwrap(); - assert_eq!(w["dryRun"], json!(true)); -} - -#[test] -fn owner_dialogs_name_the_action() { - let (title, ok) = dialog_labels(Kind::Owner, "Change the Play staged rollout"); - assert_eq!(title, "Owner action: Change the Play staged rollout"); - assert_eq!(ok, "Yes: Change the Play staged rollout"); - assert_eq!(dialog_labels(Kind::Write, "Push Play listing text"), ("Apply: Push Play listing text".to_string(), "Apply".to_string())); - let s = owner_summary("Send one approved reply", "Sends one approved, unsent reply draft.", "Prism Puddle"); - assert!(s.contains("Prism Puddle") && s.contains("right away") && s.contains("your decision")); - assert!(dialog_summary("Push", "d", "A", true, false).contains("not public until you submit")); -} - -#[test] -fn tokens_bind_method_project_and_args_of_each_write() { - let secret = [9u8; 32]; - let writes = [ - ("play.listing", json!({})), - ("apple.listing", json!({ "version": "2.4.0" })), - ("apple.screenshots", json!({})), - ("apple.testflight_distribute", json!({ "build": "52", "groups": "Studio team" })), - ("reviews.reply", json!({ "file": "play-r-p1.md", "text": "Thanks!" })), - ("owner.play_rollout", json!({ "action": "percent", "percent": 50 })), - ("owner.ios_phased", json!({ "action": "resume", "version": "2.3.0" })), - ("owner.reply_send", json!({ "file": "play-r-p1.md" })), - ]; - for (method, args) in writes { - let bound = json!({ "project": "/apps/prism", "args": args }); - let t = mint(&secret, method, &bound, 1_000, "AAAAAAAAAAAAAAAAAAAAAA").unwrap(); - let sig = t.rsplit('.').next().unwrap().to_string(); - assert_eq!(sig, mac(&secret, method, &bound, 61_000, "AAAAAAAAAAAAAAAAAAAAAA").unwrap()); - // any change of method, project or args changes the signature - assert_ne!(sig, mac(&secret, "play.images", &bound, 61_000, "AAAAAAAAAAAAAAAAAAAAAA").unwrap(), "{method}"); - assert_ne!(sig, mac(&secret, method, &json!({ "project": "/apps/other", "args": bound["args"] }), 61_000, "AAAAAAAAAAAAAAAAAAAAAA").unwrap()); - let mut more = bound.clone(); - more["args"]["x"] = json!(1); - assert_ne!(sig, mac(&secret, method, &more, 61_000, "AAAAAAAAAAAAAAAAAAAAAA").unwrap()); - } - // a rollout share is a safe integer (percent), so it can be bound; fractions as numbers cannot - assert!(canonical(&json!({ "percent": 50 })).is_ok()); - assert!(canonical(&json!({ "fraction": 0.5 })).is_err()); -} diff --git a/apps/desktop/src/dev/fixtures.ts b/apps/desktop/src/dev/fixtures.ts index 8dfde39..1af6778 100644 --- a/apps/desktop/src/dev/fixtures.ts +++ b/apps/desktop/src/dev/fixtures.ts @@ -103,8 +103,8 @@ if (import.meta.env.VITE_FIXTURES === 'empty') overrides = { pairs: [], unpairs: let settings: Settings = { ...DEFAULT_SETTINGS, refresh: { ...DEFAULT_SETTINGS.refresh, autoMinutes: 60 } }; const PLAY_INVITE = (who: string) => `Play Console > Users and permissions > Invite new users: add ${who}. Account permissions: "View app information and download bulk reports (read-only)"; per app, as needed: "Manage store presence", "Manage testing tracks", "Release to production, exclude devices and use Play App Signing" (rollouts), "Reply to reviews", "Manage orders and subscriptions". One service account can be invited to several developer accounts.`; const CHECKS: Record = { - [P1]: { store: 'android', status: 'ok', principal: 'play-bot@example.com', apps: 8, message: 'The service account can see 8 apps.', fix: null, docs: null }, - [P2]: { store: 'android', status: 'permission', principal: 'sample-labs-bot@example.com', apps: 0, message: 'The key works, but no developer account has invited this service account (it sees no apps).', fix: PLAY_INVITE('sample-labs-bot@example.com'), docs: 'https://play.google.com/console/developers/users-and-permissions' }, + [P1]: { store: 'android', status: 'ok', principal: 'storebound@example-games-123.iam.gserviceaccount.com', apps: 8, message: 'The service account can see 8 apps.', fix: null, docs: null }, + [P2]: { store: 'android', status: 'permission', principal: 'storebound@sample-labs-456.iam.gserviceaccount.com', apps: 0, message: 'The key works, but no developer account has invited this service account (it sees no apps).', fix: PLAY_INVITE('storebound@sample-labs-456.iam.gserviceaccount.com'), docs: 'https://play.google.com/console/developers/users-and-permissions' }, [A1]: { store: 'ios', status: 'ok', principal: null, apps: 5, message: 'The key works and can read the team\'s apps.', fix: null, docs: null }, [A2]: { store: 'ios', status: 'ok', principal: null, apps: 3, message: 'The key works and can read the team\'s apps.', fix: null, docs: null }, [A3]: { store: 'ios', status: 'ok', principal: null, apps: 2, message: 'The key works and can read the team\'s apps.', fix: null, docs: null }, @@ -496,13 +496,12 @@ async function answer(cmd: string, a: Record): Promise } case 'job_cancel': cancelled.add(a.job as string); return true; case 'write_with_confirm': { + await sleep(500); const method = a.method as string, args = (a.args ?? {}) as Record; - await progressLines(job, [`[${method}] dry run`, `[${method}] confirmed in the dialog`, `[${method}] applying`]); - if (job && cancelled.has(job)) throw { code: -32800, message: 'Request cancelled' }; - const d = DRAFTS[a.projectId as string]?.drafts.find(x => x.file.endsWith(`/${String(args.file)}`)); - if (method === 'reviews.approve' && d) d.approved = !args.undo; - if (method === 'reviews.reply' && d) { d.reply = String(args.text); d.approved = false; d.issues = []; } - if (method === 'owner.reply_send' && d) d.sent = iso(0); + if (method === 'reviews.approve') { + const d = DRAFTS[a.projectId as string]?.drafts.find(x => x.file.endsWith(`/${String(args.file)}`)); + if (d) d.approved = !args.undo; + } const res: ToolResult = { method, ok: true, exitCode: 0, dryRun: false, command: `storebound ${method.replace('.', ' ')}`, output: `[${method}] done (fixture)` }; return { confirmed: true, stage: 'done', dryRun: { ...res, dryRun: true }, result: res }; } diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts index f0fc17a..4da4161 100644 --- a/apps/desktop/src/i18n/en.ts +++ b/apps/desktop/src/i18n/en.ts @@ -227,7 +227,7 @@ export const en = { 'releases.noVersionsText': 'When the first build is uploaded it shows here.', 'releases.history': 'Versions on the stores', 'releases.historySub': 'Read {when}', - 'releases.consoleNote': 'storebound never submits for review and never releases an approved version: do those in the store console. Rollout and phased release changes are your decision, each confirmed in a system dialog.', + 'releases.consoleNote': 'storebound never submits for review, releases or completes a rollout. Do those in the store console.', 'cat.products': 'One-time products', 'cat.productsSub': 'In the config', @@ -774,96 +774,4 @@ export const en = { 'portfolio.groupCount_one': '1 app', 'portfolio.groupAccounts': '{count} accounts', 'portfolio.groupAccounts_one': '1 account', - - 'write.dryRunning': 'Dry run first: nothing changes yet', - 'write.notApplied': 'Not applied', - 'write.notAppliedDetail': 'You chose Cancel in the dialog: nothing changed.', - 'act.storeTitle': 'Push to the stores', - 'act.storeSub': 'Listing text, screenshots and previews from this folder, and the local renders', - 'act.playListing': 'Listing text', - 'act.playListingDone': 'Play listing updated', - 'act.playImages': 'Graphics and screenshots', - 'act.version': 'Version', - 'act.appleListing': 'Version {version} and its text', - 'act.appleListingDone': 'App Store version and text updated', - 'act.appleShots': 'Screenshots', - 'act.applePreviews': 'App previews', - 'act.uploaded': 'Uploaded', - 'act.slowHint': 'Can take minutes: progress shows in the toast, Cancel stops it', - 'act.render': 'Render (local)', - 'act.renderLang': 'Language to render', - 'act.allLangs': 'All languages', - 'act.renderShots': 'Render screenshots', - 'act.renderVideo': 'Cut app previews', - 'act.icons': 'Generate icons', - 'act.gallery': 'Review gallery', - 'act.galleryDone': 'Gallery written next to the renders', - 'act.rendered': 'Done', - 'act.localHint': 'Local files only; needs ffmpeg and Chrome (Dependencies)', - 'act.note': 'Each action runs a dry run and shows it in a system dialog before anything changes. Nothing here submits for review or publishes: that stays in the consoles.', - 'act.catalogTitle': 'Sync the catalog', - 'act.catalogSub': 'Create and update products and subscriptions with their regional prices from the config', - 'act.playProducts': 'One-time products', - 'act.playSubs': 'Subscriptions', - 'act.appleIap': 'In-app purchases', - 'act.appleSubs': 'Subscriptions', - 'act.synced': 'Catalog updated', - 'act.prices': 'Prices', - 'act.pricesExport': 'Export prices (CSV)', - 'act.pricesExported': 'Prices exported into the folder', - 'act.pricesImport': 'Changing live prices from a sheet stays a terminal step:', - 'act.catalogNote': 'Never submits: new items wait in the consoles until you send them with a version.', - 'roll.playNow': 'Rollout {pct} %', - 'roll.share': 'New user share', - 'roll.toShare': 'Raise to {pct} %', - 'roll.halt': 'Halt', - 'roll.haltHint': 'Stops new installs of the update; not a rollback', - 'roll.halted': 'Rollout halted', - 'roll.resume': 'Resume', - 'roll.complete': 'Everyone (100 %)', - 'roll.completeHint': 'Completes the staged rollout: every user gets the update', - 'roll.done': 'Rollout updated', - 'roll.iosNow': 'Phased release, day {day} of 7', - 'roll.pause': 'Pause', - 'roll.pauseHint': 'Holds the automatic updates (up to 30 days); not a rollback', - 'roll.paused': 'Phased release paused', - 'roll.everyone': 'Release to everyone', - 'roll.everyoneHint': 'Ends the phased release: every user with automatic updates gets it now', - 'roll.phasedOn': 'Turn on phased release', - 'roll.phasedOnHint': 'When this version goes live, it reaches users with automatic updates over 7 days', - 'roll.phasedOnDone': 'Phased release is on', - 'tf.what': 'What to Test', - 'tf.groupsBtn': 'Internal groups', - 'tf.whatToTest': 'What to Test for build {build}', - 'tf.whatPlaceholder': 'What changed and what to look at (every App Store locale gets this text)', - 'tf.whatSave': 'Set this text', - 'tf.whatFromFile': 'From the listing file', - 'tf.whatFromFileHint': 'Each locale\'s whatToTest (or What\'s New) from the App Store listing file', - 'tf.whatSaved': 'What to Test updated', - 'tf.toInternal': 'Give build {build} to internal groups', - 'tf.noInternal': 'No internal group: create one in App Store Connect or with apple.testflight.groups.', - 'tf.distribute': 'Give to these groups', - 'tf.distributed': 'Build added to the groups', - 'tf.externalNote': 'External groups and Beta App Review stay in App Store Connect.', - 'tf.testersTitle': 'Testers', - 'tf.testersSub': 'From the testers CSV in this folder (.storebound/testers.csv, never committed)', - 'tf.testersGroup': 'Group', - 'tf.testersAll': 'Every group in the CSV', - 'tf.testersAdd': 'Add new testers', - 'tf.testersHint': 'Apple emails each new tester an invitation once the group has a build', - 'tf.testersDone': 'Testers added', - 'tf.testersNote': 'Emails stay masked in every line and dialog. Removing testers stays a terminal step.', - 'reviews.replyEditor': 'Reply', - 'reviews.replyPlaceholder': 'Plain text, in the reviewer\'s language. No incentives, no personal data.', - 'reviews.unsaved': 'Not saved', - 'reviews.save': 'Save draft', - 'reviews.saved': 'Draft saved (approve it again)', - 'reviews.send': 'Send reply', - 'reviews.sendHint': 'Public: the reviewer is notified. A system dialog shows the reply first.', - 'reviews.sent': 'Reply sent', - 'reviews.incentive': 'Offers something for a rating or asks for stars: not allowed', - 'reviews.tooLong': 'Longer than the store allows ({limit} characters)', - 'reviews.sendNoteD3': 'Replies are public. Save, approve, then Send: each step shows a system dialog first.', - - } as const; diff --git a/apps/desktop/src/i18n/tr.ts b/apps/desktop/src/i18n/tr.ts index 688a0d9..2837eee 100644 --- a/apps/desktop/src/i18n/tr.ts +++ b/apps/desktop/src/i18n/tr.ts @@ -229,7 +229,7 @@ export const tr: Record = { 'releases.noVersionsText': 'İlk derleme yüklendiğinde burada görünür.', 'releases.history': 'Mağazalardaki sürümler', 'releases.historySub': '{when} okundu', - 'releases.consoleNote': 'storebound hiçbir zaman incelemeye göndermez ve onaylanmış bir sürümü yayınlamaz: bunları mağaza konsolunda yapın. Dağıtım ve aşamalı yayın değişiklikleri sizin kararınızdır, her biri bir sistem penceresinde onaylanır.', + 'releases.consoleNote': 'storebound hiçbir zaman incelemeye göndermez, yayınlamaz veya dağıtımı tamamlamaz. Bunları mağaza konsolunda yapın.', 'cat.products': 'Tek seferlik ürünler', 'cat.productsSub': 'Ayar dosyasında', @@ -776,96 +776,4 @@ export const tr: Record = { 'portfolio.groupCount_one': '1 uygulama', 'portfolio.groupAccounts': '{count} hesap', 'portfolio.groupAccounts_one': '1 hesap', - - 'write.dryRunning': 'Önce deneme: henüz hiçbir şey değişmiyor', - 'write.notApplied': 'Uygulanmadı', - 'write.notAppliedDetail': 'Pencerede İptal\'i seçtiniz: hiçbir şey değişmedi.', - 'act.storeTitle': 'Mağazalara gönder', - 'act.storeSub': 'Bu klasördeki mağaza metni, ekran görüntüleri ve önizlemeler, ve yerel çıktılar', - 'act.playListing': 'Mağaza metni', - 'act.playListingDone': 'Play mağaza metni güncellendi', - 'act.playImages': 'Grafikler ve ekran görüntüleri', - 'act.version': 'Sürüm', - 'act.appleListing': '{version} sürümü ve metni', - 'act.appleListingDone': 'App Store sürümü ve metni güncellendi', - 'act.appleShots': 'Ekran görüntüleri', - 'act.applePreviews': 'Uygulama önizlemeleri', - 'act.uploaded': 'Yüklendi', - 'act.slowHint': 'Dakikalar sürebilir: ilerleme bildirimde görünür, İptal durdurur', - 'act.render': 'Üret (yerel)', - 'act.renderLang': 'Üretilecek dil', - 'act.allLangs': 'Tüm diller', - 'act.renderShots': 'Ekran görüntülerini üret', - 'act.renderVideo': 'Önizlemeleri kes', - 'act.icons': 'Simgeleri üret', - 'act.gallery': 'İnceleme galerisi', - 'act.galleryDone': 'Galeri çıktıların yanına yazıldı', - 'act.rendered': 'Bitti', - 'act.localHint': 'Yalnızca yerel dosyalar; ffmpeg ve Chrome gerekir (Bağımlılıklar)', - 'act.note': 'Her işlem önce bir deneme çalıştırır ve bir şey değişmeden önce sistem penceresinde gösterir. Buradaki hiçbir şey incelemeye göndermez ya da yayımlamaz: o konsollarda kalır.', - 'act.catalogTitle': 'Kataloğu eşitle', - 'act.catalogSub': 'Ürünleri ve abonelikleri bölgesel fiyatlarıyla yapılandırmadan oluştur ve güncelle', - 'act.playProducts': 'Tek seferlik ürünler', - 'act.playSubs': 'Abonelikler', - 'act.appleIap': 'Uygulama içi satın almalar', - 'act.appleSubs': 'Abonelikler', - 'act.synced': 'Katalog güncellendi', - 'act.prices': 'Fiyatlar', - 'act.pricesExport': 'Fiyatları dışa aktar (CSV)', - 'act.pricesExported': 'Fiyatlar klasöre aktarıldı', - 'act.pricesImport': 'Canlı fiyatları bir tablodan değiştirmek terminal adımı olarak kalır:', - 'act.catalogNote': 'Asla göndermez: yeni ürünler siz bir sürümle gönderene kadar konsollarda bekler.', - 'roll.playNow': 'Dağıtım %{pct}', - 'roll.share': 'Yeni kullanıcı payı', - 'roll.toShare': '%{pct} yap', - 'roll.halt': 'Durdur', - 'roll.haltHint': 'Güncellemenin yeni kurulumlarını durdurur; geri alma değildir', - 'roll.halted': 'Dağıtım durduruldu', - 'roll.resume': 'Sürdür', - 'roll.complete': 'Herkese (%100)', - 'roll.completeHint': 'Kademeli dağıtımı tamamlar: her kullanıcı güncellemeyi alır', - 'roll.done': 'Dağıtım güncellendi', - 'roll.iosNow': 'Aşamalı yayın, 7 günün {day}. günü', - 'roll.pause': 'Duraklat', - 'roll.pauseHint': 'Otomatik güncellemeleri bekletir (en çok 30 gün); geri alma değildir', - 'roll.paused': 'Aşamalı yayın duraklatıldı', - 'roll.everyone': 'Herkese yayınla', - 'roll.everyoneHint': 'Aşamalı yayını bitirir: otomatik güncellemesi açık her kullanıcı şimdi alır', - 'roll.phasedOn': 'Aşamalı yayını aç', - 'roll.phasedOnHint': 'Bu sürüm yayına girince otomatik güncellemesi açık kullanıcılara 7 günde ulaşır', - 'roll.phasedOnDone': 'Aşamalı yayın açık', - 'tf.what': 'Neyi test etmeli', - 'tf.groupsBtn': 'İç gruplar', - 'tf.whatToTest': '{build} derlemesi için Neyi test etmeli', - 'tf.whatPlaceholder': 'Ne değişti, nelere bakılmalı (her App Store dili bu metni alır)', - 'tf.whatSave': 'Bu metni ayarla', - 'tf.whatFromFile': 'Mağaza dosyasından', - 'tf.whatFromFileHint': 'App Store mağaza dosyasındaki her dilin whatToTest (ya da Yenilikler) metni', - 'tf.whatSaved': 'Neyi test etmeli güncellendi', - 'tf.toInternal': '{build} derlemesini iç gruplara ver', - 'tf.noInternal': 'İç grup yok: App Store Connect\'te ya da apple.testflight.groups ile oluşturun.', - 'tf.distribute': 'Bu gruplara ver', - 'tf.distributed': 'Derleme gruplara eklendi', - 'tf.externalNote': 'Dış gruplar ve Beta App Review App Store Connect\'te kalır.', - 'tf.testersTitle': 'Test kullanıcıları', - 'tf.testersSub': 'Bu klasördeki test kullanıcısı CSV\'sinden (.storebound/testers.csv, asla commit edilmez)', - 'tf.testersGroup': 'Grup', - 'tf.testersAll': 'CSV\'deki her grup', - 'tf.testersAdd': 'Yeni test kullanıcılarını ekle', - 'tf.testersHint': 'Grubun bir derlemesi olunca Apple her yeni kullanıcıya davet e-postası gönderir', - 'tf.testersDone': 'Test kullanıcıları eklendi', - 'tf.testersNote': 'E-postalar her satırda ve pencerede maskeli kalır. Kullanıcı çıkarmak terminal adımı olarak kalır.', - 'reviews.replyEditor': 'Yanıt', - 'reviews.replyPlaceholder': 'Düz metin, yorumcunun dilinde. Teşvik yok, kişisel veri yok.', - 'reviews.unsaved': 'Kaydedilmedi', - 'reviews.save': 'Taslağı kaydet', - 'reviews.saved': 'Taslak kaydedildi (yeniden onaylayın)', - 'reviews.send': 'Yanıtı gönder', - 'reviews.sendHint': 'Herkese açık: yorumcu bilgilendirilir. Önce bir sistem penceresi yanıtı gösterir.', - 'reviews.sent': 'Yanıt gönderildi', - 'reviews.incentive': 'Puan karşılığı bir şey öneriyor ya da yıldız istiyor: izin verilmez', - 'reviews.tooLong': 'Mağazanın izin verdiğinden uzun ({limit} karakter)', - 'reviews.sendNoteD3': 'Yanıtlar herkese açıktır. Kaydet, onayla, sonra Gönder: her adım önce bir sistem penceresi gösterir.', - - }; diff --git a/apps/desktop/src/screens/Portfolio.tsx b/apps/desktop/src/screens/Portfolio.tsx index 94c2a44..0995f14 100644 --- a/apps/desktop/src/screens/Portfolio.tsx +++ b/apps/desktop/src/screens/Portfolio.tsx @@ -247,7 +247,7 @@ export function Portfolio() { actions={
{t('legend.done')}{t('legend.stages')}
}> {rows.length ? (
- +
diff --git a/apps/desktop/src/screens/tabs/Catalog.tsx b/apps/desktop/src/screens/tabs/Catalog.tsx index a9fb1ca..06cd007 100644 --- a/apps/desktop/src/screens/tabs/Catalog.tsx +++ b/apps/desktop/src/screens/tabs/Catalog.tsx @@ -4,9 +4,8 @@ import type { Project } from '../../api'; import { type Key, t } from '../../i18n'; import { ago, num } from '../../lib/format'; import { type CatalogDiff, type CellState, parityMatrix } from '../../lib/model'; -import { useData, useRead, useWrite } from '../../store'; -import { Icon, type IconName, StoreGlyph } from '../../ui/icons'; -import { WriteButton } from '../../ui/WriteButton'; +import { useData, useRead } from '../../store'; +import { Icon, type IconName } from '../../ui/icons'; import { Card, Chip, Empty, Kpi, Notice, Skeleton } from '../../ui/kit'; const CELL: Record = { ok: ['check', 'cat.ok'], warn: ['alert', 'cat.warn'], error: ['x', 'cat.error'], na: ['dot', 'cat.na'], unknown: ['info', 'cat.unknown'] }; @@ -21,40 +20,6 @@ function Cell({ c }: { c: { state: CellState; notes: string[] } }) { ); } -/** Create / update the catalog on both stores from the config (prices included), and export the price sheet. */ -function CatalogActions({ project, products, subs, refresh }: { project: Project; products: number; subs: number; refresh: () => void }) { - const d = useData(); - const w = useWrite(project.id); - const e = d.statusOf(project); - const ios = !!e?.app?.platforms.ios, android = !!e?.app?.platforms.android; - return ( - -
- {android && ( -
-
Google Play
- {t('act.playProducts')} - {t('act.playSubs')} -
- )} - {ios && ( -
-
App Store
- {t('act.appleIap')} - {t('act.appleSubs')} -
- )} -
-
{t('act.prices')}
- {t('act.pricesExport')} - {t('act.pricesImport')} storebound prices import -
-
-

{t('act.catalogNote')}

-
- ); -} - export function CatalogTab({ project }: { project: Project }) { const d = useData(); const e = d.statusOf(project); @@ -78,7 +43,6 @@ export function CatalogTab({ project }: { project: Project }) { {diff.error && {t('common.readFailedKeep', { error: diff.error })}} - { diff.refresh(); }} /> {read ? t('action.refresh') : t('cat.compare')}}>
diff --git a/apps/desktop/src/screens/tabs/Listings.tsx b/apps/desktop/src/screens/tabs/Listings.tsx index c5fde1c..ff43a3b 100644 --- a/apps/desktop/src/screens/tabs/Listings.tsx +++ b/apps/desktop/src/screens/tabs/Listings.tsx @@ -1,12 +1,10 @@ // Listings: per language and store, which listing fields are written and within the store limits (from the listing // files in the app folder), and how many screenshots are rendered per language. -import { useState } from 'react'; import type { ListingField, ListingLocale, ListingsResult, Project } from '../../api'; import { type Key, t } from '../../i18n'; import { ago, num } from '../../lib/format'; -import { useData, useRead, useWrite } from '../../store'; -import { Icon, StoreGlyph } from '../../ui/icons'; -import { WriteButton } from '../../ui/WriteButton'; +import { useRead } from '../../store'; +import { Icon } from '../../ui/icons'; import { Card, Chip, Empty, Kpi, Notice, Skeleton } from '../../ui/kit'; const FIELD_KEY: Record = { @@ -58,57 +56,6 @@ function StoreGrid({ store, locales }: { store: 'play' | 'apple'; locales: Listi ); } -/** Push the listing text, upload the art, and render it (each a dry run, a native dialog, then the real run). */ -function StoreActions({ project, langs }: { project: Project; langs: string[] }) { - const d = useData(); - const w = useWrite(project.id); - const l = d.liveOf(project); - const e = d.statusOf(project); - const suggested = l?.release.next?.ios?.version ?? l?.release.next?.version ?? ''; - const [version, setVersion] = useState(suggested); - const [lang, setLang] = useState(''); - const ios = !!e?.app?.platforms.ios, android = !!e?.app?.platforms.android; - const okVersion = /^\d+(\.\d+){0,2}$/.test(version); - const only = lang ? { lang } : {}; - return ( - -
- {android && ( -
-
Google Play
- {t('act.playListing')} - {t('act.playImages')} -
- )} - {ios && ( -
-
App Store
-
- - setVersion(ev.target.value.trim())} placeholder="2.4.0" /> -
- {t('act.appleListing', { version: version || '…' })} - {t('act.appleShots')} - {t('act.applePreviews')} -
- )} -
-
{t('act.render')}
- - {t('act.renderShots')} - {t('act.renderVideo')} - {t('act.icons')} - {t('act.gallery')} -
-
-

{t('act.note')}

-
- ); -} - export function ListingsTab({ project }: { project: Project }) { const r = useRead(project.id, 'project.listings', { network: false }); if (!r.data) { @@ -129,7 +76,6 @@ export function ListingsTab({ project }: { project: Project }) { l.screenshots !== null) ? shots : '–'} sub={L.locales.some(l => l.screenshots !== null) ? t('lst.screenshotsSub') : t('lst.noRenders')} />
{L.problems.map((p, i) => {p})} - {!noFiles && l.lang)} />} {noFiles ? ( {t('lst.noFilesText')} diff --git a/apps/desktop/src/screens/tabs/Releases.tsx b/apps/desktop/src/screens/tabs/Releases.tsx index c238c1e..8a75b19 100644 --- a/apps/desktop/src/screens/tabs/Releases.tsx +++ b/apps/desktop/src/screens/tabs/Releases.tsx @@ -1,13 +1,11 @@ // Releases: the release timeline (one version on both stores on one track: build -> testing -> review -> live -> // rollout %), then every version read from the stores. Submit and release stay in the consoles. -import { useState } from 'react'; -import { api, type ReleaseTrain, type StoreRelease } from '../../api'; +import { api, type ReleaseTrain } from '../../api'; import type { UnifiedApp } from '../../lib/identity'; -import { WriteButton } from '../../ui/WriteButton'; import { type Key, t } from '../../i18n'; import { ago, date, share } from '../../lib/format'; import { type Lane, STAGES, type TestFlightStatus, trainLanes, versionHistory } from '../../lib/model'; -import { useData, useRead, useWrite } from '../../store'; +import { useData, useRead } from '../../store'; import { Icon, StoreGlyph } from '../../ui/icons'; import { Bar, Card, Chip, Empty, Notice, PhaseChip, storeName } from '../../ui/kit'; import { ascUrl, PLAY_CONSOLE } from '../AppView'; @@ -50,54 +48,7 @@ function LaneRow({ lane, version }: { lane: Lane; version: string }) { ); } -const SHARES = [1, 2, 5, 10, 20, 50]; - -/** Rollout controls of one store release: Play staged rollout share / halt / resume / complete, iOS phased release - * pause / resume / everyone, or turning the phased release on for an upcoming iOS version. Owner actions: each one is - * a dry run first, then a system dialog that names it. */ -function RolloutControls({ app, r }: { app: UnifiedApp; r: StoreRelease }) { - const w = useWrite(app.project?.id ?? null); - const pct = r.fraction !== null ? Math.round(r.fraction * 100) : null; - const [share, setShare] = useState(() => String(SHARES.find(s => pct === null || s > pct) ?? 50)); - if (!app.project) return null; - const v = r.version ?? ''; - if (r.store === 'android' && (r.phase === 'rollout' || r.phase === 'halted')) { - const track = r.track && ['production', 'beta', 'alpha', 'internal'].includes(r.track) ? r.track : 'production'; - const next = SHARES.filter(s => pct === null || s > pct); - return ( -
- {t('roll.playNow', { pct: pct ?? 0 })} - {r.phase === 'rollout' && next.length > 0 && <> - - {t('roll.toShare', { pct: share })} - } - {r.phase === 'rollout' && {t('roll.halt')}} - {r.phase === 'halted' && {t('roll.resume')}} - {t('roll.complete')} -
- ); - } - if (r.store === 'ios' && r.phased && (r.phased.state === 'ACTIVE' || r.phased.state === 'PAUSED')) { - return ( -
- {t('roll.iosNow', { day: r.phased.day ?? 0 })} - {r.phased.state === 'ACTIVE' && {t('roll.pause')}} - {r.phased.state === 'PAUSED' && {t('roll.resume')}} - {t('roll.everyone')} -
- ); - } - if (r.store === 'ios' && !r.phased && ['draft', 'review', 'approved'].includes(r.phase) && /^\d+(\.\d+){0,2}$/.test(v)) { - return ( -
- {t('roll.phasedOn')} -
- ); - } - return null; -} - -function Train({ title, train, tf, tone, app }: { title: string; train: ReleaseTrain; tf: TestFlightStatus | null; tone: 'accent' | 'ok'; app: UnifiedApp }) { +function Train({ title, train, tf, tone }: { title: string; train: ReleaseTrain; tf: TestFlightStatus | null; tone: 'accent' | 'ok' }) { const lanes = trainLanes(train, tf); return ( {train.version}{title}} @@ -106,11 +57,6 @@ function Train({ title, train, tf, tone, app }: { title: string; train: ReleaseT
{t('tl.store')}{STAGES.map(s => {t(STAGE_KEY[s])})}
{lanes.map(l => )} - {lanes.some(l => l.release) && app.project && ( -
- {lanes.map(l => l.release && )} -
- )}
); } @@ -137,8 +83,8 @@ export function ReleasesTab({ app }: { app: UnifiedApp }) { return ( <> {errs.map(([s, msg]) => {t('releases.storeUnreadable', { store: storeName(s as 'ios'), error: msg })})} - {l.release.next && } - {l.release.current && } + {l.release.next && } + {l.release.current && } {!l.release.next && !l.release.current && {t('releases.noVersionsText')}} diff --git a/apps/desktop/src/screens/tabs/Reviews.tsx b/apps/desktop/src/screens/tabs/Reviews.tsx index 0f04b37..d3c2ba1 100644 --- a/apps/desktop/src/screens/tabs/Reviews.tsx +++ b/apps/desktop/src/screens/tabs/Reviews.tsx @@ -1,31 +1,20 @@ // Reviews: the inbox of both stores with the star distribution and filters, and per review its local reply draft // (.storebound/replies) with the send checks. Approving a draft is a local, confirmed write; sending stays in the // terminal (`storebound reviews send`): replies are public. -import { useEffect, useMemo, useState } from 'react'; -import type { DraftsResult, ReplyDraft } from '../../api'; +import { useMemo, useState } from 'react'; +import { api, type DraftsResult, errorText, newJob, type ReplyDraft } from '../../api'; import type { UnifiedApp } from '../../lib/identity'; import { t } from '../../i18n'; import { ago, date, num } from '../../lib/format'; import { draftName, filterReviews, type Review, type ReviewFilter, starStats } from '../../lib/model'; -import { useRead, useWrite } from '../../store'; -import { WriteButton } from '../../ui/WriteButton'; +import { useData, useRead } from '../../store'; import { Icon, StoreGlyph } from '../../ui/icons'; import { Bar, Card, Chip, Empty, Notice, Seg, Skeleton, Stars } from '../../ui/kit'; const base = (f: string) => f.split(/[\\/]/).pop() ?? f; -/** Same checks as `reviews send` (cli/lib/reviews.ts checkReply), shown while typing; the CLI checks again. */ -const INCENTIVE = [/\b(free|bonus|extra|gift|reward)\b[^.!?\n]{0,40}\b(coins?|gems?|credits?|lives|items?)\b/i, /\b(change|update|raise|edit)\s+(your\s+)?(rating|review|stars?)\b/i, /\b(5|five)[ -]?stars?\b/i, /\b(rate|review)\s+us\b/i]; - -function Detail({ r, draft, w, onChanged }: { r: Review; draft: ReplyDraft | undefined; w: ReturnType; onChanged: () => void }) { +function Detail({ r, draft, onApprove, busy }: { r: Review; draft: ReplyDraft | undefined; onApprove: (d: ReplyDraft, undo: boolean) => void; busy: boolean }) { const errors = draft?.issues.filter(i => i.level === 'error') ?? []; - const [text, setText] = useState(draft?.reply ?? ''); - useEffect(() => { setText(draft?.reply ?? ''); }, [draft?.file, draft?.reply]); - const limit = r.store === 'play' ? 350 : 5970; - const len = [...text.trim()].length; - const dirty = !!draft && text.trim() !== draft.reply.trim(); - const live = text && INCENTIVE.some(x => x.test(text)) ? t('reviews.incentive') : len > limit ? t('reviews.tooLong', { limit }) : null; - const file = draft ? base(draft.file) : ''; return ( {r.title || t('reviews.noTitle')}} sub={{r.store === 'apple' ? 'App Store' : 'Google Play'}{r.where ? ` · ${r.where}` : ''} · {date(r.date)}{r.appVersion ? ` · ${t('reviews.version', { v: r.appVersion })}` : ''}}> @@ -43,34 +32,25 @@ function Detail({ r, draft, w, onChanged }: { r: Review; draft: ReplyDraft | und {t('reviews.draft')} {draft && (draft.sent ? {t('reviews.sentOn', { date: date(draft.sent) })} : draft.approved ? {t('reviews.approved')} : {t('reviews.notApproved')})} - {!draft ?

{t('reviews.noDraft')}

: draft.sent ? ( -
{draft.reply}
- ) : ( + {!draft ?

{t('reviews.noDraft')}

: ( <> -
{t('col.app')}App StoreGoogle Play{t('col.next')}{t('col.crash')}{t('col.catalog')}{t('col.config')}