Merge desktop-complete: prices, app info, growth, store art, exports, onboarding, UX audit
This commit is contained in:
commit
be38af2dad
54 changed files with 3282 additions and 95 deletions
|
|
@ -24,6 +24,8 @@ export const SCREENS: [string, string][] = [
|
||||||
['ignored', 'ignored'], ['store-app', 'app:releases:3'], ['store-app-reviews', 'app:reviews:3'], ['store-app-single', 'app:releases:7'],
|
['ignored', 'ignored'], ['store-app', 'app:releases:3'], ['store-app-reviews', 'app:reviews:3'], ['store-app-single', 'app:releases:7'],
|
||||||
['settings-pairing', 'settings:pairing'], ['settings-refresh', 'settings:refresh'], ['settings-privacy', 'settings:privacy'],
|
['settings-pairing', 'settings:pairing'], ['settings-refresh', 'settings:refresh'], ['settings-privacy', 'settings:privacy'],
|
||||||
['palette', 'palette'], ['welcome-1', 'welcome:1'], ['welcome-2', 'welcome:2'], ['welcome-3', 'welcome:3'], ['welcome-4', 'welcome:4'], ['welcome-5', 'welcome:5'],
|
['palette', 'palette'], ['welcome-1', 'welcome:1'], ['welcome-2', 'welcome:2'], ['welcome-3', 'welcome:3'], ['welcome-4', 'welcome:4'], ['welcome-5', 'welcome:5'],
|
||||||
|
['welcome-6', 'welcome:6'], ['prices', 'app:prices'], ['art', 'app:art'], ['growth', 'app:growth'], ['growth-2', 'app:growth:2'], ['appinfo', 'app:appinfo'],
|
||||||
|
['appinfo-2', 'app:appinfo:2'], ['store-app-growth', 'app:growth:3'],
|
||||||
];
|
];
|
||||||
|
|
||||||
async function settle(page: Page) {
|
async function settle(page: Page) {
|
||||||
|
|
@ -120,6 +122,30 @@ for (const theme of themes) {
|
||||||
await page.waitForTimeout(700);
|
await page.waitForTimeout(700);
|
||||||
await shot('import');
|
await shot('import');
|
||||||
}
|
}
|
||||||
|
if (!only.length || only.includes('prices-diff')) {
|
||||||
|
// a price sheet compared with the stores, with the owner's Apply
|
||||||
|
await page.goto(`${base}/?start=app:prices&theme=${theme}&lang=${lang}`);
|
||||||
|
await settle(page);
|
||||||
|
await page.getByRole('button', { name: /Compare store\/prices.csv|store\/prices.csv karşılaştır/ }).click();
|
||||||
|
await page.waitForTimeout(1500);
|
||||||
|
await shot('prices-diff');
|
||||||
|
}
|
||||||
|
if (!only.length || only.includes('export-menu')) {
|
||||||
|
// the top-right Export menu of a screen
|
||||||
|
await page.goto(`${base}/?start=app:reviews&theme=${theme}&lang=${lang}`);
|
||||||
|
await settle(page);
|
||||||
|
await page.getByRole('button', { name: /^Export$|^Dışa aktar$/ }).click();
|
||||||
|
await page.waitForTimeout(300);
|
||||||
|
await shot('export-menu');
|
||||||
|
}
|
||||||
|
if (!only.length || only.includes('art-lightbox')) {
|
||||||
|
// one render opened large
|
||||||
|
await page.goto(`${base}/?start=app:art&theme=${theme}&lang=${lang}`);
|
||||||
|
await settle(page);
|
||||||
|
await page.locator('.art-pic').first().click();
|
||||||
|
await page.waitForTimeout(500);
|
||||||
|
await shot('art-lightbox');
|
||||||
|
}
|
||||||
if (errors.length) console.error(`${theme}: page errors:\n ${[...new Set(errors)].join('\n ')}`);
|
if (errors.length) console.error(`${theme}: page errors:\n ${[...new Set(errors)].join('\n ')}`);
|
||||||
await ctx.close();
|
await ctx.close();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,10 @@
|
||||||
"allow-notify",
|
"allow-notify",
|
||||||
"allow-app-reset",
|
"allow-app-reset",
|
||||||
"allow-update-check",
|
"allow-update-check",
|
||||||
"allow-update-install"
|
"allow-update-install",
|
||||||
|
"allow-project-import-fastlane",
|
||||||
|
"allow-export-save",
|
||||||
|
"allow-price-sheet-pick",
|
||||||
|
"allow-project-reveal"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
# Automatically generated - DO NOT EDIT!
|
||||||
|
|
||||||
|
[[permission]]
|
||||||
|
identifier = "allow-export-save"
|
||||||
|
description = "Enables the export_save command without any pre-configured scope."
|
||||||
|
commands.allow = ["export_save"]
|
||||||
|
|
||||||
|
[[permission]]
|
||||||
|
identifier = "deny-export-save"
|
||||||
|
description = "Denies the export_save command without any pre-configured scope."
|
||||||
|
commands.deny = ["export_save"]
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
# Automatically generated - DO NOT EDIT!
|
||||||
|
|
||||||
|
[[permission]]
|
||||||
|
identifier = "allow-price-sheet-pick"
|
||||||
|
description = "Enables the price_sheet_pick command without any pre-configured scope."
|
||||||
|
commands.allow = ["price_sheet_pick"]
|
||||||
|
|
||||||
|
[[permission]]
|
||||||
|
identifier = "deny-price-sheet-pick"
|
||||||
|
description = "Denies the price_sheet_pick command without any pre-configured scope."
|
||||||
|
commands.deny = ["price_sheet_pick"]
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
# Automatically generated - DO NOT EDIT!
|
||||||
|
|
||||||
|
[[permission]]
|
||||||
|
identifier = "allow-project-import-fastlane"
|
||||||
|
description = "Enables the project_import_fastlane command without any pre-configured scope."
|
||||||
|
commands.allow = ["project_import_fastlane"]
|
||||||
|
|
||||||
|
[[permission]]
|
||||||
|
identifier = "deny-project-import-fastlane"
|
||||||
|
description = "Denies the project_import_fastlane command without any pre-configured scope."
|
||||||
|
commands.deny = ["project_import_fastlane"]
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
# Automatically generated - DO NOT EDIT!
|
||||||
|
|
||||||
|
[[permission]]
|
||||||
|
identifier = "allow-project-reveal"
|
||||||
|
description = "Enables the project_reveal command without any pre-configured scope."
|
||||||
|
commands.allow = ["project_reveal"]
|
||||||
|
|
||||||
|
[[permission]]
|
||||||
|
identifier = "deny-project-reveal"
|
||||||
|
description = "Denies the project_reveal command without any pre-configured scope."
|
||||||
|
commands.deny = ["project_reveal"]
|
||||||
|
|
@ -165,7 +165,7 @@ pub async fn sidecar_call(window: WebviewWindow, app: AppHandle, state: State<'_
|
||||||
if !creds.is_empty() && method != "project.inspect" {
|
if !creds.is_empty() && method != "project.inspect" {
|
||||||
o.insert("credentials".into(), Value::Object(creds));
|
o.insert("credentials".into(), Value::Object(creds));
|
||||||
}
|
}
|
||||||
if kind == Some(Kind::Read) {
|
if kind == Some(Kind::Read) && !policy::NO_CACHE_METHODS.contains(&method.as_str()) {
|
||||||
cache_project = Some(id);
|
cache_project = Some(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -286,7 +286,7 @@ pub async fn write_with_confirm(window: WebviewWindow, app: AppHandle, state: St
|
||||||
let job = job_of(job)?;
|
let job = job_of(job)?;
|
||||||
let r = state.sidecar.get(&app).await?;
|
let r = state.sidecar.get(&app).await?;
|
||||||
let kind = r.kind(&method);
|
let kind = r.kind(&method);
|
||||||
if !matches!(kind, Some(Kind::Write | Kind::Owner)) || method == "project.init" {
|
if !matches!(kind, Some(Kind::Write | Kind::Owner)) || policy::NEW_FOLDER_METHODS.contains(&method.as_str()) {
|
||||||
return Err(Fail::host(format!("{method} is not a write method of an app folder")));
|
return Err(Fail::host(format!("{method} is not a write method of an app folder")));
|
||||||
}
|
}
|
||||||
let kind = kind.unwrap_or(Kind::Write);
|
let kind = kind.unwrap_or(Kind::Write);
|
||||||
|
|
@ -413,6 +413,128 @@ pub async fn project_init(window: WebviewWindow, app: AppHandle, state: State<'_
|
||||||
add_folder(&app, &state, &dir).await.map(Some)
|
add_folder(&app, &state, &dir).await.map(Some)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// `storebound import fastlane` for a folder with a fastlane setup and no storebound config yet: native folder picker,
|
||||||
|
/// the dry run (the import plan and the report of what it does not map) in a native dialog, then the files are written
|
||||||
|
/// (fastlane stays untouched, nothing is overwritten) and the folder is added. None = cancelled at any step.
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn project_import_fastlane(window: WebviewWindow, app: AppHandle, state: State<'_, AppState>, profile: Option<String>) -> Res<Option<Project>> {
|
||||||
|
guard(&window)?;
|
||||||
|
if let Some(p) = &profile {
|
||||||
|
if !PROFILES.contains(&p.as_str()) {
|
||||||
|
return Err(Fail::host("profile: app, game or subscription-app"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let Some(dir) = pick_folder(&window, "Choose the app folder that has the fastlane folder").await? else { return Ok(None) };
|
||||||
|
if has_config(&dir) {
|
||||||
|
return Err(Fail::host("this folder already has a storebound config: add it instead"));
|
||||||
|
}
|
||||||
|
let path = dir.to_string_lossy().to_string();
|
||||||
|
let args = match &profile {
|
||||||
|
Some(p) => json!({ "profile": p }),
|
||||||
|
None => json!({}),
|
||||||
|
};
|
||||||
|
let r = state.sidecar.get(&app).await?;
|
||||||
|
let home = app.path().home_dir().ok().map(|h| h.to_string_lossy().to_string());
|
||||||
|
let dry = r.call("import.fastlane", json!({ "project": path, "args": args, "dryRun": true })).await?;
|
||||||
|
if dry["ok"] != Value::Bool(true) {
|
||||||
|
return Err(Fail::host(tilde(&format!("fastlane import: {}", dialog_excerpt(dry["output"].as_str().unwrap_or_default())), home.as_deref())));
|
||||||
|
}
|
||||||
|
let text = format!(
|
||||||
|
"Import from fastlane\n\n{path}\n\nReads the fastlane folder (Appfile, deliver and supply metadata, screenshots) and writes storebound.config.ts, the listing files and screenshot frames next to it. fastlane stays untouched and no existing file is overwritten. Keys, team ids and the App Review contact are only named, never copied.\n\nDry run:\n{}",
|
||||||
|
dialog_excerpt(dry["output"].as_str().unwrap_or_default())
|
||||||
|
);
|
||||||
|
if !confirm_dialog(&window, "Apply: Import from fastlane".into(), tilde(&text, home.as_deref())).await? {
|
||||||
|
return Ok(None);
|
||||||
|
}
|
||||||
|
let token = r.mint("import.fastlane", &json!({ "project": path, "args": args })).map_err(Fail::host)?;
|
||||||
|
let res = r.call("import.fastlane", json!({ "project": path, "args": args, "dryRun": false, "confirmToken": token })).await?;
|
||||||
|
if res["ok"] != Value::Bool(true) {
|
||||||
|
return Err(Fail::host(tilde(&format!("fastlane import failed: {}", dialog_excerpt(res["output"].as_str().unwrap_or_default())), home.as_deref())));
|
||||||
|
}
|
||||||
|
if !has_config(&dir) {
|
||||||
|
return Err(Fail::host("the import wrote no storebound config"));
|
||||||
|
}
|
||||||
|
add_folder(&app, &state, &dir).await.map(Some)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Saves an export the window made (prices CSV, listings, reviews, reports) where the owner picks in a native save
|
||||||
|
/// dialog (default: Downloads). Only text, only the known kinds, at most EXPORT_MAX_BYTES. None = cancelled; else the
|
||||||
|
/// path written, with the home folder as "~".
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn export_save(window: WebviewWindow, app: AppHandle, name: String, kind: String, content: String, personal: Option<bool>) -> Res<Option<String>> {
|
||||||
|
guard(&window)?;
|
||||||
|
let file = policy::export_file_name(&name, &kind).ok_or_else(|| Fail::host("export: unknown kind or empty name"))?;
|
||||||
|
if content.len() > policy::EXPORT_MAX_BYTES {
|
||||||
|
return Err(Fail::host("export: too big"));
|
||||||
|
}
|
||||||
|
// reviewer names and review texts: say where they may go before the file exists
|
||||||
|
if personal == Some(true) && !confirm_dialog_with(&window, "Personal data".into(), policy::PERSONAL_EXPORT_NOTE.into(), "Save on this computer".into()).await? {
|
||||||
|
return Ok(None);
|
||||||
|
}
|
||||||
|
let w = window.clone();
|
||||||
|
let dir = app.path().download_dir().ok();
|
||||||
|
let ext = kind.clone();
|
||||||
|
let picked = tauri::async_runtime::spawn_blocking(move || {
|
||||||
|
let mut d = w.app_handle().dialog().file().set_title("Export").set_file_name(&file).add_filter(ext.to_uppercase(), &[ext.as_str()]).set_parent(&w);
|
||||||
|
if let Some(dir) = dir {
|
||||||
|
d = d.set_directory(dir);
|
||||||
|
}
|
||||||
|
d.blocking_save_file()
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
.map_err(|e| Fail::host(e.to_string()))?;
|
||||||
|
let Some(picked) = picked else { return Ok(None) };
|
||||||
|
let path = picked.into_path().map_err(|e| Fail::host(e.to_string()))?;
|
||||||
|
std::fs::write(&path, content.as_bytes()).map_err(|e| Fail::host(format!("export: {e}")))?;
|
||||||
|
let home = app.path().home_dir().ok().map(|h| h.to_string_lossy().to_string());
|
||||||
|
Ok(Some(tilde(&path.to_string_lossy(), home.as_deref())))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A price sheet (CSV) to compare with the stores, picked in a native dialog. None = cancelled. The path goes back
|
||||||
|
/// to the window only as the `csv` argument of prices.diff / owner.prices_import (both read it, neither writes it).
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn price_sheet_pick(window: WebviewWindow, state: State<'_, AppState>, project_id: String) -> Res<Option<String>> {
|
||||||
|
guard(&window)?;
|
||||||
|
let start = saved(&state)?.projects.iter().find(|p| p.id == project_id).map(|p| PathBuf::from(&p.path)).ok_or_else(|| Fail::host("unknown project"))?;
|
||||||
|
let w = window.clone();
|
||||||
|
let picked = tauri::async_runtime::spawn_blocking(move || w.app_handle().dialog().file().set_title("Choose a price sheet (CSV)").add_filter("CSV", &["csv"]).set_directory(start).set_parent(&w).blocking_pick_file())
|
||||||
|
.await
|
||||||
|
.map_err(|e| Fail::host(e.to_string()))?;
|
||||||
|
let Some(picked) = picked else { return Ok(None) };
|
||||||
|
let p = picked.into_path().map_err(|e| Fail::host(e.to_string()))?;
|
||||||
|
if !p.extension().is_some_and(|e| e.eq_ignore_ascii_case("csv")) {
|
||||||
|
return Err(Fail::host("a price sheet is a .csv file"));
|
||||||
|
}
|
||||||
|
Ok(Some(p.to_string_lossy().to_string()))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Shows a folder or file of an app folder in the file manager (`rel` empty: the app folder), or opens it with
|
||||||
|
/// `open` (a folder, or the gallery page storebound writes: <renders>/index.html in the default browser).
|
||||||
|
#[tauri::command]
|
||||||
|
pub fn project_reveal(window: WebviewWindow, app: AppHandle, state: State<'_, AppState>, project_id: String, rel: Option<String>, open: Option<bool>) -> Res<()> {
|
||||||
|
guard(&window)?;
|
||||||
|
let root = saved(&state)?.projects.iter().find(|p| p.id == project_id).map(|p| PathBuf::from(&p.path)).ok_or_else(|| Fail::host("unknown project"))?;
|
||||||
|
let rel = rel.unwrap_or_default();
|
||||||
|
let (target, relp) = if rel.is_empty() {
|
||||||
|
(root.clone(), PathBuf::new())
|
||||||
|
} else {
|
||||||
|
let r = policy::project_relative(&rel).ok_or_else(|| Fail::host("not a path inside the app folder"))?;
|
||||||
|
(root.join(&r), r)
|
||||||
|
};
|
||||||
|
let real = std::fs::canonicalize(&target).map_err(|_| Fail::host(format!("{rel}: not there yet")))?;
|
||||||
|
let real_root = std::fs::canonicalize(&root).map_err(|e| Fail::host(e.to_string()))?;
|
||||||
|
if !real.starts_with(&real_root) {
|
||||||
|
return Err(Fail::host("not a path inside the app folder"));
|
||||||
|
}
|
||||||
|
if open == Some(true) {
|
||||||
|
if !policy::openable(&relp, real.is_dir()) {
|
||||||
|
return Err(Fail::host("only folders and the gallery page open from here"));
|
||||||
|
}
|
||||||
|
return app.opener().open_path(real.to_string_lossy(), None::<&str>).map_err(|e| Fail::host(e.to_string()));
|
||||||
|
}
|
||||||
|
app.opener().reveal_item_in_dir(&real).map_err(|e| Fail::host(e.to_string()))
|
||||||
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub fn project_remove(window: WebviewWindow, state: State<'_, AppState>, id: String) -> Res<()> {
|
pub fn project_remove(window: WebviewWindow, state: State<'_, AppState>, id: String) -> Res<()> {
|
||||||
guard(&window)?;
|
guard(&window)?;
|
||||||
|
|
|
||||||
|
|
@ -38,4 +38,8 @@ pub const COMMANDS: &[&str] = &[
|
||||||
"app_reset",
|
"app_reset",
|
||||||
"update_check",
|
"update_check",
|
||||||
"update_install",
|
"update_install",
|
||||||
|
"project_import_fastlane",
|
||||||
|
"export_save",
|
||||||
|
"price_sheet_pick",
|
||||||
|
"project_reveal",
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -221,6 +221,10 @@ pub fn run() {
|
||||||
commands::app_reset,
|
commands::app_reset,
|
||||||
commands::update_check,
|
commands::update_check,
|
||||||
commands::update_install,
|
commands::update_install,
|
||||||
|
commands::project_import_fastlane,
|
||||||
|
commands::export_save,
|
||||||
|
commands::price_sheet_pick,
|
||||||
|
commands::project_reveal,
|
||||||
])
|
])
|
||||||
.build(tauri::generate_context!())
|
.build(tauri::generate_context!())
|
||||||
.expect("storebound desktop failed to start");
|
.expect("storebound desktop failed to start");
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,58 @@ pub fn sanitize_js_call(method: &str, kind: Option<Kind>, params: &Value) -> Res
|
||||||
Ok(Value::Object(out))
|
Ok(Value::Object(out))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Write methods whose project is a new folder without a config (the host picks it in a native dialog and runs them
|
||||||
|
/// in its own commands: `project_init`, `project_import_fastlane`); `write_with_confirm` never runs them.
|
||||||
|
pub const NEW_FOLDER_METHODS: &[&str] = &["project.init", "import.fastlane"];
|
||||||
|
|
||||||
|
/// Reads that are never kept in the offline cache (big: one rendered image as a data: URL).
|
||||||
|
pub const NO_CACHE_METHODS: &[&str] = &["project.render"];
|
||||||
|
|
||||||
|
/// File kinds the window may export through `export_save`, with their extension.
|
||||||
|
pub const EXPORT_KINDS: &[&str] = &["csv", "md", "json", "txt"];
|
||||||
|
/// Shown before an export with personal data (reviews: reviewer names, texts, territories) is saved.
|
||||||
|
pub const PERSONAL_EXPORT_NOTE: &str = "This file contains personal data: reviewer names, review texts and where they wrote from.\n\nKeep it on this computer (for example in the app's .storebound folder, which git ignores). Do not put it into issues, docs, chats or commits.";
|
||||||
|
/// Largest export the window may hand over (bytes of text).
|
||||||
|
pub const EXPORT_MAX_BYTES: usize = 16 * 1024 * 1024;
|
||||||
|
|
||||||
|
/// The suggested file name of an export: letters, digits, space, dot, dash, underscore and parentheses only, at most
|
||||||
|
/// 120 characters, never hidden, always ending in the kind's extension. None for an unknown kind or an empty name.
|
||||||
|
pub fn export_file_name(name: &str, kind: &str) -> Option<String> {
|
||||||
|
if !EXPORT_KINDS.contains(&kind) {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
let clean: String = name
|
||||||
|
.chars()
|
||||||
|
.map(|c| if c.is_alphanumeric() || matches!(c, ' ' | '.' | '-' | '_' | '(' | ')') { c } else { '-' })
|
||||||
|
.take(120)
|
||||||
|
.collect();
|
||||||
|
let clean = clean.trim().trim_start_matches('.').trim().to_string();
|
||||||
|
let ext = format!(".{kind}");
|
||||||
|
let stem = clean.strip_suffix(&ext).unwrap_or(&clean).trim_end_matches('.').to_string();
|
||||||
|
if stem.is_empty() {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
Some(format!("{stem}{ext}"))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A path inside an app folder named by the window (the renders folder, the gallery page): relative, plain
|
||||||
|
/// components only (no `..`, no root, no drive), at most 400 bytes. None otherwise.
|
||||||
|
pub fn project_relative(rel: &str) -> Option<std::path::PathBuf> {
|
||||||
|
if rel.is_empty() || rel.len() > 400 || rel.chars().any(char::is_control) || rel.contains('\\') {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
let p = std::path::Path::new(rel);
|
||||||
|
if p.is_absolute() || !p.components().all(|c| matches!(c, std::path::Component::Normal(_))) {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
Some(p.to_path_buf())
|
||||||
|
}
|
||||||
|
|
||||||
|
/// What `project_reveal` may open (not only show in the file manager): a folder, or the gallery page storebound writes.
|
||||||
|
pub fn openable(rel: &std::path::Path, is_dir: bool) -> bool {
|
||||||
|
is_dir || rel.file_name().and_then(|n| n.to_str()) == Some("index.html")
|
||||||
|
}
|
||||||
|
|
||||||
/// Hosts `open_external` may open in the browser: the two store consoles and storebound's own site.
|
/// Hosts `open_external` may open in the browser: the two store consoles and storebound's own site.
|
||||||
pub const EXTERNAL_HOSTS: &[&str] = &[
|
pub const EXTERNAL_HOSTS: &[&str] = &[
|
||||||
"play.google.com",
|
"play.google.com",
|
||||||
|
|
|
||||||
45
apps/desktop/src-tauri/tests/complete.rs
Normal file
45
apps/desktop/src-tauri/tests/complete.rs
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
//! Full CLI coverage, host side: exports only as named text files of known kinds, app-folder paths only inside the
|
||||||
|
//! folder, only folders and the gallery page open, new-folder methods and big reads stay out of the generic paths.
|
||||||
|
use std::path::Path;
|
||||||
|
use storebound_desktop::COMMANDS;
|
||||||
|
use storebound_desktop::policy::{export_file_name, openable, project_relative, NEW_FOLDER_METHODS, NO_CACHE_METHODS, PERSONAL_EXPORT_NOTE};
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn export_names() {
|
||||||
|
assert_eq!(export_file_name("Prism Puddle prices 2026-10-11", "csv").as_deref(), Some("Prism Puddle prices 2026-10-11.csv"));
|
||||||
|
assert_eq!(export_file_name("x.csv", "csv").as_deref(), Some("x.csv"));
|
||||||
|
assert_eq!(export_file_name("../../etc/passwd", "md").as_deref(), Some("-..-etc-passwd.md"));
|
||||||
|
assert_eq!(export_file_name(".hidden", "txt").as_deref(), Some("hidden.txt"));
|
||||||
|
assert!(export_file_name("a", "exe").is_none());
|
||||||
|
assert!(export_file_name("a", "html").is_none());
|
||||||
|
assert!(export_file_name(" ", "csv").is_none());
|
||||||
|
let long = "a".repeat(400);
|
||||||
|
assert!(export_file_name(&long, "csv").unwrap().len() <= 124);
|
||||||
|
for n in ["a/b", "a\\b", "a:b", "a\nb"] {
|
||||||
|
let f = export_file_name(n, "csv").unwrap();
|
||||||
|
assert!(!f.contains(['/', '\\', ':', '\n']), "{f}");
|
||||||
|
}
|
||||||
|
assert!(PERSONAL_EXPORT_NOTE.contains("personal data"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn app_folder_paths() {
|
||||||
|
assert!(project_relative("store/renders").is_some());
|
||||||
|
assert!(project_relative("store/renders/index.html").is_some());
|
||||||
|
for bad in ["", "/etc", "../x", "store/../../x", "./store", "a\\b", "a\u{0}b"] {
|
||||||
|
assert!(project_relative(bad).is_none(), "{bad}");
|
||||||
|
}
|
||||||
|
assert!(openable(Path::new("store/renders/index.html"), false));
|
||||||
|
assert!(openable(Path::new("store/renders"), true));
|
||||||
|
assert!(!openable(Path::new("store/renders/run.sh"), false));
|
||||||
|
assert!(!openable(Path::new("store/prices.csv"), false));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn new_folder_methods_and_big_reads() {
|
||||||
|
assert_eq!(NEW_FOLDER_METHODS, &["project.init", "import.fastlane"]);
|
||||||
|
assert_eq!(NO_CACHE_METHODS, &["project.render"]);
|
||||||
|
for c in ["project_import_fastlane", "export_save", "price_sheet_pick", "project_reveal"] {
|
||||||
|
assert!(COMMANDS.contains(&c), "{c}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -20,6 +20,7 @@ import { useData } from './store';
|
||||||
import { Icon, type IconName, Mark } from './ui/icons';
|
import { Icon, type IconName, Mark } from './ui/icons';
|
||||||
import { AppIcon, Kbd, MOD, StudioMark } from './ui/kit';
|
import { AppIcon, Kbd, MOD, StudioMark } from './ui/kit';
|
||||||
import { type Command, Palette } from './ui/Palette';
|
import { type Command, Palette } from './ui/Palette';
|
||||||
|
import { ExportMenu, useExportItems, useRunExport } from './ui/Exports';
|
||||||
import { Toasts } from './ui/Toasts';
|
import { Toasts } from './ui/Toasts';
|
||||||
|
|
||||||
const WS_ICON: Record<WorkspaceScreen, IconName> = { apps: 'folder', accounts: 'building', ignored: 'eyeOff', dependencies: 'package', settings: 'settings' };
|
const WS_ICON: Record<WorkspaceScreen, IconName> = { apps: 'folder', accounts: 'building', ignored: 'eyeOff', dependencies: 'package', settings: 'settings' };
|
||||||
|
|
@ -38,6 +39,8 @@ export function App({ onTheme }: { onTheme: () => void }) {
|
||||||
const [welcome, setWelcome] = useState(false);
|
const [welcome, setWelcome] = useState(false);
|
||||||
const [started, setStarted] = useState(false);
|
const [started, setStarted] = useState(false);
|
||||||
const [collapsed, setCollapsed] = useState<string[]>(loadCollapsed);
|
const [collapsed, setCollapsed] = useState<string[]>(loadCollapsed);
|
||||||
|
const exports = useExportItems();
|
||||||
|
const runExport = useRunExport();
|
||||||
|
|
||||||
const go = useCallback((r: Route) => { setRoute(r); document.getElementById('content')?.scrollTo({ top: 0 }); }, []);
|
const go = useCallback((r: Route) => { setRoute(r); document.getElementById('content')?.scrollTo({ top: 0 }); }, []);
|
||||||
const visible = useMemo(() => d.apps.filter(a => !a.ignored).sort((a, b) => a.name.localeCompare(b.name)), [d.apps]);
|
const visible = useMemo(() => d.apps.filter(a => !a.ignored).sort((a, b) => a.name.localeCompare(b.name)), [d.apps]);
|
||||||
|
|
@ -100,7 +103,7 @@ export function App({ onTheme }: { onTheme: () => void }) {
|
||||||
|
|
||||||
const commands = useMemo<Command[]>(() => {
|
const commands = useMemo<Command[]>(() => {
|
||||||
const c: Command[] = [];
|
const c: Command[] = [];
|
||||||
const G = { apps: t('palette.gApps'), go: t('palette.gGo'), tabs: t('palette.gTabs'), act: t('palette.gActions') };
|
const G = { apps: t('palette.gApps'), go: t('palette.gGo'), tabs: t('palette.gTabs'), act: t('palette.gActions'), exp: t('palette.gExport') };
|
||||||
const studioName = (a: UnifiedApp) => d.studios.find(s => s.id === a.studio)?.name;
|
const studioName = (a: UnifiedApp) => d.studios.find(s => s.id === a.studio)?.name;
|
||||||
for (const a of visible) c.push({ id: `app-${a.key}`, group: G.apps, title: a.name, hint: studioName(a) ?? t('palette.openApp'), keywords: `${a.ios?.app.bundleId ?? ''} ${a.android?.app.id ?? ''} ${a.project?.name ?? ''}`, app: { name: a.name, icon: d.iconFor(a) },
|
for (const a of visible) c.push({ id: `app-${a.key}`, group: G.apps, title: a.name, hint: studioName(a) ?? t('palette.openApp'), keywords: `${a.ios?.app.bundleId ?? ''} ${a.android?.app.id ?? ''} ${a.project?.name ?? ''}`, app: { name: a.name, icon: d.iconFor(a) },
|
||||||
run: () => go({ screen: 'app', appId: a.key, tab: route.screen === 'app' && tabsFor(!!a.project).includes(route.tab) ? route.tab : 'releases' }) });
|
run: () => go({ screen: 'app', appId: a.key, tab: route.screen === 'app' && tabsFor(!!a.project).includes(route.tab) ? route.tab : 'releases' }) });
|
||||||
|
|
@ -108,6 +111,13 @@ export function App({ onTheme }: { onTheme: () => void }) {
|
||||||
WORKSPACE.forEach((s, i) => c.push({ id: `go-${s}`, group: G.go, title: t(WS_KEY[s]), icon: WS_ICON[s], hint: `${MOD} ${i + 2}`, run: () => go({ screen: s }) }));
|
WORKSPACE.forEach((s, i) => c.push({ id: `go-${s}`, group: G.go, title: t(WS_KEY[s]), icon: WS_ICON[s], hint: `${MOD} ${i + 2}`, run: () => go({ screen: s }) }));
|
||||||
for (const s of d.studios) c.push({ id: `studio-${s.id}`, group: G.go, title: s.name, icon: 'building', keywords: 'studio', hint: t('palette.studio'), run: () => go({ screen: 'accounts', section: s.id }) });
|
for (const s of d.studios) c.push({ id: `studio-${s.id}`, group: G.go, title: s.name, icon: 'building', keywords: 'studio', hint: t('palette.studio'), run: () => go({ screen: 'accounts', section: s.id }) });
|
||||||
if (app) for (const tab of tabs) c.push({ id: `tab-${tab}`, group: G.tabs, title: `${app.name} · ${t(TAB_KEY[tab])}`, icon: TAB_ICON[tab], run: () => go({ screen: 'app', appId: app.key, tab }) });
|
if (app) for (const tab of tabs) c.push({ id: `tab-${tab}`, group: G.tabs, title: `${app.name} · ${t(TAB_KEY[tab])}`, icon: TAB_ICON[tab], run: () => go({ screen: 'app', appId: app.key, tab }) });
|
||||||
|
for (const x of exports) c.push({ id: `export-${x.id}`, group: G.exp, title: t('palette.export', { what: x.label }), icon: x.icon ?? 'download', keywords: `export save download ${x.kind}`, hint: x.disabled || `.${x.kind}`, run: () => { runExport(x); } });
|
||||||
|
if (app?.project) {
|
||||||
|
const p = app.project.id;
|
||||||
|
c.push({ id: 'act-prices', group: G.act, title: t('palette.prices', { name: app.name }), icon: 'coins', keywords: 'prices csv sheet', run: () => go({ screen: 'app', appId: p, tab: 'prices' }) });
|
||||||
|
c.push({ id: 'act-art', group: G.act, title: t('palette.art', { name: app.name }), icon: 'grid', keywords: 'screenshots gallery renders', run: () => go({ screen: 'app', appId: p, tab: 'art' }) });
|
||||||
|
}
|
||||||
|
c.push({ id: 'act-fastlane', group: G.act, title: t('folders.fastlane'), icon: 'download', keywords: 'fastlane import deliver supply migrate', run: () => go({ screen: 'apps' }) });
|
||||||
c.push({ id: 'act-live', group: G.act, title: t('action.readStores'), icon: 'refresh', keywords: 'refresh sync', run: () => { d.refreshPortfolio(true); } });
|
c.push({ id: 'act-live', group: G.act, title: t('action.readStores'), icon: 'refresh', keywords: 'refresh sync', run: () => { d.refreshPortfolio(true); } });
|
||||||
c.push({ id: 'act-import', group: G.act, title: t('action.importApps'), icon: 'download', keywords: 'import sync accounts', run: () => { d.importApps(); } });
|
c.push({ id: 'act-import', group: G.act, title: t('action.importApps'), icon: 'download', keywords: 'import sync accounts', run: () => { d.importApps(); } });
|
||||||
c.push({ id: 'act-check', group: G.act, title: t('action.checkConfigs'), icon: 'shield', run: () => { d.refreshPortfolio(false); } });
|
c.push({ id: 'act-check', group: G.act, title: t('action.checkConfigs'), icon: 'shield', run: () => { d.refreshPortfolio(false); } });
|
||||||
|
|
@ -116,7 +126,7 @@ export function App({ onTheme }: { onTheme: () => void }) {
|
||||||
c.push({ id: 'act-theme', group: G.act, title: t('action.toggleTheme'), icon: 'moon', keywords: 'dark light', run: onTheme });
|
c.push({ id: 'act-theme', group: G.act, title: t('action.toggleTheme'), icon: 'moon', keywords: 'dark light', run: onTheme });
|
||||||
c.push({ id: 'act-welcome', group: G.act, title: t('action.welcome'), icon: 'sparkle', keywords: 'onboarding start guide', run: () => setWelcome(true) });
|
c.push({ id: 'act-welcome', group: G.act, title: t('action.welcome'), icon: 'sparkle', keywords: 'onboarding start guide', run: () => setWelcome(true) });
|
||||||
return c;
|
return c;
|
||||||
}, [d, visible, app, tabs, route, go, onTheme]);
|
}, [d, visible, app, tabs, route, go, onTheme, exports, runExport]);
|
||||||
|
|
||||||
const crumbs: { label: string; to?: Route }[] = route.screen === 'portfolio' ? [{ label: t('nav.portfolio') }]
|
const crumbs: { label: string; to?: Route }[] = route.screen === 'portfolio' ? [{ label: t('nav.portfolio') }]
|
||||||
: route.screen === 'app' ? [{ label: t('nav.portfolio'), to: { screen: 'portfolio' } }, { label: app?.name ?? '', to: app ? { screen: 'app', appId: app.key, tab: 'releases' } : undefined }, { label: t(TAB_KEY[route.tab]) }]
|
: route.screen === 'app' ? [{ label: t('nav.portfolio'), to: { screen: 'portfolio' } }, { label: app?.name ?? '', to: app ? { screen: 'app', appId: app.key, tab: 'releases' } : undefined }, { label: t(TAB_KEY[route.tab]) }]
|
||||||
|
|
@ -207,6 +217,7 @@ export function App({ onTheme }: { onTheme: () => void }) {
|
||||||
<button className="btn btn-sm" onClick={() => d.refreshPortfolio(true)} disabled={!!d.portfolioBusy || !visible.length} title={t('action.readStoresHint')}>
|
<button className="btn btn-sm" onClick={() => d.refreshPortfolio(true)} disabled={!!d.portfolioBusy || !visible.length} title={t('action.readStoresHint')}>
|
||||||
<Icon name="refresh" className={d.portfolioBusy === 'live' ? 'spin' : undefined} />{d.portfolioBusy === 'live' ? t('action.reading') : t('action.readStores')}
|
<Icon name="refresh" className={d.portfolioBusy === 'live' ? 'spin' : undefined} />{d.portfolioBusy === 'live' ? t('action.reading') : t('action.readStores')}
|
||||||
</button>
|
</button>
|
||||||
|
<ExportMenu />
|
||||||
</header>
|
</header>
|
||||||
<main className="content" id="content" tabIndex={-1}>
|
<main className="content" id="content" tabIndex={-1}>
|
||||||
{route.screen === 'portfolio' && <Portfolio />}
|
{route.screen === 'portfolio' && <Portfolio />}
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,13 @@
|
||||||
import { invoke as tauriInvoke } from '@tauri-apps/api/core';
|
import { invoke as tauriInvoke } from '@tauri-apps/api/core';
|
||||||
import { listen as tauriListen, type UnlistenFn } from '@tauri-apps/api/event';
|
import { listen as tauriListen, type UnlistenFn } from '@tauri-apps/api/event';
|
||||||
import type { AccountCheck, AppsListResult, DraftsResult, IconResult, ListingsResult, MethodDescriptor, PortfolioResult, ProgressParams, ToolResult } from '../../../cli/lib/desktop-protocol';
|
import type { AccountCheck, AppsListResult, DraftsResult, IconResult, ListingsResult, MethodDescriptor, PortfolioResult, ProgressParams, ToolResult } from '../../../cli/lib/desktop-protocol';
|
||||||
|
import type { DeclarationsResult, ListingText, RendersResult } from '../../../cli/lib/desktop-protocol';
|
||||||
import type { Overrides } from './lib/identity';
|
import type { Overrides } from './lib/identity';
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
AccountCheck, AppIdentity, AppsListResult, AppStatus, CatalogParity, DraftsResult, StoreApp, IconResult, ListingField, ListingLocale, ListingsResult, MethodDescriptor, PortfolioResult,
|
AccountCheck, AppIdentity, AppsListResult, AppStatus, CatalogParity, DraftsResult, StoreApp, IconResult, ListingField, ListingLocale, ListingsResult, MethodDescriptor, PortfolioResult,
|
||||||
ProgressParams, ProjectSummary, ReleasePhase, ReleaseTrain, ReplyDraft, StoreRelease, ToolResult,
|
ProgressParams, ProjectSummary, ReleasePhase, ReleaseTrain, ReplyDraft, StoreRelease, ToolResult,
|
||||||
|
AnalyticsCompare, DeclAsk, DeclarationsResult, ListingText, PpoStatus, PpoTest, PriceDiffRow, PriceRowData, PricesCurrent, PricesDiff, RenderImage, RenderTile, RendersResult,
|
||||||
} from '../../../cli/lib/desktop-protocol';
|
} from '../../../cli/lib/desktop-protocol';
|
||||||
|
|
||||||
export interface AppInfo { version: string; identifier: string; platform: string; debug: boolean; home: string | null }
|
export interface AppInfo { version: string; identifier: string; platform: string; debug: boolean; home: string | null }
|
||||||
|
|
@ -116,13 +118,25 @@ export const api = {
|
||||||
updateCheck: () => invoke<UpdateInfo>('update_check'),
|
updateCheck: () => invoke<UpdateInfo>('update_check'),
|
||||||
/** Native dialog, then download, signature check, install and restart. False = not installed. */
|
/** Native dialog, then download, signature check, install and restart. False = not installed. */
|
||||||
updateInstall: (version: string) => invoke<boolean>('update_install', { version }),
|
updateInstall: (version: string) => invoke<boolean>('update_install', { version }),
|
||||||
|
/** Native folder picker, the import plan in a native dialog, then `storebound import fastlane` and the folder is added. */
|
||||||
|
importFastlane: (profile: 'app' | 'game' | 'subscription-app' | null = null) => invoke<Project | null>('project_import_fastlane', { profile }),
|
||||||
|
/** Native save dialog (Downloads first); `personal` shows the personal-data note first. The path written (~), or null. */
|
||||||
|
exportSave: (name: string, kind: ExportKind, content: string, personal = false) => invoke<string | null>('export_save', { name, kind, content, personal }),
|
||||||
|
/** Native open dialog for a price sheet (CSV); its path, or null. */
|
||||||
|
pickPriceSheet: (projectId: string) => invoke<string | null>('price_sheet_pick', { projectId }),
|
||||||
|
/** Shows a path of an app folder in the file manager, or opens a folder / the gallery page. */
|
||||||
|
reveal: (projectId: string, rel = '', open = false) => invoke<void>('project_reveal', { projectId, rel, open }),
|
||||||
};
|
};
|
||||||
|
export type ExportKind = 'csv' | 'md' | 'json' | 'txt';
|
||||||
|
|
||||||
/** Typed reads of the project files (offline) and the stores (network). */
|
/** Typed reads of the project files (offline) and the stores (network). */
|
||||||
export const reads = {
|
export const reads = {
|
||||||
icon: (projectId: string) => api.call<ToolResult & { data?: IconResult }>('project.icon', projectId),
|
icon: (projectId: string) => api.call<ToolResult & { data?: IconResult }>('project.icon', projectId),
|
||||||
listings: (projectId: string) => api.call<ToolResult & { data?: ListingsResult }>('project.listings', projectId),
|
listings: (projectId: string) => api.call<ToolResult & { data?: ListingsResult }>('project.listings', projectId),
|
||||||
drafts: (projectId: string) => api.call<ToolResult & { data?: DraftsResult }>('reviews.drafts', projectId),
|
drafts: (projectId: string) => api.call<ToolResult & { data?: DraftsResult }>('reviews.drafts', projectId),
|
||||||
|
listingText: (projectId: string) => api.call<ToolResult & { data?: ListingText }>('project.listing_text', projectId),
|
||||||
|
declarations: (projectId: string) => api.call<ToolResult & { data?: DeclarationsResult }>('project.declarations', projectId),
|
||||||
|
renders: (projectId: string) => api.call<ToolResult & { data?: RendersResult }>('project.renders', projectId),
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface ProgressEvent extends ProgressParams { job?: string }
|
export interface ProgressEvent extends ProgressParams { job?: string }
|
||||||
|
|
|
||||||
217
apps/desktop/src/dev/fixtures-more.ts
Normal file
217
apps/desktop/src/dev/fixtures-more.ts
Normal file
|
|
@ -0,0 +1,217 @@
|
||||||
|
// DEV-ONLY FIXTURE DATA for the screens that cover the rest of the CLI (prices, store art, growth, app info). Made-up
|
||||||
|
// numbers around the two demo apps; drawn SVG stand-ins for the rendered screenshots. Only src/dev/fixtures.ts imports
|
||||||
|
// this module, and only fixture mode (dev builds) loads that.
|
||||||
|
import type { AnalyticsCompare, DeclarationsResult, ListingText, PpoStatus, PriceRowData, PricesCurrent, PricesDiff, RendersResult, RenderTile } from '../api';
|
||||||
|
|
||||||
|
const HOME = '/home/you';
|
||||||
|
const NOW = Date.now();
|
||||||
|
const day = (daysAgo: number) => new Date(NOW - daysAgo * 86_400_000).toISOString().slice(0, 10);
|
||||||
|
const iso = (minutesAgo: number) => new Date(NOW - minutesAgo * 60_000).toISOString();
|
||||||
|
|
||||||
|
// ---- prices: products x territories on both stores ----
|
||||||
|
const REGIONS: [string, string, number, number][] = [
|
||||||
|
// region, currency, factor vs USD (Apple), factor (Play)
|
||||||
|
['US', 'USD', 1, 1], ['GB', 'GBP', 0.99, 0.95], ['DE', 'EUR', 1.09, 1.05], ['FR', 'EUR', 1.09, 1.05], ['IT', 'EUR', 1.09, 1.05], ['ES', 'EUR', 1.09, 1.05],
|
||||||
|
['NL', 'EUR', 1.09, 1.05], ['JP', 'JPY', 150, 148], ['KR', 'KRW', 1400, 1350], ['BR', 'BRL', 5, 4.1], ['IN', 'INR', 90, 79], ['TR', 'TRY', 30, 23],
|
||||||
|
['MX', 'MXN', 18, 17], ['CA', 'CAD', 1.39, 1.35], ['AU', 'AUD', 1.59, 1.55], ['PL', 'PLN', 4.3, 4.1], ['SE', 'SEK', 11, 10.5], ['ID', 'IDR', 15000, 15000],
|
||||||
|
['SA', 'SAR', 3.75, 3.7], ['AE', 'AED', 3.67, 3.6], ['CH', 'CHF', 1, 0.95], ['ZA', 'ZAR', 18, 17], ['TH', 'THB', 35, 33], ['VN', 'VND', 25000, 23000],
|
||||||
|
];
|
||||||
|
const BASE: Record<string, number> = { coins_small: 0.99, coins_large: 4.99, no_ads: 2.99, starter_pack: 1.99, tip_jar: 1.99 };
|
||||||
|
const round = (v: number, cur: string) => (['JPY', 'KRW', 'IDR', 'VND'].includes(cur) ? Math.round(v / 10) * 10 : ['INR', 'TRY', 'THB', 'ZAR', 'MXN', 'SEK'].includes(cur) ? Math.round(v) - 0.01 : Math.round(v * 100) / 100);
|
||||||
|
function priceRows(products: string[], missingPlay: string[]): PriceRowData[] {
|
||||||
|
const rows: PriceRowData[] = [];
|
||||||
|
for (const p of products) {
|
||||||
|
for (const [region, cur, fa, fp] of REGIONS) {
|
||||||
|
const manual = region === 'US' || (p === 'starter_pack' && region === 'TR') || (p === 'coins_large' && region === 'IN');
|
||||||
|
rows.push({ product: p, store: 'apple', region, currency: cur, price: round(BASE[p]! * fa * (region === 'TR' && p === 'starter_pack' ? 1.5 : 1), cur), kind: manual ? 'manual' : 'auto' });
|
||||||
|
if (!missingPlay.includes(p)) rows.push({ product: p, store: 'play', region, currency: cur, price: round(BASE[p]! * fp, cur) });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rows.push({ product: 'no_ads', store: 'apple', region: 'BR', currency: 'BRL', price: 19.9, startDate: day(-12), kind: 'manual' });
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
export const PRICES: Record<string, PricesCurrent> = {
|
||||||
|
'p-prism': { csv: `${HOME}/apps/prism-puddle/store/prices.csv`, products: ['coins_small', 'coins_large', 'no_ads', 'starter_pack'], stores: ['apple', 'play'],
|
||||||
|
missing: [{ product: 'starter_pack', store: 'play' }], rows: priceRows(['coins_small', 'coins_large', 'no_ads', 'starter_pack'], ['starter_pack']) },
|
||||||
|
'p-tidy': { csv: `${HOME}/apps/tidy-lists/store/prices.csv`, products: ['tip_jar'], stores: ['apple', 'play'], missing: [], rows: priceRows(['tip_jar'], []) },
|
||||||
|
};
|
||||||
|
export const PRICE_DIFF: Record<string, PricesDiff> = {
|
||||||
|
'p-prism': {
|
||||||
|
csv: `${HOME}/apps/prism-puddle/store/prices.csv`, changed: ['coins_small|play', 'coins_small|apple', 'no_ads|apple', 'coins_large|play'],
|
||||||
|
diff: [
|
||||||
|
{ product: 'coins_small', store: 'play', region: 'TR', currency: 'TRY', from: 21.99, to: 24.99, change: 'change' },
|
||||||
|
{ product: 'coins_small', store: 'play', region: 'BR', currency: 'BRL', from: 3.99, to: 4.49, change: 'change' },
|
||||||
|
{ product: 'coins_small', store: 'apple', region: 'TR', currency: 'TRY', from: 29.99, to: 24.99, change: 'change' },
|
||||||
|
{ product: 'no_ads', store: 'apple', region: 'BR', startDate: day(-14), currency: 'BRL', from: 14.9, to: 12.9, change: 'change' },
|
||||||
|
{ product: 'coins_large', store: 'play', region: 'IN', currency: 'INR', from: 393, to: 449, change: 'change' },
|
||||||
|
{ product: 'coins_large', store: 'play', region: 'KR', currency: 'KRW', from: null, to: 6500, change: 'new' },
|
||||||
|
{ product: 'coins_large', store: 'apple', region: 'US', currency: 'USD', from: 4.99, to: 4.99, change: 'same' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
'p-tidy': { csv: `${HOME}/apps/tidy-lists/store/prices.csv`, changed: [], diff: [{ product: 'tip_jar', store: 'apple', region: 'US', currency: 'USD', from: 1.99, to: 1.99, change: 'same' }] },
|
||||||
|
};
|
||||||
|
|
||||||
|
// ---- declarations ----
|
||||||
|
const PRISM_CSV = 'Question ID (machine readable),Response ID (machine readable),Response value,Answer requirement,Human-friendly question label\nPSL_DATA_COLLECTION_COLLECTS_PERSONAL_DATA,,TRUE,REQUIRED,Does your app collect or share any of the required user data types?\n';
|
||||||
|
export const DECLARATIONS: Record<string, DeclarationsResult> = {
|
||||||
|
'p-prism': {
|
||||||
|
profile: 'game', stores: { apple: true, play: true },
|
||||||
|
dataSafety: {
|
||||||
|
collectsData: true, encryptedInTransit: true, deletionRequest: false, accountCreation: ['PSL_ACM_NONE'], extra: 0, csv: PRISM_CSV, rows: 431,
|
||||||
|
types: [
|
||||||
|
{ id: 'PSL_DEVICE_ID', category: 'identifiers', shared: true, ephemeral: false, optional: false, collect: ['advertising', 'analytics'], share: ['advertising'] },
|
||||||
|
{ id: 'PSL_APPROX_LOCATION', category: 'location', shared: true, ephemeral: false, optional: false, collect: ['advertising'], share: ['advertising'] },
|
||||||
|
{ id: 'PSL_USER_INTERACTION', category: 'app activity', shared: false, ephemeral: false, optional: false, collect: ['analytics', 'functionality'], share: [] },
|
||||||
|
{ id: 'PSL_PURCHASE_HISTORY', category: 'financial', shared: false, ephemeral: false, optional: false, collect: ['functionality'], share: [] },
|
||||||
|
{ id: 'PSL_CRASH_LOGS', category: 'app performance', shared: false, ephemeral: false, optional: false, collect: ['analytics'], share: [] },
|
||||||
|
],
|
||||||
|
uploaded: { at: iso(60 * 24 * 9), changes: [
|
||||||
|
{ question: 'PSL_DATA_TYPES_LOCATION', response: 'PSL_APPROX_LOCATION', from: '', to: 'TRUE' },
|
||||||
|
{ question: 'PSL_DATA_USAGE_RESPONSES:PSL_APPROX_LOCATION:PSL_DATA_USAGE_COLLECTION_AND_SHARING', response: 'PSL_DATA_USAGE_ONLY_SHARED', from: '', to: 'TRUE' },
|
||||||
|
{ question: 'PSL_DATA_USAGE_RESPONSES:PSL_APPROX_LOCATION:DATA_USAGE_SHARING_PURPOSE', response: 'PSL_ADVERTISING', from: '', to: 'TRUE' },
|
||||||
|
] },
|
||||||
|
},
|
||||||
|
appPrivacy: { fromDataSafety: true, items: [
|
||||||
|
{ apple: 'Device ID', category: 'Identifiers', from: ['PSL_DEVICE_ID'], purposes: ['Analytics', 'Third-Party Advertising'], thirdParty: true },
|
||||||
|
{ apple: 'Coarse Location', category: 'Location', from: ['PSL_APPROX_LOCATION'], purposes: ['Third-Party Advertising'], thirdParty: true },
|
||||||
|
{ apple: 'Product Interaction', category: 'Usage Data', from: ['PSL_USER_INTERACTION'], purposes: ['Analytics', 'App Functionality'], thirdParty: false },
|
||||||
|
{ apple: 'Purchase History', category: 'Purchases', from: ['PSL_PURCHASE_HISTORY'], purposes: ['App Functionality'], thirdParty: false },
|
||||||
|
{ apple: 'Crash Data', category: 'Diagnostics', from: ['PSL_CRASH_LOGS'], purposes: ['Analytics'], thirdParty: false },
|
||||||
|
] },
|
||||||
|
appInfo: { categories: { primary: 'GAMES', primarySubOne: 'GAMES_PUZZLE', primarySubTwo: 'GAMES_CASUAL' }, ageRating: [], contentRights: 'DOES_NOT_USE_THIRD_PARTY_CONTENT', free: true },
|
||||||
|
encryption: false,
|
||||||
|
review: { signInRequired: false, accounts: false, contact: 's***@example.com', demoAccount: null, notes: 'Offline puzzle game, no sign-in. Remove Ads is restored from Settings > Restore purchases. The daily drop unlocks at midnight local time.', notesBytes: 148, notesMax: 4000 },
|
||||||
|
ask: [
|
||||||
|
{ area: 'appInfo', id: 'ai-age', text: 'No age rating answers: storebound would answer every content question "none".', fix: 'Confirm that is true (ads, user-generated content, chat, loot boxes, web access count), or set apple.info.ageRating overrides.' },
|
||||||
|
{ area: 'appPrivacy', id: 'ap-linked', text: 'App Privacy asks per data type whether it is linked to the user\'s identity and whether it is used for tracking; the config cannot prove either.', fix: 'Answer both in App Store Connect > App Privacy for each type below (tracking also needs App Tracking Transparency in the app).' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
'p-tidy': {
|
||||||
|
profile: 'app', stores: { apple: true, play: true },
|
||||||
|
dataSafety: {
|
||||||
|
collectsData: true, encryptedInTransit: true, deletionRequest: true, accountCreation: ['PSL_ACM_USER_ID_PASSWORD'], extra: 1, csv: PRISM_CSV, rows: 432,
|
||||||
|
types: [
|
||||||
|
{ id: 'PSL_EMAIL', category: 'personal', shared: false, ephemeral: false, optional: false, collect: ['functionality', 'account'], share: [] },
|
||||||
|
{ id: 'PSL_USER_ACCOUNT', category: 'personal', shared: false, ephemeral: false, optional: false, collect: ['functionality', 'account'], share: [] },
|
||||||
|
{ id: 'PSL_USER_GENERATED_CONTENT', category: 'app activity', shared: false, ephemeral: false, optional: false, collect: ['functionality'], share: [] },
|
||||||
|
],
|
||||||
|
uploaded: { at: iso(60 * 24 * 3), changes: [] },
|
||||||
|
},
|
||||||
|
appPrivacy: { fromDataSafety: true, items: [
|
||||||
|
{ apple: 'Email Address', category: 'Contact Info', from: ['PSL_EMAIL'], purposes: ['App Functionality'], thirdParty: false },
|
||||||
|
{ apple: 'User ID', category: 'Identifiers', from: ['PSL_USER_ACCOUNT'], purposes: ['App Functionality'], thirdParty: false },
|
||||||
|
{ apple: 'Other User Content', category: 'User Content', from: ['PSL_USER_GENERATED_CONTENT'], purposes: ['App Functionality'], thirdParty: false },
|
||||||
|
] },
|
||||||
|
appInfo: { categories: { primary: 'PRODUCTIVITY' }, ageRating: [{ question: 'userGeneratedContent', value: 'true' }], contentRights: 'DOES_NOT_USE_THIRD_PARTY_CONTENT', free: true },
|
||||||
|
encryption: null,
|
||||||
|
review: { signInRequired: true, accounts: true, contact: 's***@example.com', demoAccount: 'd***@example.com', notes: 'Sign in with the demo account. Lists are shared from the share button on a list.\n\nSign-in: use the demo account above.\n\nAccount deletion: Settings > Account > Delete account', notesBytes: 176, notesMax: 4000 },
|
||||||
|
ask: [
|
||||||
|
{ area: 'encryption', id: 'enc-unset', text: 'Export compliance is not answered (apple.usesNonExemptEncryption).', fix: 'Decide it with the export-compliance skill; false only when the app uses no encryption beyond the OS. storebound never guesses it.' },
|
||||||
|
{ area: 'appPrivacy', id: 'ap-linked', text: 'App Privacy asks per data type whether it is linked to the user\'s identity and whether it is used for tracking; the config cannot prove either.', fix: 'Answer both in App Store Connect > App Privacy for each type below.' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
export const LISTING_TEXT: Record<string, ListingText> = {
|
||||||
|
'p-prism': { play: { path: `${HOME}/apps/prism-puddle/store/listing.md`, text: '## en-US\n\n### title\n```\nPrism Puddle\n```\n' }, apple: { path: `${HOME}/apps/prism-puddle/store/appstore.md`, text: '## en-US\n\n### name\n```\nPrism Puddle\n```\n' } },
|
||||||
|
'p-tidy': { play: { path: `${HOME}/apps/tidy-lists/store/listing.md`, text: '## en-US\n' }, apple: { path: `${HOME}/apps/tidy-lists/store/appstore.md`, text: '## en-US\n' } },
|
||||||
|
};
|
||||||
|
|
||||||
|
// ---- store art: drawn stand-ins for the renders ----
|
||||||
|
const COPY: Record<string, string[][]> = {
|
||||||
|
en: [['Catch every', 'color drop!'], ['Chain splashes,', 'stack combos'], ['A new challenge', 'every day'], ['Clear levels,', 'earn 3 stars']],
|
||||||
|
tr: [['Renkli damlaları', 'yakala!'], ['Sıçrat, eşleştir,', 'komboyu büyüt'], ['Her gün', 'yeni bir görev'], ['Bölümleri geç,', '3 yıldız topla']],
|
||||||
|
ja: [['カラフルなしずくを', 'キャッチ!'], ['しずくをそろえて', 'コンボをつなげ'], ['毎日あたらしい', 'チャレンジ'], ['ステージクリアで', '星を3つゲット']],
|
||||||
|
ar: [['التقط كل', 'قطرة ملوّنة!'], ['طابق القطرات', 'وضاعف الكومبو'], ['تحدٍّ جديد', 'كل يوم'], ['أنهِ المراحل', 'واجمع 3 نجوم']],
|
||||||
|
};
|
||||||
|
const PAL = [['#7c5cff', '#ff5fa2', '#ffd36e'], ['#ff7a59', '#ff3d7f', '#ffe08a'], ['#2fb5ff', '#5b6cff', '#b8f3ff'], ['#ffb03b', '#ff7a1a', '#fff1b8']];
|
||||||
|
const esc = (s: string) => s.replace(/&/g, '&').replace(/</g, '<');
|
||||||
|
function shot(scene: number, lang: string, w: number, h: number, variant: string): string {
|
||||||
|
const order = variant === 'b' ? [1, 0, 3, 2] : [0, 1, 2, 3];
|
||||||
|
const sc = order[scene % 4]!;
|
||||||
|
const [a, b, c] = PAL[variant === 'b' && sc === 1 ? 2 : sc]!;
|
||||||
|
const t = COPY[lang]?.[sc] ?? COPY.en![sc]!;
|
||||||
|
const land = w > h;
|
||||||
|
const fs = Math.round((land ? h : w) * 0.085);
|
||||||
|
const pw = land ? h * 0.42 : w * 0.62, ph = pw * 2.05, px = land ? w * 0.62 : (w - pw) / 2, py = land ? h * 0.18 : h * 0.3;
|
||||||
|
const drops = Array.from({ length: 7 }, (_, i) => `<circle cx="${px + pw * (0.2 + (i % 3) * 0.3)}" cy="${py + ph * (0.25 + Math.floor(i / 3) * 0.2)}" r="${pw * 0.09}" fill="${[a, b, c][i % 3]}" opacity=".9"/>`).join('');
|
||||||
|
const tx = land ? w * 0.08 : w / 2, anchor = land ? 'start' : 'middle';
|
||||||
|
return `data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${w} ${h}"><defs><linearGradient id="g" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="${a}"/><stop offset="1" stop-color="${b}"/></linearGradient><radialGradient id="r" cx=".5" cy=".3" r=".7"><stop offset="0" stop-color="#fff" stop-opacity=".35"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></radialGradient></defs><rect width="${w}" height="${h}" fill="url(#g)"/><rect width="${w}" height="${h}" fill="url(#r)"/><text x="${tx}" y="${land ? h * 0.42 : h * 0.12}" font-family="Arial Rounded MT Bold, Arial, sans-serif" font-weight="800" font-size="${fs}" fill="#fff" text-anchor="${anchor}">${esc(t[0]!)}</text><text x="${tx}" y="${(land ? h * 0.42 : h * 0.12) + fs * 1.15}" font-family="Arial Rounded MT Bold, Arial, sans-serif" font-weight="800" font-size="${fs}" fill="${c}" text-anchor="${anchor}">${esc(t[1]!)}</text><rect x="${px}" y="${py}" width="${pw}" height="${ph}" rx="${pw * 0.12}" fill="#10142a" stroke="#fff" stroke-opacity=".85" stroke-width="${pw * 0.03}"/><rect x="${px + pw * 0.06}" y="${py + pw * 0.08}" width="${pw * 0.88}" height="${ph - pw * 0.16}" rx="${pw * 0.08}" fill="#1d2350"/>${drops}</svg>`)))}`;
|
||||||
|
}
|
||||||
|
const SIZES: [string, string, 'apple' | 'play', number, number][] = [
|
||||||
|
['ios69', 'App Store iPhone 6.9"', 'apple', 1320, 2868], ['ios65', 'App Store iPhone 6.5"', 'apple', 1284, 2778], ['ipad13', 'App Store iPad 13"', 'apple', 2064, 2752],
|
||||||
|
['play', 'Google Play phone', 'play', 1080, 1920], ['feature', 'Google Play feature graphic', 'play', 1024, 500],
|
||||||
|
];
|
||||||
|
const ART: Record<string, string> = {};
|
||||||
|
function renders(langs: string[], variants: string[]): RendersResult {
|
||||||
|
let images = 0, errors = 0, warnings = 0, videos = 0;
|
||||||
|
const out: RendersResult = { title: 'store renders', generated: day(0) + ' 09:12', dir: 'store/renders', variants: [], totals: { images: 0, videos: 0, errors: 0, warnings: 0 } };
|
||||||
|
for (const v of ['', ...variants]) {
|
||||||
|
out.variants.push({ id: v, label: v ? `variant ${v}` : 'base', langs: langs.map(lang => ({
|
||||||
|
lang,
|
||||||
|
rows: [...SIZES.filter(s => !(v && s[0] === 'feature')).map(([size, label, store, w, h]) => {
|
||||||
|
const n = size === 'feature' ? 1 : lang === 'ar' && size === 'ipad13' ? 0 : 4;
|
||||||
|
const tiles: RenderTile[] = Array.from({ length: n }, (_, i) => {
|
||||||
|
const src = `${v ? `${v}/` : ''}${lang}/${size}/${size === 'feature' ? '1024x500' : String(i + 1).padStart(2, '0')}.png`;
|
||||||
|
ART[src] = shot(i, lang, w, h, v);
|
||||||
|
const issues = lang === 'ja' && size === 'play' && i === 1 ? [{ level: 'warn' as const, code: 'overflow', msg: 'title line 2 shrunk to 72 %: consider shorter words' }]
|
||||||
|
: lang === 'tr' && size === 'feature' ? [{ level: 'warn' as const, code: 'bytes', msg: 'PNG is 1.4 MB: the JPEG copy uploads 4x faster (storebound shots jpeg)' }] : [];
|
||||||
|
images++; warnings += issues.length;
|
||||||
|
return { src, kind: 'image' as const, name: src.split('/').pop()!, w, h, bytes: Math.round(w * h * 0.42), issues };
|
||||||
|
});
|
||||||
|
const rowIssues = n === 0 ? [{ level: 'error' as const, code: 'count', msg: `no ${label} images (needs 1-10)` }] : [];
|
||||||
|
errors += rowIssues.length;
|
||||||
|
return { size, label, store, tiles, issues: rowIssues };
|
||||||
|
}), ...(!v && lang !== 'ar' ? [{ size: 'preview/iphone', label: 'App preview iPhone', store: 'apple' as const, issues: [], tiles: [(() => {
|
||||||
|
const src = `${lang}/preview/iphone/01.mp4`, poster = `${lang}/preview/iphone/01-poster.png`;
|
||||||
|
ART[poster] = shot(1, lang, 886, 1920, '');
|
||||||
|
videos++;
|
||||||
|
return { src, kind: 'video' as const, poster, name: '01.mp4', w: 886, h: 1920, bytes: 18_400_000, issues: [] };
|
||||||
|
})()] }] : [])],
|
||||||
|
})) });
|
||||||
|
}
|
||||||
|
out.totals = { images, videos, errors, warnings };
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
export const RENDERS: Record<string, RendersResult> = { 'p-prism': renders(['en', 'tr', 'ja', 'ar'], ['b']), 'p-tidy': renders(['en', 'tr'], []) };
|
||||||
|
export const renderArt = (file: string): string | null => ART[file] ?? null;
|
||||||
|
|
||||||
|
// ---- Product Page Optimization ----
|
||||||
|
export const PPO: Record<string, PpoStatus> = {
|
||||||
|
'p-prism': { tests: [
|
||||||
|
{ id: 'e2', name: 'storebound b', state: 'ACCEPTED', trafficProportion: 30, startDate: day(6), endDate: null, treatments: [{ id: 't1', name: 'b', locales: 4 }] },
|
||||||
|
{ id: 'e1', name: 'night palette', state: 'COMPLETED', trafficProportion: 50, startDate: day(70), endDate: day(40), treatments: [] },
|
||||||
|
] },
|
||||||
|
'p-tidy': { tests: [] },
|
||||||
|
};
|
||||||
|
export const PPO_STORE: PpoStatus = { tests: [{ id: 'e9', name: 'calm icons', state: 'PREPARE_FOR_SUBMISSION', trafficProportion: 20, startDate: null, endDate: null, treatments: [{ id: 't9', name: 'calm', locales: 2 }] }] };
|
||||||
|
|
||||||
|
// ---- analytics ----
|
||||||
|
function analytics(days: number, seed: number): AnalyticsCompare {
|
||||||
|
const apple: AnalyticsCompare['series']['apple'] = [], play: AnalyticsCompare['series']['play'] = [];
|
||||||
|
for (let i = days; i >= 1; i--) {
|
||||||
|
const d = day(i), k = days - i;
|
||||||
|
const wave = 1 + Math.sin(k / 3.2 + seed) * 0.12 + (k % 7 >= 5 ? 0.18 : 0);
|
||||||
|
const lift = k > days * 0.55 ? 1.16 : 1;
|
||||||
|
const imp = Math.round(4200 * wave * (1 + k / days * 0.25)), views = Math.round(imp * 0.31);
|
||||||
|
apple.push({ date: d, impressions: imp, uniqueImpressions: Math.round(imp * 0.72), pageViews: views, uniquePageViews: Math.round(views * 0.8), downloads: Math.round(imp * 0.041 * lift), firstTimeDownloads: Math.round(imp * 0.033 * lift) });
|
||||||
|
const vis = Math.round(2600 * wave * (1 + k / days * 0.2));
|
||||||
|
play.push({ date: d, visitors: vis, acquisitions: Math.round(vis * 0.27 * lift), installs: Math.round(vis * 0.3 * lift) });
|
||||||
|
}
|
||||||
|
const ev = (daysAgo: number, commit: string, subject: string, files: string[]) => ({ date: day(daysAgo), commit, subject, files });
|
||||||
|
const events = [ev(Math.round(days * 0.45), 'a41c9e2', 'store: combo screenshot first (variant b won)', ['store/shots/copy.json', 'storebound.config.ts']), ev(Math.round(days * 0.75), '9be03d1', 'listing: shorter subtitle and keywords', ['store/appstore.md']), ev(Math.round(days * 0.2), 'c07f5aa', 'listing: new full description', ['store/listing.md'])];
|
||||||
|
const tot = (xs: { a: number; b: number }[]) => { const a = xs.reduce((n, x) => n + x.a, 0), b = xs.reduce((n, x) => n + x.b, 0); return { a, b, conv: a ? b / a : null }; };
|
||||||
|
const effects: AnalyticsCompare['effects'] = [];
|
||||||
|
for (const e of events) {
|
||||||
|
for (const store of ['apple', 'play'] as const) {
|
||||||
|
const s = store === 'apple' ? apple.map(x => ({ date: x.date, a: x.impressions, b: x.downloads })) : play.map(x => ({ date: x.date, a: x.visitors, b: x.acquisitions }));
|
||||||
|
const i = s.findIndex(x => x.date >= e.date);
|
||||||
|
if (i < 0) continue;
|
||||||
|
const before = tot(s.slice(Math.max(0, i - 7), i)), after = tot(s.slice(i, i + 7));
|
||||||
|
effects.push({ event: e, store, daysBefore: Math.min(7, i), daysAfter: Math.min(7, s.length - i),
|
||||||
|
before: store === 'apple' ? { impressions: before.a, downloads: before.b, conversion: before.conv } : { visitors: before.a, acquisitions: before.b, conversion: before.conv },
|
||||||
|
after: store === 'apple' ? { impressions: after.a, downloads: after.b, conversion: after.conv } : { visitors: after.a, acquisitions: after.b, conversion: after.conv } });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return { snapshots: Math.ceil(days / 28) + 1, since: day(days), series: { apple, play }, effects };
|
||||||
|
}
|
||||||
|
export const ANALYTICS: Record<string, AnalyticsCompare | null> = { 'p-prism': analytics(56, 1), 'p-tidy': null };
|
||||||
|
|
@ -7,6 +7,7 @@ import { type Account, type AccountCheck, type AppsListResult, type AppStatus, t
|
||||||
type PortfolioResult, type Project, type ProjectSummary, type Settings, type StoreApp, type StoreRelease, type Studio, type ToolResult } from '../api';
|
type PortfolioResult, type Project, type ProjectSummary, type Settings, type StoreApp, type StoreRelease, type Studio, type ToolResult } from '../api';
|
||||||
import { buildApps, type Overrides } from '../lib/identity';
|
import { buildApps, type Overrides } from '../lib/identity';
|
||||||
import type { CatalogDiff, HealthSnapshot, MetricRow, Review, TestFlightStatus, ValidateResult } from '../lib/model';
|
import type { CatalogDiff, HealthSnapshot, MetricRow, Review, TestFlightStatus, ValidateResult } from '../lib/model';
|
||||||
|
import { ANALYTICS, DECLARATIONS, LISTING_TEXT, PPO, PPO_STORE, PRICE_DIFF, PRICES, renderArt, RENDERS } from './fixtures-more';
|
||||||
|
|
||||||
export const FIXTURE_MARKER = 'storebound-dev-fixtures';
|
export const FIXTURE_MARKER = 'storebound-dev-fixtures';
|
||||||
|
|
||||||
|
|
@ -395,13 +396,14 @@ const STORE_REVIEWS: Review[] = [
|
||||||
R('play', 's-p2', 2, 'Too many ads', 'An ad after every round is too much.', 'en', 5),
|
R('play', 's-p2', 2, 'Too many ads', 'An ad after every round is too much.', 'en', 5),
|
||||||
R('apple', 's-a3', 5, 'Harika', 'Her gün kullanıyorum, çok sade.', 'TUR', 7),
|
R('apple', 's-a3', 5, 'Harika', 'Her gün kullanıyorum, çok sade.', 'TUR', 7),
|
||||||
];
|
];
|
||||||
function read(method: string, id: string): ToolResult {
|
function read(method: string, id: string, args: Record<string, unknown> = {}): ToolResult {
|
||||||
if (id.startsWith('store:')) {
|
if (id.startsWith('store:')) {
|
||||||
const play = /android:/.test(id);
|
const play = /android:/.test(id);
|
||||||
switch (method) {
|
switch (method) {
|
||||||
case 'health': return ok(method, play ? HEALTH['p-tidy'] : { date: day(0), apple: HEALTH['p-tidy']!.apple });
|
case 'health': return ok(method, play ? HEALTH['p-tidy'] : { date: day(0), apple: HEALTH['p-tidy']!.apple });
|
||||||
case 'reviews.list': return ok(method, STORE_REVIEWS.filter(r => (play || r.store === 'apple') && (/ios:/.test(id) || r.store === 'play')));
|
case 'reviews.list': return ok(method, STORE_REVIEWS.filter(r => (play || r.store === 'apple') && (/ios:/.test(id) || r.store === 'play')));
|
||||||
case 'apple.testflight_status': return ok(method, TF['p-tidy']);
|
case 'apple.testflight_status': return ok(method, TF['p-tidy']);
|
||||||
|
case 'apple.ppo_status': return ok(method, /ios:/.test(id) ? PPO_STORE : { tests: [] });
|
||||||
default: return { method, ok: false, exitCode: 1, dryRun: false, command: `storebound ${method}`, output: `fixture: ${method} needs an app folder` };
|
default: return { method, ok: false, exitCode: 1, dryRun: false, command: `storebound ${method}`, output: `fixture: ${method} needs an app folder` };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -414,13 +416,21 @@ function read(method: string, id: string): ToolResult {
|
||||||
case 'apple.testflight_status': return ok(method, TF[id]);
|
case 'apple.testflight_status': return ok(method, TF[id]);
|
||||||
case 'catalog.diff': return ok(method, CATALOG[id]);
|
case 'catalog.diff': return ok(method, CATALOG[id]);
|
||||||
case 'validate': return ok(method, VALIDATE[id]);
|
case 'validate': return ok(method, VALIDATE[id]);
|
||||||
|
case 'project.declarations': return ok(method, DECLARATIONS[id]);
|
||||||
|
case 'project.listing_text': return ok(method, LISTING_TEXT[id]);
|
||||||
|
case 'project.renders': return ok(method, RENDERS[id]);
|
||||||
|
case 'project.render': return ok(method, { file: String(args.file), dataUrl: renderArt(String(args.file)), bytes: 1_200_000 });
|
||||||
|
case 'prices.current': return ok(method, PRICES[id]);
|
||||||
|
case 'prices.diff': return ok(method, PRICE_DIFF[id]);
|
||||||
|
case 'apple.ppo_status': return ok(method, PPO[id]);
|
||||||
|
case 'analytics.compare': return ANALYTICS[id] ? ok(method, ANALYTICS[id]) : { method, ok: false, exitCode: 1, dryRun: false, command: 'storebound analytics compare --json', output: `error: no snapshots in ${HOME}/apps/tidy-lists/.storebound/analytics (storebound analytics snapshot)` };
|
||||||
case 'check': return { method, ok: true, exitCode: 0, dryRun: false, command: 'storebound check', output: '12:00:01 [check] config ok: storebound.config.ts\n12:00:01 [check] listing: 4 languages\n12:00:01 [check] 0 problems, 2 warnings' };
|
case 'check': return { method, ok: true, exitCode: 0, dryRun: false, command: 'storebound check', output: '12:00:01 [check] config ok: storebound.config.ts\n12:00:01 [check] listing: 4 languages\n12:00:01 [check] 0 problems, 2 warnings' };
|
||||||
default: return { method, ok: false, exitCode: 1, dryRun: false, command: `storebound ${method}`, output: `fixture: no data for ${method}` };
|
default: return { method, ok: false, exitCode: 1, dryRun: false, command: `storebound ${method}`, output: `fixture: no data for ${method}` };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const CACHED_AGO: Record<string, number> = { health: 60 * 3, 'reviews.list': 45, 'apple.testflight_status': 60 * 5, 'catalog.diff': 60 * 26, validate: 60 * 2 };
|
const CACHED_AGO: Record<string, number> = { health: 60 * 3, 'reviews.list': 45, 'apple.testflight_status': 60 * 5, 'catalog.diff': 60 * 26, validate: 60 * 2, 'prices.current': 60 * 4, 'apple.ppo_status': 60 * 6 };
|
||||||
const NETWORK = new Set(['health', 'reviews.list', 'apple.testflight_status', 'catalog.diff', 'validate']);
|
const NETWORK = new Set(['health', 'reviews.list', 'apple.testflight_status', 'catalog.diff', 'validate', 'prices.current', 'prices.diff', 'apple.ppo_status']);
|
||||||
|
|
||||||
async function progressLines(job: string | null, lines: string[]) {
|
async function progressLines(job: string | null, lines: string[]) {
|
||||||
for (const line of lines) { await sleep(260); if (job) emit('sidecar-progress', { params: { requestId: 1, line, stream: 'stderr' }, job }); }
|
for (const line of lines) { await sleep(260); if (job) emit('sidecar-progress', { params: { requestId: 1, line, stream: 'stderr' }, job }); }
|
||||||
|
|
@ -494,7 +504,7 @@ async function answer(cmd: string, a: Record<string, unknown>): Promise<unknown>
|
||||||
if (NETWORK.has(method)) await progressLines(job, [`[${method}] reading App Store Connect`, `[${method}] reading Google Play`, `[${method}] done`]);
|
if (NETWORK.has(method)) await progressLines(job, [`[${method}] reading App Store Connect`, `[${method}] reading Google Play`, `[${method}] done`]);
|
||||||
else await sleep(150);
|
else await sleep(150);
|
||||||
if (job && cancelled.has(job)) throw { code: -32800, message: 'Request cancelled' };
|
if (job && cancelled.has(job)) throw { code: -32800, message: 'Request cancelled' };
|
||||||
return read(method, id);
|
return read(method, id, ((a.params as { args?: Record<string, unknown> } | null)?.args) ?? {});
|
||||||
}
|
}
|
||||||
case 'job_cancel': cancelled.add(a.job as string); return true;
|
case 'job_cancel': cancelled.add(a.job as string); return true;
|
||||||
case 'write_with_confirm': {
|
case 'write_with_confirm': {
|
||||||
|
|
@ -508,7 +518,10 @@ async function answer(cmd: string, a: Record<string, unknown>): Promise<unknown>
|
||||||
const res: ToolResult = { method, ok: true, exitCode: 0, dryRun: false, command: `storebound ${method.replace('.', ' ')}`, output: `[${method}] done (fixture)` };
|
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 };
|
return { confirmed: true, stage: 'done', dryRun: { ...res, dryRun: true }, result: res };
|
||||||
}
|
}
|
||||||
case 'project_add': case 'project_init': await sleep(300); return null;
|
case 'project_add': case 'project_init': case 'project_import_fastlane': await sleep(300); return null;
|
||||||
|
case 'export_save': await sleep(200); return `~/Downloads/${String(a.name)}.${String(a.kind)}`;
|
||||||
|
case 'price_sheet_pick': return `${HOME}/Downloads/prices-autumn.csv`;
|
||||||
|
case 'project_reveal': return null;
|
||||||
case 'project_remove': projects = projects.filter(p => p.id !== a.id); return null;
|
case 'project_remove': projects = projects.filter(p => p.id !== a.id); return null;
|
||||||
case 'project_set_accounts': { const p = projects.find(x => x.id === a.id)!; p.playAccount = (a.play as string | null) ?? null; p.appleAccount = (a.apple as string | null) ?? null; return p; }
|
case 'project_set_accounts': { const p = projects.find(x => x.id === a.id)!; p.playAccount = (a.play as string | null) ?? null; p.appleAccount = (a.apple as string | null) ?? null; return p; }
|
||||||
case 'account_add_play': case 'account_add_apple': return null;
|
case 'account_add_play': case 'account_add_apple': return null;
|
||||||
|
|
|
||||||
|
|
@ -527,7 +527,7 @@ export const en = {
|
||||||
'wz.footer': 'You can open this guide again from Settings or the command palette.',
|
'wz.footer': 'You can open this guide again from Settings or the command palette.',
|
||||||
'wz.footerSafe': 'Nothing is submitted or released from here.',
|
'wz.footerSafe': 'Nothing is submitted or released from here.',
|
||||||
'wz.welcomeTitle': 'Every app, both stores, one window',
|
'wz.welcomeTitle': 'Every app, both stores, one window',
|
||||||
'wz.welcomeLead': 'storebound desktop shows where each of your apps stands on the App Store and Google Play, and runs the storebound CLI for you. Five short steps get you there.',
|
'wz.welcomeLead': 'storebound desktop shows where each of your apps stands on the App Store and Google Play, and runs the storebound CLI for you. Six short steps get you there.',
|
||||||
'wz.p1t': 'One portfolio',
|
'wz.p1t': 'One portfolio',
|
||||||
'wz.p1s': 'Releases, rollouts, catalog parity, health and reviews of every app.',
|
'wz.p1s': 'Releases, rollouts, catalog parity, health and reviews of every app.',
|
||||||
'wz.p2t': 'Safe by design',
|
'wz.p2t': 'Safe by design',
|
||||||
|
|
@ -552,7 +552,7 @@ export const en = {
|
||||||
'wz.readLead': 'One read-only pass over App Store Connect and Google Play fills the portfolio: versions, review state, rollouts and catalog parity.',
|
'wz.readLead': 'One read-only pass over App Store Connect and Google Play fills the portfolio: versions, review state, rollouts and catalog parity.',
|
||||||
'wz.readNow': 'Read the stores now',
|
'wz.readNow': 'Read the stores now',
|
||||||
'wz.readDone': '{count} apps read {when}',
|
'wz.readDone': '{count} apps read {when}',
|
||||||
'wz.needApp': 'Add an app folder first (step 2).',
|
'wz.needApp': 'Add an app folder first (step 3).',
|
||||||
'wz.skip': 'Skip for now',
|
'wz.skip': 'Skip for now',
|
||||||
'wz.back': 'Back',
|
'wz.back': 'Back',
|
||||||
'wz.next': 'Next',
|
'wz.next': 'Next',
|
||||||
|
|
@ -871,5 +871,355 @@ export const en = {
|
||||||
'reviews.tooLong': 'Longer than the store allows ({limit} characters)',
|
'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.',
|
'reviews.sendNoteD3': 'Replies are public. Save, approve, then Send: each step shows a system dialog first.',
|
||||||
|
|
||||||
|
// ---- every CLI area in the window: prices, store art, growth, app info, exports, onboarding ----
|
||||||
|
'tab.prices': 'Prices',
|
||||||
|
'tab.art': 'Store art',
|
||||||
|
'tab.growth': 'Growth',
|
||||||
|
'tab.appinfo': 'App info',
|
||||||
|
'col.date': 'Date',
|
||||||
|
'common.yes': 'Yes',
|
||||||
|
'common.no': 'No',
|
||||||
|
|
||||||
|
'export.button': 'Export',
|
||||||
|
'export.hint': 'Save what this screen shows as a file (CSV or Markdown)',
|
||||||
|
'export.saved': 'Saved',
|
||||||
|
'export.failed': 'Export failed',
|
||||||
|
'export.readFirst': 'Read it first',
|
||||||
|
'export.personal': 'personal data',
|
||||||
|
'export.prices': 'Prices (CSV, price sheet format)',
|
||||||
|
'export.reviews': 'Reviews (CSV)',
|
||||||
|
'export.health': 'Health report (Markdown)',
|
||||||
|
'export.validate': 'Store readiness report (Markdown)',
|
||||||
|
'export.catalog': 'Catalog parity (Markdown)',
|
||||||
|
'export.listings': 'Listings (Markdown)',
|
||||||
|
'export.noListings': 'No listing files in this app folder',
|
||||||
|
'export.portfolio': 'Portfolio (CSV)',
|
||||||
|
'export.noApps': 'No apps yet',
|
||||||
|
'export.declarations': 'Store declarations (Markdown)',
|
||||||
|
'export.dataSafety': 'Data safety (Play CSV)',
|
||||||
|
'export.noDataSafety': 'The config has no Data safety answers',
|
||||||
|
'export.analytics': 'Analytics, daily (CSV)',
|
||||||
|
|
||||||
|
'palette.gExport': 'Export',
|
||||||
|
'palette.export': 'Export: {what}',
|
||||||
|
'palette.prices': '{name} · Prices and price sheet',
|
||||||
|
'palette.art': '{name} · Store art gallery',
|
||||||
|
|
||||||
|
'hint.keys': 'Map a store account to this app in App folders, or add the key in Studios & accounts.',
|
||||||
|
'hint.permission': 'The key works but lacks a permission: Studios & accounts > Test shows the fix.',
|
||||||
|
'hint.config': 'Set that value in storebound.config.ts (the Checks tab lists what is missing).',
|
||||||
|
'hint.renders': 'Render the screenshots first: Store art > Render.',
|
||||||
|
'hint.ffmpeg': 'Download ffmpeg on the Dependencies screen (one click, checked by hash).',
|
||||||
|
'hint.chrome': 'Download Chrome for Testing on the Dependencies screen.',
|
||||||
|
'hint.snapshot': 'Take a snapshot first: Growth > Take a snapshot.',
|
||||||
|
'hint.bucket': 'Set play.reportsBucket in the config (Play Console > Download reports > Statistics > Copy Cloud Storage URI).',
|
||||||
|
'hint.analyticsSetup': 'Start the App Store reports once: Growth > Start App Store reports (Admin key); data comes 1-2 days later.',
|
||||||
|
'hint.version': 'Create the version first: Listings > Push App Store version and text.',
|
||||||
|
'hint.fastlane': 'Pick the folder that contains fastlane/ (or ios/fastlane, android/fastlane).',
|
||||||
|
'hint.priceSheet': 'Write the sheet first: Prices > Write store/prices.csv, or pick a CSV.',
|
||||||
|
'hint.pricePoint': 'App Store prices must be one of Apple\'s price points: export with equalized prices to see them.',
|
||||||
|
'hint.network': 'Check the internet connection and try again.',
|
||||||
|
'hint.confirm': 'This step needs your confirmation in the dialog; run it again and press the button.',
|
||||||
|
'hint.git': 'The app folder must be a git repository with history (analytics compare reads git log).',
|
||||||
|
|
||||||
|
'prices.readTitle': 'Prices',
|
||||||
|
'prices.sheetTitle': 'Price sheet',
|
||||||
|
'prices.sheetSub': 'Every product x store x region in one CSV: export it, edit it, compare it, apply it',
|
||||||
|
'prices.exportCsv': 'Export prices CSV',
|
||||||
|
'prices.getSheet': 'Get the sheet',
|
||||||
|
'prices.readFirst': 'Read prices first',
|
||||||
|
'prices.writeProject': 'Write store/prices.csv',
|
||||||
|
'prices.writeHint': 'Writes the current prices into the app folder for `storebound prices import` (dry run first)',
|
||||||
|
'prices.compareHead': 'Compare and apply',
|
||||||
|
'prices.pickSheet': 'Compare a sheet…',
|
||||||
|
'prices.pickFailed': 'Could not open the sheet',
|
||||||
|
'prices.compareProject': 'Compare store/prices.csv',
|
||||||
|
'prices.showSheet': 'Show the sheet in the folder',
|
||||||
|
'prices.noSheetYet': 'No price sheet yet',
|
||||||
|
'prices.sheetNote': 'Reading changes nothing. Applying a sheet is your decision: storebound shows the dry run in a system dialog and writes only after you press its button. An App Store price increase cannot be undone once it starts.',
|
||||||
|
'prices.compareTitle': 'Compare the price sheet',
|
||||||
|
'prices.diffTitle': 'Sheet {file} against the stores',
|
||||||
|
'prices.diffSub': 'What would change on each store',
|
||||||
|
'prices.compareAgain': 'Compare again',
|
||||||
|
'prices.apply': 'Apply {count} changes',
|
||||||
|
'prices.apply_one': 'Apply 1 change',
|
||||||
|
'prices.applied': 'Prices written',
|
||||||
|
'prices.applyNote': 'Owner action: the stores apply new prices within hours, users see them then. Play regions without a price get Play\'s conversion of the US price.',
|
||||||
|
'prices.upToDate': 'Prices match the sheet',
|
||||||
|
'prices.upToDateText': 'Nothing to apply. Edit the sheet, then compare again.',
|
||||||
|
'prices.dChanged': '{count} changed',
|
||||||
|
'prices.dNew': '{count} new',
|
||||||
|
'prices.dUp': '{count} up',
|
||||||
|
'prices.dDown': '{count} down',
|
||||||
|
'prices.dProducts': 'Products: {list}',
|
||||||
|
'prices.colStarts': 'Starts',
|
||||||
|
'prices.colNow': 'Now',
|
||||||
|
'prices.colNew': 'New',
|
||||||
|
'prices.colKind': 'Set by',
|
||||||
|
'prices.now': 'now',
|
||||||
|
'prices.new': 'New',
|
||||||
|
'prices.more': '{count} more rows in the sheet',
|
||||||
|
'prices.emptyTitle': 'No in-app products in the config',
|
||||||
|
'prices.emptyText': 'Prices are read for the products of storebound.config.ts. Add them there (store-iap-setup skill), then create them on the stores from the Catalog tab.',
|
||||||
|
'prices.emptyHint': 'in storebound.config.ts',
|
||||||
|
'prices.notReadTitle': 'Prices not read yet',
|
||||||
|
'prices.notReadText': 'One read-only pass over App Store Connect and Google Play lists every product\'s price in every territory. It uses the accounts\' API quota.',
|
||||||
|
'prices.readNow': 'Read prices',
|
||||||
|
'prices.kProducts': 'Products',
|
||||||
|
'prices.kProductsSub': '{count} prices read',
|
||||||
|
'prices.kRegions': 'Territories',
|
||||||
|
'prices.kRegionsAuto': 'App Store equalized prices included',
|
||||||
|
'prices.kRegionsManual': 'App Store manual prices only',
|
||||||
|
'prices.kGaps': 'Price gaps',
|
||||||
|
'prices.kGapsSub': '≥ {pct} % apart in the same currency',
|
||||||
|
'prices.kMissing': 'Not on a store',
|
||||||
|
'prices.kMissingNone': 'Every product is on its stores',
|
||||||
|
'prices.overview': 'Products x key territories',
|
||||||
|
'prices.withAuto': 'App Store equalized prices',
|
||||||
|
'prices.auto': 'Equalized',
|
||||||
|
'prices.manual': 'Manual',
|
||||||
|
'prices.autoLegend': 'grey: App Store equalized from the base territory',
|
||||||
|
'prices.gapLegend': 'Δ: gap between the stores ≥ {pct} %',
|
||||||
|
'prices.perRegion': '{product} in every territory',
|
||||||
|
'prices.perRegionSub': '{count} territories',
|
||||||
|
'prices.searchRegion': 'Territory or currency',
|
||||||
|
'prices.otherCurrency': 'other currency',
|
||||||
|
'prices.scheduled': 'from {date}: {price}',
|
||||||
|
'prices.missingNote': 'Not on the store yet: {list}. Create them from the Catalog tab, then read again.',
|
||||||
|
'cat.openPrices': 'Open prices',
|
||||||
|
'cat.pricesHere': 'Prices per territory, the price sheet and applying it are on the Prices tab.',
|
||||||
|
|
||||||
|
'art.title': 'Store art',
|
||||||
|
'art.images': 'Images',
|
||||||
|
'art.imagesSub': '{count} languages',
|
||||||
|
'art.imagesSub_one': '1 language',
|
||||||
|
'art.videos': 'App previews',
|
||||||
|
'art.videosSub': 'App Store and promo videos',
|
||||||
|
'art.errors': 'Store errors',
|
||||||
|
'art.errorsSub': 'Size, alpha, format, count',
|
||||||
|
'art.warnings': 'Warnings',
|
||||||
|
'art.rendered': 'Scanned {when}',
|
||||||
|
'art.variant': 'Variant',
|
||||||
|
'art.base': 'Base',
|
||||||
|
'art.onlyIssues': 'Only issues',
|
||||||
|
'art.openFolder': 'Open folder',
|
||||||
|
'art.openPage': 'Open review page',
|
||||||
|
'art.openPageHint': 'Opens the gallery page (index.html) in your browser',
|
||||||
|
'art.writePage': 'Write review page',
|
||||||
|
'art.render': 'Render {lang}',
|
||||||
|
'art.notThere': 'Not there yet',
|
||||||
|
'art.count': '{count} files',
|
||||||
|
'art.count_one': '1 file',
|
||||||
|
'art.open': 'Open {name}',
|
||||||
|
'art.tooBig': 'too big to preview',
|
||||||
|
'art.prev': 'Previous',
|
||||||
|
'art.next': 'Next',
|
||||||
|
'art.emptyTitle': 'No renders yet',
|
||||||
|
'art.emptyText': 'Render the store screenshots from the frames and the copy file: press Render. It runs locally (ffmpeg and Chrome) and uploads nothing.',
|
||||||
|
'art.noIssues': 'No issues here',
|
||||||
|
'art.noIssuesText': 'Every file of this language passes the local store checks.',
|
||||||
|
'art.foot': 'Local files only, read {when}. Uploading is on the Listings tab.',
|
||||||
|
|
||||||
|
'gr.analytics': 'Store analytics',
|
||||||
|
'gr.analyticsSub': '{count} snapshots since {since}',
|
||||||
|
'gr.analyticsSubNone': 'Snapshots in .storebound/analytics, next to the listing changes in git',
|
||||||
|
'gr.setup': 'Start App Store reports',
|
||||||
|
'gr.setupDone': 'Report request created',
|
||||||
|
'gr.setupHint': 'Creates the ongoing App Store analytics report request once (Admin key). Changes nothing public.',
|
||||||
|
'gr.snapshot': 'Take a snapshot',
|
||||||
|
'gr.snapshotDone': 'Snapshot saved',
|
||||||
|
'gr.snapshotHint': 'Reads impressions, page views, downloads (App Store) and visitors, installs (Play) into .storebound/analytics',
|
||||||
|
'gr.noneTitle': 'No analytics snapshots yet',
|
||||||
|
'gr.noneText': 'A snapshot keeps 28 days of store traffic in the app folder (.storebound/analytics). With a few of them, this tab shows each listing change from git next to the conversion before and after it.',
|
||||||
|
'gr.noBucket': 'For Google Play, set play.reportsBucket in the config first.',
|
||||||
|
'gr.impressions': 'Impressions',
|
||||||
|
'gr.downloads': 'Downloads',
|
||||||
|
'gr.visitors': 'Listing visitors',
|
||||||
|
'gr.acquisitions': 'Acquisitions',
|
||||||
|
'gr.conversion': 'Conversion',
|
||||||
|
'gr.conversionSub': 'Installs per reach, whole window',
|
||||||
|
'gr.days': '{count} days',
|
||||||
|
'gr.days_one': '1 day',
|
||||||
|
'gr.daysN': '{count} days',
|
||||||
|
'gr.daysN_one': '1 day',
|
||||||
|
'gr.chartAria': 'Daily store traffic on {store} with listing changes',
|
||||||
|
'gr.changes': '{count} listing changes',
|
||||||
|
'gr.changes_one': '1 listing change',
|
||||||
|
'gr.oneDay': 'One day of data so far: the chart starts with the second day.',
|
||||||
|
'gr.change': 'Listing change (git)',
|
||||||
|
'gr.before': 'Before',
|
||||||
|
'gr.after': 'After',
|
||||||
|
'gr.reading': 'A change needs several days on both sides and enough traffic; seasonality, featuring and ads move these numbers too.',
|
||||||
|
'gr.ppo': 'Product Page Optimization',
|
||||||
|
'gr.ppoSub': 'App Store A/B tests of the screenshots',
|
||||||
|
'gr.ppoRead': 'Read tests',
|
||||||
|
'gr.ppoNotRead': 'Tests not read yet',
|
||||||
|
'gr.ppoNotReadText': 'Read-only: the tests, their state, traffic share and treatments. Results per treatment are only in App Store Connect.',
|
||||||
|
'gr.ppoNone': 'No tests yet',
|
||||||
|
'gr.ppoNoneText': 'Create a test from a screenshot variant below, upload its screenshots, then start it.',
|
||||||
|
'gr.ppoNoVariants': 'Add a screenshot variant to shots.variants in the config (store-screenshots skill) and render it; each variant becomes one treatment.',
|
||||||
|
'gr.results': 'Results in App Store Connect',
|
||||||
|
'gr.test': 'Test',
|
||||||
|
'gr.state': 'State',
|
||||||
|
'gr.traffic': 'Traffic',
|
||||||
|
'gr.dates': 'Running',
|
||||||
|
'gr.treatments': 'Treatments',
|
||||||
|
'gr.owner': 'Owner action',
|
||||||
|
'gr.running': 'running',
|
||||||
|
'gr.notStarted': 'not started',
|
||||||
|
'gr.treatment': '{name} ({count} locales)',
|
||||||
|
'gr.treatment_one': '{name} (1 locale)',
|
||||||
|
'gr.startBtn': 'Start',
|
||||||
|
'gr.stopBtn': 'Stop',
|
||||||
|
'gr.start': 'Start the test "{name}"',
|
||||||
|
'gr.stop': 'Stop the test "{name}"',
|
||||||
|
'gr.started': 'Test start requested',
|
||||||
|
'gr.stopped': 'Test stop requested',
|
||||||
|
'gr.create': 'New test',
|
||||||
|
'gr.variant': 'Variant {id}',
|
||||||
|
'gr.createBtn': 'Create test',
|
||||||
|
'gr.createTitle': 'Create a Product Page Optimization test',
|
||||||
|
'gr.created': 'Test created (not started)',
|
||||||
|
'gr.upload': 'Treatment screenshots',
|
||||||
|
'gr.uploadBtn': 'Upload screenshots',
|
||||||
|
'gr.uploadTitle': 'Upload the screenshots of variant {id}',
|
||||||
|
'gr.uploadInto': 'Into the editable test "{name}"',
|
||||||
|
'gr.uploadNoTest': 'Create a test first: uploads go into the editable test.',
|
||||||
|
'gr.ppoNote': 'Create and upload change nothing visitors see. Start and stop are your decision: each shows a system dialog that names the action; a stopped test cannot be restarted.',
|
||||||
|
'gr.ppoStoreOnly': 'Read-only for a store-only app: link an app folder to create and run tests.',
|
||||||
|
'gr.playExp': 'Store listing experiments',
|
||||||
|
'gr.playExpSub': 'Google Play: no API',
|
||||||
|
'gr.playExpText': 'Google Play has no API for store listing experiments: create and run them in Play Console > Grow > Store listing experiments, with the variant screenshots storebound renders.',
|
||||||
|
'gr.seeVariants': 'See the variant renders',
|
||||||
|
|
||||||
|
'ai.askTitle': '{count} questions only you can answer',
|
||||||
|
'ai.askTitle_one': '1 question only you can answer',
|
||||||
|
'ai.askSub': 'The config does not prove these answers. storebound never guesses a compliance answer: decide, then set it in the config.',
|
||||||
|
'ai.allAnswered': 'Every declaration this tab shows comes from the config. The answers are still yours: review them before each submission.',
|
||||||
|
'ai.aDataSafety': 'Data safety',
|
||||||
|
'ai.aAppPrivacy': 'App Privacy',
|
||||||
|
'ai.aAppInfo': 'App info',
|
||||||
|
'ai.aEncryption': 'Export compliance',
|
||||||
|
'ai.aReview': 'App Review',
|
||||||
|
'ai.askedHere': '{count} open questions about this form above',
|
||||||
|
'ai.askedHere_one': '1 open question about this form above',
|
||||||
|
'ai.dsTitle': 'Data safety',
|
||||||
|
'ai.dsSub': 'Google Play, from dataSafety in the config',
|
||||||
|
'ai.dsUpload': 'Upload Data safety',
|
||||||
|
'ai.dsUploadHint': 'Replaces the whole Play Data safety form (dry run and system dialog first)',
|
||||||
|
'ai.dsUploaded': 'Data safety uploaded',
|
||||||
|
'ai.dsNoneTitle': 'No Data safety answers',
|
||||||
|
'ai.dsNoneText': 'Add dataSafety to storebound.config.ts (store-declarations skill): what the app and every SDK collect, why, and whether it is shared.',
|
||||||
|
'ai.dsCollects': 'Collects or shares data',
|
||||||
|
'ai.dsEncrypted': 'Encrypted in transit',
|
||||||
|
'ai.dsDeletion': 'Users can ask for deletion',
|
||||||
|
'ai.dsAccounts': 'Account creation',
|
||||||
|
'ai.dsNever': 'Play cannot read this form back. Once you upload from here, this tab shows what changed since.',
|
||||||
|
'ai.dsSame': 'Same as the last upload ({when}).',
|
||||||
|
'ai.dsChanged': '{count} answers changed since the last upload ({when}): upload again to bring Play up to date.',
|
||||||
|
'ai.dsChanged_one': '1 answer changed since the last upload ({when}): upload again to bring Play up to date.',
|
||||||
|
'ai.show': 'Show',
|
||||||
|
'ai.hide': 'Hide',
|
||||||
|
'ai.colType': 'Data type',
|
||||||
|
'ai.colCollected': 'Collected for',
|
||||||
|
'ai.colShared': 'Shared for',
|
||||||
|
'ai.notShared': 'not shared',
|
||||||
|
'ai.optional': 'optional',
|
||||||
|
'ai.ephemeral': 'ephemeral',
|
||||||
|
'ai.dsFoot': 'The upload sends {rows} CSV rows (Play\'s import format) and replaces every earlier answer.',
|
||||||
|
'ai.apTitle': 'App Privacy',
|
||||||
|
'ai.apSub': 'App Store, suggested from the Data safety answers',
|
||||||
|
'ai.apOpen': 'Open App Privacy',
|
||||||
|
'ai.apNote': 'App Privacy has no API: enter these answers in App Store Connect > App Privacy. Apple also asks per type whether it is linked to the user and used for tracking.',
|
||||||
|
'ai.apNoneTitle': 'No data collected',
|
||||||
|
'ai.apNoneText': 'The Data safety answers list no data types: in App Store Connect answer "Data Not Collected", if that is true for every SDK.',
|
||||||
|
'ai.apUnknownTitle': 'Nothing to suggest yet',
|
||||||
|
'ai.apUnknownText': 'Answer the data collection once in dataSafety; the App Privacy answers follow from it.',
|
||||||
|
'ai.colAppleType': 'Data type',
|
||||||
|
'ai.colPurposes': 'Purposes',
|
||||||
|
'ai.colLinked': 'Linked to user',
|
||||||
|
'ai.colTracking': 'Tracking',
|
||||||
|
'ai.ask': 'Your answer',
|
||||||
|
'ai.askLikely': 'Check: shared',
|
||||||
|
'ai.noPlay': 'Not on Google Play',
|
||||||
|
'ai.noPlayText': 'The config has no play section.',
|
||||||
|
'ai.noApple': 'Not on the App Store',
|
||||||
|
'ai.noAppleText': 'The config has no apple section.',
|
||||||
|
'ai.infoTitle': 'App info',
|
||||||
|
'ai.infoSub': 'Categories, age rating, content rights',
|
||||||
|
'ai.infoPush': 'Push the App Store app info',
|
||||||
|
'ai.push': 'Push',
|
||||||
|
'ai.pushed': 'Pushed to App Store Connect',
|
||||||
|
'ai.category': 'Category',
|
||||||
|
'ai.age': 'Age rating',
|
||||||
|
'ai.ageAllNone': 'Every question "none": confirm',
|
||||||
|
'ai.rights': 'Content rights',
|
||||||
|
'ai.rightsOwn': 'No third-party content',
|
||||||
|
'ai.rightsThird': 'Third-party content, rights held',
|
||||||
|
'ai.price': 'Price',
|
||||||
|
'ai.free': 'Free, every territory',
|
||||||
|
'ai.paid': 'Paid (set in App Store Connect)',
|
||||||
|
'ai.notSet': 'Not set',
|
||||||
|
'ai.notAnswered': 'Not answered',
|
||||||
|
'ai.encTitle': 'Export compliance',
|
||||||
|
'ai.encSub': 'Encryption answer for every build',
|
||||||
|
'ai.encAnswer': 'Answer builds',
|
||||||
|
'ai.encPush': 'Answer export compliance for the builds',
|
||||||
|
'ai.encYes': 'Uses non-exempt encryption',
|
||||||
|
'ai.encNo': 'Only exempt encryption',
|
||||||
|
'ai.encYesText': 'Builds are linked to the approved encryption declaration in App Store Connect.',
|
||||||
|
'ai.encNoText': 'Builds without an answer get usesNonExemptEncryption = false. Better: ITSAppUsesNonExemptEncryption = NO in Info.plist.',
|
||||||
|
'ai.encUnset': 'apple.usesNonExemptEncryption is not set. Decide it with the export-compliance skill; storebound never guesses it.',
|
||||||
|
'ai.encUnsetHint': 'Answer apple.usesNonExemptEncryption in the config first',
|
||||||
|
'ai.reviewTitle': 'App Review details',
|
||||||
|
'ai.reviewSub': 'Contact, demo account, notes',
|
||||||
|
'ai.reviewPush': 'Push the App Review details',
|
||||||
|
'ai.signIn': 'Sign-in needed',
|
||||||
|
'ai.contact': 'Contact',
|
||||||
|
'ai.demo': 'Demo account',
|
||||||
|
'ai.demoNone': 'none needed',
|
||||||
|
'ai.missing': 'Missing',
|
||||||
|
'ai.notes': 'Notes for the reviewer',
|
||||||
|
'ai.notesBytes': '{n} / {max} bytes',
|
||||||
|
'ai.notesNone': 'No notes (apple.info.reviewNotes, reviewAccess.instructions).',
|
||||||
|
'ai.reviewSafe': 'Contact and demo account stay in the app folder\'s .storebound/ (gitignored); shown masked, never the password.',
|
||||||
|
'ai.foot': 'From the config and .storebound/, read {when}. Nothing here was sent anywhere.',
|
||||||
|
'ds.functionality': 'App functionality',
|
||||||
|
'ds.analytics': 'Analytics',
|
||||||
|
'ds.communications': 'Developer communications',
|
||||||
|
'ds.fraud': 'Fraud prevention, security',
|
||||||
|
'ds.advertising': 'Advertising or marketing',
|
||||||
|
'ds.personalization': 'Personalization',
|
||||||
|
'ds.account': 'Account management',
|
||||||
|
|
||||||
|
'folders.fastlane': 'Import from fastlane',
|
||||||
|
'folders.fastlaneHint': 'Pick a folder with a fastlane setup: storebound shows the import plan in a system dialog, then writes its files next to fastlane (never overwrites)',
|
||||||
|
'folders.imported': '{name} imported from fastlane',
|
||||||
|
'folders.importedDetail': 'Config, listing files and screenshot frames written. Next: replace the placeholders, then Checks.',
|
||||||
|
'folders.startShort': 'Start an app folder',
|
||||||
|
'folders.newNote': 'Both ask for a folder in a system dialog, show what they would write, and write only after you press Apply. Existing files are kept.',
|
||||||
|
'folders.open': 'Open',
|
||||||
|
'folders.openApp': 'Open this app',
|
||||||
|
'folders.reveal': 'Show in the file manager',
|
||||||
|
|
||||||
|
'wz.s0': 'Your studio',
|
||||||
|
'wz.studioTitle': 'Which studio are these apps from?',
|
||||||
|
'wz.studioLead': 'A studio groups store accounts and their apps (a company, a client, a side project). Pick one or create it; the keys of the next steps go into it. You can move things later.',
|
||||||
|
'wz.studioPick': 'Studio',
|
||||||
|
'wz.studioAccounts': '{count} store accounts',
|
||||||
|
'wz.studioAccounts_one': '1 store account',
|
||||||
|
'wz.studioPicked': 'Selected',
|
||||||
|
'wz.studioNoneHint': 'Keep accounts without a studio',
|
||||||
|
'wz.studioNew': 'Create your studio',
|
||||||
|
'wz.studioAnother': 'Or create another studio',
|
||||||
|
'wz.studioNewText': 'A name and a colour; a logo can come later in Studios & accounts.',
|
||||||
|
'wz.studioPlaceholder': 'For example: Example Games',
|
||||||
|
'wz.studioCreate': 'Create studio',
|
||||||
|
'wz.fastlaneTitle': 'Import from fastlane',
|
||||||
|
'wz.fastlaneText': 'The folder has a fastlane setup (deliver, supply). storebound turns it into its config and listing files and leaves fastlane untouched.',
|
||||||
|
'wz.fastlaneGo': 'Choose the folder and import',
|
||||||
|
'wz.fastlaneNote': 'You see the import plan and what it does not map before anything is written.',
|
||||||
|
'wz.keysInto': 'New keys go into {name}.',
|
||||||
|
'wz.keysNoStudio': 'New keys stay without a studio.',
|
||||||
|
'wz.change': 'Change',
|
||||||
} as const;
|
} as const;
|
||||||
|
|
|
||||||
|
|
@ -529,7 +529,7 @@ export const tr: Record<keyof typeof en, string> = {
|
||||||
'wz.footer': 'Bu rehberi Ayarlar\'dan veya komut paletinden yeniden açabilirsiniz.',
|
'wz.footer': 'Bu rehberi Ayarlar\'dan veya komut paletinden yeniden açabilirsiniz.',
|
||||||
'wz.footerSafe': 'Buradan hiçbir şey gönderilmez veya yayınlanmaz.',
|
'wz.footerSafe': 'Buradan hiçbir şey gönderilmez veya yayınlanmaz.',
|
||||||
'wz.welcomeTitle': 'Her uygulama, iki mağaza, tek pencere',
|
'wz.welcomeTitle': 'Her uygulama, iki mağaza, tek pencere',
|
||||||
'wz.welcomeLead': 'storebound desktop her uygulamanızın App Store ve Google Play\'deki durumunu gösterir ve storebound CLI\'yi sizin için çalıştırır. Beş kısa adımda hazır.',
|
'wz.welcomeLead': 'storebound desktop her uygulamanızın App Store ve Google Play\'deki durumunu gösterir ve storebound CLI\'yi sizin için çalıştırır. Altı kısa adımda hazır.',
|
||||||
'wz.p1t': 'Tek portföy',
|
'wz.p1t': 'Tek portföy',
|
||||||
'wz.p1s': 'Her uygulamanın sürümleri, dağıtımları, katalog eşleşmesi, sağlığı ve yorumları.',
|
'wz.p1s': 'Her uygulamanın sürümleri, dağıtımları, katalog eşleşmesi, sağlığı ve yorumları.',
|
||||||
'wz.p2t': 'Tasarımı gereği güvenli',
|
'wz.p2t': 'Tasarımı gereği güvenli',
|
||||||
|
|
@ -554,7 +554,7 @@ export const tr: Record<keyof typeof en, string> = {
|
||||||
'wz.readLead': 'App Store Connect ve Google Play üzerinde salt okunur bir tur portföyü doldurur: sürümler, inceleme durumu, dağıtımlar ve katalog eşleşmesi.',
|
'wz.readLead': 'App Store Connect ve Google Play üzerinde salt okunur bir tur portföyü doldurur: sürümler, inceleme durumu, dağıtımlar ve katalog eşleşmesi.',
|
||||||
'wz.readNow': 'Mağazaları şimdi oku',
|
'wz.readNow': 'Mağazaları şimdi oku',
|
||||||
'wz.readDone': '{count} uygulama {when} okundu',
|
'wz.readDone': '{count} uygulama {when} okundu',
|
||||||
'wz.needApp': 'Önce bir uygulama klasörü ekleyin (2. adım).',
|
'wz.needApp': 'Önce bir uygulama klasörü ekleyin (3. adım).',
|
||||||
'wz.skip': 'Şimdilik geç',
|
'wz.skip': 'Şimdilik geç',
|
||||||
'wz.back': 'Geri',
|
'wz.back': 'Geri',
|
||||||
'wz.next': 'İleri',
|
'wz.next': 'İleri',
|
||||||
|
|
@ -873,5 +873,355 @@ export const tr: Record<keyof typeof en, string> = {
|
||||||
'reviews.tooLong': 'Mağazanın izin verdiğinden uzun ({limit} karakter)',
|
'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.',
|
'reviews.sendNoteD3': 'Yanıtlar herkese açıktır. Kaydet, onayla, sonra Gönder: her adım önce bir sistem penceresi gösterir.',
|
||||||
|
|
||||||
|
// ---- her CLI alanı pencerede: fiyatlar, mağaza görselleri, büyüme, uygulama bilgisi, dışa aktarma, başlangıç ----
|
||||||
|
'tab.prices': 'Fiyatlar',
|
||||||
|
'tab.art': 'Mağaza görselleri',
|
||||||
|
'tab.growth': 'Büyüme',
|
||||||
|
'tab.appinfo': 'Uygulama bilgisi',
|
||||||
|
'col.date': 'Tarih',
|
||||||
|
'common.yes': 'Evet',
|
||||||
|
'common.no': 'Hayır',
|
||||||
|
|
||||||
|
'export.button': 'Dışa aktar',
|
||||||
|
'export.hint': 'Bu ekranın gösterdiğini dosya olarak kaydet (CSV veya Markdown)',
|
||||||
|
'export.saved': 'Kaydedildi',
|
||||||
|
'export.failed': 'Dışa aktarma başarısız',
|
||||||
|
'export.readFirst': 'Önce okuyun',
|
||||||
|
'export.personal': 'kişisel veri',
|
||||||
|
'export.prices': 'Fiyatlar (CSV, fiyat tablosu biçimi)',
|
||||||
|
'export.reviews': 'Yorumlar (CSV)',
|
||||||
|
'export.health': 'Sağlık raporu (Markdown)',
|
||||||
|
'export.validate': 'Mağaza hazırlık raporu (Markdown)',
|
||||||
|
'export.catalog': 'Katalog eşleşmesi (Markdown)',
|
||||||
|
'export.listings': 'Mağaza metinleri (Markdown)',
|
||||||
|
'export.noListings': 'Bu uygulama klasöründe mağaza metni dosyası yok',
|
||||||
|
'export.portfolio': 'Portföy (CSV)',
|
||||||
|
'export.noApps': 'Henüz uygulama yok',
|
||||||
|
'export.declarations': 'Mağaza beyanları (Markdown)',
|
||||||
|
'export.dataSafety': 'Veri güvenliği (Play CSV)',
|
||||||
|
'export.noDataSafety': 'Ayarda Veri güvenliği yanıtı yok',
|
||||||
|
'export.analytics': 'Analiz, günlük (CSV)',
|
||||||
|
|
||||||
|
'palette.gExport': 'Dışa aktar',
|
||||||
|
'palette.export': 'Dışa aktar: {what}',
|
||||||
|
'palette.prices': '{name} · Fiyatlar ve fiyat tablosu',
|
||||||
|
'palette.art': '{name} · Mağaza görselleri galerisi',
|
||||||
|
|
||||||
|
'hint.keys': 'Uygulama klasörlerinde bu uygulamaya bir mağaza hesabı atayın veya anahtarı Stüdyolar ve hesaplar\'dan ekleyin.',
|
||||||
|
'hint.permission': 'Anahtar çalışıyor ama bir izin eksik: Stüdyolar ve hesaplar > Sına çözümü gösterir.',
|
||||||
|
'hint.config': 'Bu değeri storebound.config.ts içinde ayarlayın (Kontroller sekmesi eksikleri listeler).',
|
||||||
|
'hint.renders': 'Önce ekran görüntülerini oluşturun: Mağaza görselleri > Oluştur.',
|
||||||
|
'hint.ffmpeg': 'ffmpeg\'i Bağımlılıklar ekranından indirin (tek tık, özetle doğrulanır).',
|
||||||
|
'hint.chrome': 'Chrome for Testing\'i Bağımlılıklar ekranından indirin.',
|
||||||
|
'hint.snapshot': 'Önce bir anlık görüntü alın: Büyüme > Anlık görüntü al.',
|
||||||
|
'hint.bucket': 'Ayarda play.reportsBucket değerini girin (Play Console > Raporları indir > İstatistikler > Cloud Storage URI\'sini kopyala).',
|
||||||
|
'hint.analyticsSetup': 'App Store raporlarını bir kez başlatın: Büyüme > App Store raporlarını başlat (Admin anahtarı); veriler 1-2 gün sonra gelir.',
|
||||||
|
'hint.version': 'Önce sürümü oluşturun: Mağaza metinleri > App Store sürümünü ve metni gönder.',
|
||||||
|
'hint.fastlane': 'İçinde fastlane/ (veya ios/fastlane, android/fastlane) olan klasörü seçin.',
|
||||||
|
'hint.priceSheet': 'Önce tabloyu yazın: Fiyatlar > store/prices.csv yaz, ya da bir CSV seçin.',
|
||||||
|
'hint.pricePoint': 'App Store fiyatları Apple\'ın fiyat noktalarından biri olmalı: eşitlenmiş fiyatlarla dışa aktarıp görün.',
|
||||||
|
'hint.network': 'İnternet bağlantısını kontrol edip yeniden deneyin.',
|
||||||
|
'hint.confirm': 'Bu adım pencerede onayınızı ister; yeniden çalıştırıp düğmeye basın.',
|
||||||
|
'hint.git': 'Uygulama klasörü geçmişi olan bir git deposu olmalı (analiz karşılaştırması git log okur).',
|
||||||
|
|
||||||
|
'prices.readTitle': 'Fiyatlar',
|
||||||
|
'prices.sheetTitle': 'Fiyat tablosu',
|
||||||
|
'prices.sheetSub': 'Her ürün x mağaza x bölge tek bir CSV\'de: dışa aktarın, düzenleyin, karşılaştırın, uygulayın',
|
||||||
|
'prices.exportCsv': 'Fiyatları CSV olarak aktar',
|
||||||
|
'prices.getSheet': 'Tabloyu alın',
|
||||||
|
'prices.readFirst': 'Önce fiyatları oku',
|
||||||
|
'prices.writeProject': 'store/prices.csv yaz',
|
||||||
|
'prices.writeHint': 'Güncel fiyatları `storebound prices import` için uygulama klasörüne yazar (önce deneme)',
|
||||||
|
'prices.compareHead': 'Karşılaştır ve uygula',
|
||||||
|
'prices.pickSheet': 'Bir tablo karşılaştır…',
|
||||||
|
'prices.pickFailed': 'Tablo açılamadı',
|
||||||
|
'prices.compareProject': 'store/prices.csv karşılaştır',
|
||||||
|
'prices.showSheet': 'Tabloyu klasörde göster',
|
||||||
|
'prices.noSheetYet': 'Henüz fiyat tablosu yok',
|
||||||
|
'prices.sheetNote': 'Okumak hiçbir şeyi değiştirmez. Bir tabloyu uygulamak sizin kararınızdır: storebound denemeyi bir sistem penceresinde gösterir ve yalnızca düğmesine bastığınızda yazar. App Store\'da başlayan bir fiyat artışı geri alınamaz.',
|
||||||
|
'prices.compareTitle': 'Fiyat tablosunu karşılaştır',
|
||||||
|
'prices.diffTitle': '{file} tablosu mağazalara karşı',
|
||||||
|
'prices.diffSub': 'Her mağazada neyin değişeceği',
|
||||||
|
'prices.compareAgain': 'Yeniden karşılaştır',
|
||||||
|
'prices.apply': '{count} değişikliği uygula',
|
||||||
|
'prices.apply_one': '1 değişikliği uygula',
|
||||||
|
'prices.applied': 'Fiyatlar yazıldı',
|
||||||
|
'prices.applyNote': 'Sahip işlemi: mağazalar yeni fiyatları saatler içinde uygular, kullanıcılar o zaman görür. Fiyatı olmayan Play bölgeleri ABD fiyatının Play dönüşümünü alır.',
|
||||||
|
'prices.upToDate': 'Fiyatlar tabloyla aynı',
|
||||||
|
'prices.upToDateText': 'Uygulanacak bir şey yok. Tabloyu düzenleyip yeniden karşılaştırın.',
|
||||||
|
'prices.dChanged': '{count} değişti',
|
||||||
|
'prices.dNew': '{count} yeni',
|
||||||
|
'prices.dUp': '{count} arttı',
|
||||||
|
'prices.dDown': '{count} düştü',
|
||||||
|
'prices.dProducts': 'Ürünler: {list}',
|
||||||
|
'prices.colStarts': 'Başlangıç',
|
||||||
|
'prices.colNow': 'Şimdi',
|
||||||
|
'prices.colNew': 'Yeni',
|
||||||
|
'prices.colKind': 'Belirleyen',
|
||||||
|
'prices.now': 'şimdi',
|
||||||
|
'prices.new': 'Yeni',
|
||||||
|
'prices.more': 'Tabloda {count} satır daha',
|
||||||
|
'prices.emptyTitle': 'Ayarda uygulama içi ürün yok',
|
||||||
|
'prices.emptyText': 'Fiyatlar storebound.config.ts içindeki ürünler için okunur. Ürünleri oraya ekleyin (store-iap-setup becerisi), sonra Katalog sekmesinden mağazalarda oluşturun.',
|
||||||
|
'prices.emptyHint': 'storebound.config.ts içinde',
|
||||||
|
'prices.notReadTitle': 'Fiyatlar henüz okunmadı',
|
||||||
|
'prices.notReadText': 'App Store Connect ve Google Play üzerinde salt okunur bir tur, her ürünün her bölgedeki fiyatını listeler. Hesapların API kotasını kullanır.',
|
||||||
|
'prices.readNow': 'Fiyatları oku',
|
||||||
|
'prices.kProducts': 'Ürünler',
|
||||||
|
'prices.kProductsSub': '{count} fiyat okundu',
|
||||||
|
'prices.kRegions': 'Bölgeler',
|
||||||
|
'prices.kRegionsAuto': 'App Store eşitlenmiş fiyatlar dahil',
|
||||||
|
'prices.kRegionsManual': 'Yalnızca App Store elle girilen fiyatlar',
|
||||||
|
'prices.kGaps': 'Fiyat farkları',
|
||||||
|
'prices.kGapsSub': 'Aynı para biriminde ≥ %{pct} fark',
|
||||||
|
'prices.kMissing': 'Mağazada değil',
|
||||||
|
'prices.kMissingNone': 'Her ürün kendi mağazalarında',
|
||||||
|
'prices.overview': 'Ürünler x ana bölgeler',
|
||||||
|
'prices.withAuto': 'App Store eşitlenmiş fiyatları',
|
||||||
|
'prices.auto': 'Eşitlenmiş',
|
||||||
|
'prices.manual': 'Elle',
|
||||||
|
'prices.autoLegend': 'gri: temel bölgeden eşitlenen App Store fiyatı',
|
||||||
|
'prices.gapLegend': 'Δ: mağazalar arasında ≥ %{pct} fark',
|
||||||
|
'prices.perRegion': '{product} her bölgede',
|
||||||
|
'prices.perRegionSub': '{count} bölge',
|
||||||
|
'prices.searchRegion': 'Bölge veya para birimi',
|
||||||
|
'prices.otherCurrency': 'farklı para birimi',
|
||||||
|
'prices.scheduled': '{date} itibarıyla: {price}',
|
||||||
|
'prices.missingNote': 'Henüz mağazada değil: {list}. Katalog sekmesinden oluşturup yeniden okuyun.',
|
||||||
|
'cat.openPrices': 'Fiyatları aç',
|
||||||
|
'cat.pricesHere': 'Bölge bazında fiyatlar, fiyat tablosu ve uygulanması Fiyatlar sekmesinde.',
|
||||||
|
|
||||||
|
'art.title': 'Mağaza görselleri',
|
||||||
|
'art.images': 'Görseller',
|
||||||
|
'art.imagesSub': '{count} dil',
|
||||||
|
'art.imagesSub_one': '1 dil',
|
||||||
|
'art.videos': 'Uygulama önizlemeleri',
|
||||||
|
'art.videosSub': 'App Store ve tanıtım videoları',
|
||||||
|
'art.errors': 'Mağaza hataları',
|
||||||
|
'art.errorsSub': 'Boyut, alfa, biçim, adet',
|
||||||
|
'art.warnings': 'Uyarılar',
|
||||||
|
'art.rendered': '{when} tarandı',
|
||||||
|
'art.variant': 'Varyant',
|
||||||
|
'art.base': 'Temel',
|
||||||
|
'art.onlyIssues': 'Yalnızca sorunlar',
|
||||||
|
'art.openFolder': 'Klasörü aç',
|
||||||
|
'art.openPage': 'İnceleme sayfasını aç',
|
||||||
|
'art.openPageHint': 'Galeri sayfasını (index.html) tarayıcınızda açar',
|
||||||
|
'art.writePage': 'İnceleme sayfasını yaz',
|
||||||
|
'art.render': '{lang} oluştur',
|
||||||
|
'art.notThere': 'Henüz yok',
|
||||||
|
'art.count': '{count} dosya',
|
||||||
|
'art.count_one': '1 dosya',
|
||||||
|
'art.open': '{name} aç',
|
||||||
|
'art.tooBig': 'önizleme için çok büyük',
|
||||||
|
'art.prev': 'Önceki',
|
||||||
|
'art.next': 'Sonraki',
|
||||||
|
'art.emptyTitle': 'Henüz görsel yok',
|
||||||
|
'art.emptyText': 'Mağaza ekran görüntülerini karelerden ve metin dosyasından oluşturun: Oluştur\'a basın. Yerelde çalışır (ffmpeg ve Chrome) ve hiçbir şey yüklemez.',
|
||||||
|
'art.noIssues': 'Burada sorun yok',
|
||||||
|
'art.noIssuesText': 'Bu dilin her dosyası yerel mağaza kontrollerinden geçiyor.',
|
||||||
|
'art.foot': 'Yalnızca yerel dosyalar, {when} okundu. Yükleme Mağaza metinleri sekmesinde.',
|
||||||
|
|
||||||
|
'gr.analytics': 'Mağaza analizleri',
|
||||||
|
'gr.analyticsSub': '{since} tarihinden beri {count} anlık görüntü',
|
||||||
|
'gr.analyticsSubNone': '.storebound/analytics içindeki anlık görüntüler, git\'teki mağaza metni değişikliklerinin yanında',
|
||||||
|
'gr.setup': 'App Store raporlarını başlat',
|
||||||
|
'gr.setupDone': 'Rapor isteği oluşturuldu',
|
||||||
|
'gr.setupHint': 'Sürekli App Store analiz raporu isteğini bir kez oluşturur (Admin anahtarı). Herkese açık hiçbir şeyi değiştirmez.',
|
||||||
|
'gr.snapshot': 'Anlık görüntü al',
|
||||||
|
'gr.snapshotDone': 'Anlık görüntü kaydedildi',
|
||||||
|
'gr.snapshotHint': 'Gösterim, sayfa görüntüleme, indirme (App Store) ve ziyaretçi, yükleme (Play) verilerini .storebound/analytics içine okur',
|
||||||
|
'gr.noneTitle': 'Henüz analiz anlık görüntüsü yok',
|
||||||
|
'gr.noneText': 'Bir anlık görüntü 28 günlük mağaza trafiğini uygulama klasöründe tutar (.storebound/analytics). Birkaç tane olunca bu sekme git\'teki her mağaza metni değişikliğini öncesi ve sonrası dönüşümle yan yana gösterir.',
|
||||||
|
'gr.noBucket': 'Google Play için önce ayarda play.reportsBucket değerini girin.',
|
||||||
|
'gr.impressions': 'Gösterimler',
|
||||||
|
'gr.downloads': 'İndirmeler',
|
||||||
|
'gr.visitors': 'Sayfa ziyaretçileri',
|
||||||
|
'gr.acquisitions': 'Edinimler',
|
||||||
|
'gr.conversion': 'Dönüşüm',
|
||||||
|
'gr.conversionSub': 'Erişim başına yükleme, tüm aralık',
|
||||||
|
'gr.days': '{count} gün',
|
||||||
|
'gr.days_one': '1 gün',
|
||||||
|
'gr.daysN': '{count} gün',
|
||||||
|
'gr.daysN_one': '1 gün',
|
||||||
|
'gr.chartAria': '{store} üzerinde günlük mağaza trafiği ve mağaza metni değişiklikleri',
|
||||||
|
'gr.changes': '{count} mağaza metni değişikliği',
|
||||||
|
'gr.changes_one': '1 mağaza metni değişikliği',
|
||||||
|
'gr.oneDay': 'Şimdilik bir günlük veri var: grafik ikinci günle başlar.',
|
||||||
|
'gr.change': 'Mağaza değişikliği (git)',
|
||||||
|
'gr.before': 'Önce',
|
||||||
|
'gr.after': 'Sonra',
|
||||||
|
'gr.reading': 'Bir değişiklik iki tarafta da birkaç gün ve yeterli trafik ister; mevsim, öne çıkarılma ve reklamlar da bu sayıları oynatır.',
|
||||||
|
'gr.ppo': 'Ürün Sayfası Optimizasyonu',
|
||||||
|
'gr.ppoSub': 'Ekran görüntülerinin App Store A/B testleri',
|
||||||
|
'gr.ppoRead': 'Testleri oku',
|
||||||
|
'gr.ppoNotRead': 'Testler henüz okunmadı',
|
||||||
|
'gr.ppoNotReadText': 'Salt okunur: testler, durumları, trafik payı ve varyantları. Varyant sonuçları yalnızca App Store Connect\'te.',
|
||||||
|
'gr.ppoNone': 'Henüz test yok',
|
||||||
|
'gr.ppoNoneText': 'Aşağıdan bir ekran görüntüsü varyantıyla test oluşturun, ekran görüntülerini yükleyin, sonra başlatın.',
|
||||||
|
'gr.ppoNoVariants': 'Ayardaki shots.variants içine bir ekran görüntüsü varyantı ekleyip oluşturun (store-screenshots becerisi); her varyant bir deneme kolu olur.',
|
||||||
|
'gr.results': 'Sonuçlar App Store Connect\'te',
|
||||||
|
'gr.test': 'Test',
|
||||||
|
'gr.state': 'Durum',
|
||||||
|
'gr.traffic': 'Trafik',
|
||||||
|
'gr.dates': 'Süre',
|
||||||
|
'gr.treatments': 'Varyantlar',
|
||||||
|
'gr.owner': 'Sahip işlemi',
|
||||||
|
'gr.running': 'sürüyor',
|
||||||
|
'gr.notStarted': 'başlamadı',
|
||||||
|
'gr.treatment': '{name} ({count} yerel ayar)',
|
||||||
|
'gr.treatment_one': '{name} (1 yerel ayar)',
|
||||||
|
'gr.startBtn': 'Başlat',
|
||||||
|
'gr.stopBtn': 'Durdur',
|
||||||
|
'gr.start': '"{name}" testini başlat',
|
||||||
|
'gr.stop': '"{name}" testini durdur',
|
||||||
|
'gr.started': 'Testin başlatılması istendi',
|
||||||
|
'gr.stopped': 'Testin durdurulması istendi',
|
||||||
|
'gr.create': 'Yeni test',
|
||||||
|
'gr.variant': '{id} varyantı',
|
||||||
|
'gr.createBtn': 'Test oluştur',
|
||||||
|
'gr.createTitle': 'Ürün Sayfası Optimizasyonu testi oluştur',
|
||||||
|
'gr.created': 'Test oluşturuldu (başlamadı)',
|
||||||
|
'gr.upload': 'Varyant ekran görüntüleri',
|
||||||
|
'gr.uploadBtn': 'Ekran görüntülerini yükle',
|
||||||
|
'gr.uploadTitle': '{id} varyantının ekran görüntülerini yükle',
|
||||||
|
'gr.uploadInto': 'Düzenlenebilir "{name}" testine',
|
||||||
|
'gr.uploadNoTest': 'Önce bir test oluşturun: yüklemeler düzenlenebilir teste gider.',
|
||||||
|
'gr.ppoNote': 'Oluşturmak ve yüklemek ziyaretçilerin gördüğü hiçbir şeyi değiştirmez. Başlatmak ve durdurmak sizin kararınızdır: her biri işlemin adını veren bir sistem penceresi gösterir; durdurulan test yeniden başlatılamaz.',
|
||||||
|
'gr.ppoStoreOnly': 'Yalnızca mağazadaki uygulamada salt okunur: test oluşturup yürütmek için bir uygulama klasörü bağlayın.',
|
||||||
|
'gr.playExp': 'Mağaza girişi deneyleri',
|
||||||
|
'gr.playExpSub': 'Google Play: API yok',
|
||||||
|
'gr.playExpText': 'Google Play\'in mağaza girişi deneyleri için API\'si yok: bunları storebound\'un oluşturduğu varyant ekran görüntüleriyle Play Console > Büyüme > Mağaza girişi deneyleri bölümünde oluşturup yürütün.',
|
||||||
|
'gr.seeVariants': 'Varyant görsellerini gör',
|
||||||
|
|
||||||
|
'ai.askTitle': 'Yalnızca sizin yanıtlayabileceğiniz {count} soru',
|
||||||
|
'ai.askTitle_one': 'Yalnızca sizin yanıtlayabileceğiniz 1 soru',
|
||||||
|
'ai.askSub': 'Ayar bu yanıtları kanıtlamıyor. storebound bir uyum yanıtını asla tahmin etmez: karar verin, sonra ayara yazın.',
|
||||||
|
'ai.allAnswered': 'Bu sekmedeki her beyan ayardan geliyor. Yanıtlar yine sizin: her gönderimden önce gözden geçirin.',
|
||||||
|
'ai.aDataSafety': 'Veri güvenliği',
|
||||||
|
'ai.aAppPrivacy': 'Uygulama Gizliliği',
|
||||||
|
'ai.aAppInfo': 'Uygulama bilgisi',
|
||||||
|
'ai.aEncryption': 'İhracat uyumu',
|
||||||
|
'ai.aReview': 'App Review',
|
||||||
|
'ai.askedHere': 'Bu form hakkında yukarıda {count} açık soru var',
|
||||||
|
'ai.askedHere_one': 'Bu form hakkında yukarıda 1 açık soru var',
|
||||||
|
'ai.dsTitle': 'Veri güvenliği',
|
||||||
|
'ai.dsSub': 'Google Play, ayardaki dataSafety\'den',
|
||||||
|
'ai.dsUpload': 'Veri güvenliğini yükle',
|
||||||
|
'ai.dsUploadHint': 'Play Veri güvenliği formunun tamamını değiştirir (önce deneme ve sistem penceresi)',
|
||||||
|
'ai.dsUploaded': 'Veri güvenliği yüklendi',
|
||||||
|
'ai.dsNoneTitle': 'Veri güvenliği yanıtı yok',
|
||||||
|
'ai.dsNoneText': 'storebound.config.ts içine dataSafety ekleyin (store-declarations becerisi): uygulama ve her SDK neyi, neden topluyor ve paylaşıyor mu.',
|
||||||
|
'ai.dsCollects': 'Veri topluyor veya paylaşıyor',
|
||||||
|
'ai.dsEncrypted': 'Aktarımda şifreli',
|
||||||
|
'ai.dsDeletion': 'Kullanıcılar silme isteyebilir',
|
||||||
|
'ai.dsAccounts': 'Hesap oluşturma',
|
||||||
|
'ai.dsNever': 'Play bu formu geri okuyamaz. Buradan bir kez yükledikten sonra bu sekme o zamandan beri neyin değiştiğini gösterir.',
|
||||||
|
'ai.dsSame': 'Son yüklemeyle aynı ({when}).',
|
||||||
|
'ai.dsChanged': 'Son yüklemeden beri {count} yanıt değişti ({when}): Play\'i güncellemek için yeniden yükleyin.',
|
||||||
|
'ai.dsChanged_one': 'Son yüklemeden beri 1 yanıt değişti ({when}): Play\'i güncellemek için yeniden yükleyin.',
|
||||||
|
'ai.show': 'Göster',
|
||||||
|
'ai.hide': 'Gizle',
|
||||||
|
'ai.colType': 'Veri türü',
|
||||||
|
'ai.colCollected': 'Toplama amacı',
|
||||||
|
'ai.colShared': 'Paylaşma amacı',
|
||||||
|
'ai.notShared': 'paylaşılmıyor',
|
||||||
|
'ai.optional': 'isteğe bağlı',
|
||||||
|
'ai.ephemeral': 'geçici',
|
||||||
|
'ai.dsFoot': 'Yükleme {rows} CSV satırı gönderir (Play\'in içe aktarma biçimi) ve önceki tüm yanıtların yerine geçer.',
|
||||||
|
'ai.apTitle': 'Uygulama Gizliliği',
|
||||||
|
'ai.apSub': 'App Store, Veri güvenliği yanıtlarından önerilen',
|
||||||
|
'ai.apOpen': 'Uygulama Gizliliği\'ni aç',
|
||||||
|
'ai.apNote': 'Uygulama Gizliliği\'nin API\'si yok: bu yanıtları App Store Connect > Uygulama Gizliliği bölümüne girin. Apple ayrıca her tür için kullanıcıyla ilişkili mi ve takip için mi kullanıldığını sorar.',
|
||||||
|
'ai.apNoneTitle': 'Veri toplanmıyor',
|
||||||
|
'ai.apNoneText': 'Veri güvenliği yanıtları hiçbir veri türü listelemiyor: her SDK için doğruysa App Store Connect\'te "Veri Toplanmıyor" yanıtını verin.',
|
||||||
|
'ai.apUnknownTitle': 'Henüz önerilecek bir şey yok',
|
||||||
|
'ai.apUnknownText': 'Veri toplamayı dataSafety içinde bir kez yanıtlayın; Uygulama Gizliliği yanıtları ondan çıkar.',
|
||||||
|
'ai.colAppleType': 'Veri türü',
|
||||||
|
'ai.colPurposes': 'Amaçlar',
|
||||||
|
'ai.colLinked': 'Kullanıcıyla ilişkili',
|
||||||
|
'ai.colTracking': 'Takip',
|
||||||
|
'ai.ask': 'Sizin yanıtınız',
|
||||||
|
'ai.askLikely': 'Kontrol edin: paylaşılıyor',
|
||||||
|
'ai.noPlay': 'Google Play\'de değil',
|
||||||
|
'ai.noPlayText': 'Ayarda play bölümü yok.',
|
||||||
|
'ai.noApple': 'App Store\'da değil',
|
||||||
|
'ai.noAppleText': 'Ayarda apple bölümü yok.',
|
||||||
|
'ai.infoTitle': 'Uygulama bilgisi',
|
||||||
|
'ai.infoSub': 'Kategoriler, yaş sınırı, içerik hakları',
|
||||||
|
'ai.infoPush': 'App Store uygulama bilgisini gönder',
|
||||||
|
'ai.push': 'Gönder',
|
||||||
|
'ai.pushed': 'App Store Connect\'e gönderildi',
|
||||||
|
'ai.category': 'Kategori',
|
||||||
|
'ai.age': 'Yaş sınırı',
|
||||||
|
'ai.ageAllNone': 'Her soru "yok": onaylayın',
|
||||||
|
'ai.rights': 'İçerik hakları',
|
||||||
|
'ai.rightsOwn': 'Üçüncü taraf içerik yok',
|
||||||
|
'ai.rightsThird': 'Üçüncü taraf içerik, haklar alınmış',
|
||||||
|
'ai.price': 'Fiyat',
|
||||||
|
'ai.free': 'Ücretsiz, her bölgede',
|
||||||
|
'ai.paid': 'Ücretli (App Store Connect\'te ayarlanır)',
|
||||||
|
'ai.notSet': 'Ayarlanmadı',
|
||||||
|
'ai.notAnswered': 'Yanıtlanmadı',
|
||||||
|
'ai.encTitle': 'İhracat uyumu',
|
||||||
|
'ai.encSub': 'Her derleme için şifreleme yanıtı',
|
||||||
|
'ai.encAnswer': 'Derlemeleri yanıtla',
|
||||||
|
'ai.encPush': 'Derlemeler için ihracat uyumunu yanıtla',
|
||||||
|
'ai.encYes': 'Muaf olmayan şifreleme kullanıyor',
|
||||||
|
'ai.encNo': 'Yalnızca muaf şifreleme',
|
||||||
|
'ai.encYesText': 'Derlemeler App Store Connect\'teki onaylı şifreleme beyanına bağlanır.',
|
||||||
|
'ai.encNoText': 'Yanıtsız derlemeler usesNonExemptEncryption = false alır. Daha iyisi: Info.plist içinde ITSAppUsesNonExemptEncryption = NO.',
|
||||||
|
'ai.encUnset': 'apple.usesNonExemptEncryption ayarlanmadı. export-compliance becerisiyle karar verin; storebound bunu asla tahmin etmez.',
|
||||||
|
'ai.encUnsetHint': 'Önce ayarda apple.usesNonExemptEncryption yanıtını verin',
|
||||||
|
'ai.reviewTitle': 'App Review bilgileri',
|
||||||
|
'ai.reviewSub': 'İletişim, demo hesabı, notlar',
|
||||||
|
'ai.reviewPush': 'App Review bilgilerini gönder',
|
||||||
|
'ai.signIn': 'Giriş gerekli',
|
||||||
|
'ai.contact': 'İletişim',
|
||||||
|
'ai.demo': 'Demo hesabı',
|
||||||
|
'ai.demoNone': 'gerekmiyor',
|
||||||
|
'ai.missing': 'Eksik',
|
||||||
|
'ai.notes': 'İnceleyene notlar',
|
||||||
|
'ai.notesBytes': '{n} / {max} bayt',
|
||||||
|
'ai.notesNone': 'Not yok (apple.info.reviewNotes, reviewAccess.instructions).',
|
||||||
|
'ai.reviewSafe': 'İletişim ve demo hesabı uygulama klasörünün .storebound/ klasöründe kalır (gitignore); maskeli gösterilir, parola asla gösterilmez.',
|
||||||
|
'ai.foot': 'Ayardan ve .storebound/ klasöründen {when} okundu. Buradan hiçbir şey bir yere gönderilmedi.',
|
||||||
|
'ds.functionality': 'Uygulama işlevi',
|
||||||
|
'ds.analytics': 'Analiz',
|
||||||
|
'ds.communications': 'Geliştirici iletişimi',
|
||||||
|
'ds.fraud': 'Dolandırıcılık önleme, güvenlik',
|
||||||
|
'ds.advertising': 'Reklam veya pazarlama',
|
||||||
|
'ds.personalization': 'Kişiselleştirme',
|
||||||
|
'ds.account': 'Hesap yönetimi',
|
||||||
|
|
||||||
|
'folders.fastlane': 'fastlane\'den içe aktar',
|
||||||
|
'folders.fastlaneHint': 'fastlane kurulumu olan bir klasör seçin: storebound içe aktarma planını bir sistem penceresinde gösterir, sonra dosyalarını fastlane\'in yanına yazar (asla üzerine yazmaz)',
|
||||||
|
'folders.imported': '{name} fastlane\'den içe aktarıldı',
|
||||||
|
'folders.importedDetail': 'Ayar, mağaza metni dosyaları ve ekran kareleri yazıldı. Sırada yer tutucuları değiştirmek, sonra Kontroller var.',
|
||||||
|
'folders.startShort': 'Uygulama klasörü başlat',
|
||||||
|
'folders.newNote': 'İkisi de bir sistem penceresinde klasör ister, ne yazacaklarını gösterir ve yalnızca Uygula\'ya bastığınızda yazar. Var olan dosyalar korunur.',
|
||||||
|
'folders.open': 'Aç',
|
||||||
|
'folders.openApp': 'Bu uygulamayı aç',
|
||||||
|
'folders.reveal': 'Dosya yöneticisinde göster',
|
||||||
|
|
||||||
|
'wz.s0': 'Stüdyonuz',
|
||||||
|
'wz.studioTitle': 'Bu uygulamalar hangi stüdyonun?',
|
||||||
|
'wz.studioLead': 'Stüdyo, mağaza hesaplarını ve uygulamalarını bir araya toplar (bir şirket, bir müşteri, bir yan proje). Birini seçin veya oluşturun; sonraki adımların anahtarları ona gider. Sonradan taşıyabilirsiniz.',
|
||||||
|
'wz.studioPick': 'Stüdyo',
|
||||||
|
'wz.studioAccounts': '{count} mağaza hesabı',
|
||||||
|
'wz.studioAccounts_one': '1 mağaza hesabı',
|
||||||
|
'wz.studioPicked': 'Seçili',
|
||||||
|
'wz.studioNoneHint': 'Hesapları stüdyosuz tut',
|
||||||
|
'wz.studioNew': 'Stüdyonuzu oluşturun',
|
||||||
|
'wz.studioAnother': 'Ya da başka bir stüdyo oluşturun',
|
||||||
|
'wz.studioNewText': 'Bir ad ve bir renk; logo sonra Stüdyolar ve hesaplar\'dan eklenebilir.',
|
||||||
|
'wz.studioPlaceholder': 'Örneğin: Example Games',
|
||||||
|
'wz.studioCreate': 'Stüdyo oluştur',
|
||||||
|
'wz.fastlaneTitle': 'fastlane\'den içe aktar',
|
||||||
|
'wz.fastlaneText': 'Klasörde fastlane kurulumu var (deliver, supply). storebound onu kendi ayarına ve mağaza metni dosyalarına çevirir, fastlane\'e dokunmaz.',
|
||||||
|
'wz.fastlaneGo': 'Klasörü seç ve içe aktar',
|
||||||
|
'wz.fastlaneNote': 'Herhangi bir şey yazılmadan önce içe aktarma planını ve eşlenmeyenleri görürsünüz.',
|
||||||
|
'wz.keysInto': 'Yeni anahtarlar {name} stüdyosuna gider.',
|
||||||
|
'wz.keysNoStudio': 'Yeni anahtarlar stüdyosuz kalır.',
|
||||||
|
'wz.change': 'Değiştir',
|
||||||
};
|
};
|
||||||
|
|
|
||||||
111
apps/desktop/src/lib/exports.ts
Normal file
111
apps/desktop/src/lib/exports.ts
Normal file
|
|
@ -0,0 +1,111 @@
|
||||||
|
// Exports the window offers (top right of a screen and the command palette): CSV and Markdown built from what the
|
||||||
|
// screen already read. Pure, so tests can pin the formats. The prices CSV has the exact columns of `storebound prices
|
||||||
|
// import`, so an exported sheet can be edited and compared again.
|
||||||
|
import type { AnalyticsCompare, AppStatus, DeclarationsResult, ListingText, PricesCurrent } from '../api';
|
||||||
|
import type { CatalogDiff, HealthSnapshot, Review, ValidateResult } from './model';
|
||||||
|
import { isError } from './model';
|
||||||
|
|
||||||
|
type Cell = string | number | boolean | null | undefined;
|
||||||
|
|
||||||
|
const cell = (v: Cell): string => {
|
||||||
|
const s = v === null || v === undefined ? '' : String(v);
|
||||||
|
return /[",\n\r]/.test(s) || /^\s|\s$/.test(s) ? `"${s.replace(/"/g, '""')}"` : s;
|
||||||
|
};
|
||||||
|
/** RFC 4180 CSV with a header row; spreadsheet formula prefixes (= + - @) in text cells are quoted with a ' first. */
|
||||||
|
export function csv(head: string[], rows: Cell[][]): string {
|
||||||
|
const safe = (v: Cell) => (typeof v === 'string' && /^[=+\-@\t]/.test(v) && !/^-?\d+(\.\d+)?$/.test(v) ? `'${v}` : v);
|
||||||
|
return [head, ...rows.map(r => r.map(safe))].map(r => r.map(cell).join(',')).join('\n') + '\n';
|
||||||
|
}
|
||||||
|
|
||||||
|
const pipe = (s: Cell) => String(s ?? '').replace(/\|/g, '\\|').replace(/\r?\n/g, ' ');
|
||||||
|
export function mdTable(head: string[], rows: Cell[][]): string {
|
||||||
|
if (!rows.length) return '_none_\n';
|
||||||
|
return [`| ${head.map(pipe).join(' | ')} |`, `| ${head.map(() => '---').join(' | ')} |`, ...rows.map(r => `| ${r.map(pipe).join(' | ')} |`)].join('\n') + '\n';
|
||||||
|
}
|
||||||
|
|
||||||
|
/** "Prism Puddle prices 2026-10-11" (the dialog adds the extension). */
|
||||||
|
export const exportName = (app: string, what: string, now = new Date()): string => `${app} ${what} ${now.toISOString().slice(0, 10)}`;
|
||||||
|
|
||||||
|
/** The price sheet: product, store, region, currency, price, start_date, kind (the `prices import` format). */
|
||||||
|
export function pricesCsv(p: PricesCurrent): string {
|
||||||
|
// one row per product x store x region x start date (the import refuses doubles): a manual price wins over Apple's equalized one
|
||||||
|
const key = (r: PricesCurrent['rows'][number]) => `${r.product}|${r.store}|${r.region}|${r.startDate ?? ''}`;
|
||||||
|
const manual = new Set(p.rows.filter(r => r.kind !== 'auto').map(key));
|
||||||
|
const rows = p.rows.filter(r => r.kind !== 'auto' || !manual.has(key(r))).sort((a, b) => a.product.localeCompare(b.product) || a.store.localeCompare(b.store) || a.region.localeCompare(b.region));
|
||||||
|
return csv(['product', 'store', 'region', 'currency', 'price', 'start_date', 'kind'], rows.map(r => [r.product, r.store, r.region, r.currency, r.price, r.startDate ?? '', r.kind ?? 'manual']));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Reviews as a CSV (personal data: the window warns before saving). */
|
||||||
|
export function reviewsCsv(rs: Review[]): string {
|
||||||
|
return csv(['store', 'date', 'rating', 'territory', 'version', 'title', 'review', 'replied', 'reply'],
|
||||||
|
rs.map(r => [r.store === 'apple' ? 'App Store' : 'Google Play', r.date.slice(0, 10), r.rating, r.where ?? '', r.appVersion ?? '', r.title ?? '', r.body, r.reply ? 'yes' : 'no', r.reply?.text ?? '']));
|
||||||
|
}
|
||||||
|
|
||||||
|
const pctOf = (v: number | null | undefined, d = 2): string => (v === null || v === undefined ? '–' : `${(v * 100).toFixed(d)} %`);
|
||||||
|
|
||||||
|
export function healthMd(app: string, h: HealthSnapshot): string {
|
||||||
|
const out = [`# ${app}: health ${h.date}`, ''];
|
||||||
|
if (h.play && !isError(h.play)) {
|
||||||
|
const last = <T>(xs: T[]): T | undefined => xs[xs.length - 1];
|
||||||
|
const c = last(h.play.crash)?.values, a = last(h.play.anr)?.values;
|
||||||
|
out.push('## Google Play', '', `Window: ${h.play.window.start} to ${h.play.window.end}`, '',
|
||||||
|
mdTable(['metric', 'last day', '28 days (user-weighted)', 'bad behavior threshold'], [
|
||||||
|
['User-perceived crash rate', pctOf(c?.userPerceivedCrashRate), pctOf(c?.userPerceivedCrashRate28dUserWeighted), '1.09 %'],
|
||||||
|
['User-perceived ANR rate', pctOf(a?.userPerceivedAnrRate), pctOf(a?.userPerceivedAnrRate28dUserWeighted), '0.47 %'],
|
||||||
|
]), '### Worst devices', '', mdTable(['device', 'crash rate', 'users'], (h.play.devices ?? []).map(d => [d.model, pctOf(d.crash), d.users ?? ''])),
|
||||||
|
'### Top issues', '', mdTable(['type', 'cause', 'where', 'reports', 'users', 'last version'], h.play.issues.map(i => [i.type, i.cause, i.location, i.reports, i.users, i.lastVersion])));
|
||||||
|
} else if (h.play) out.push('## Google Play', '', `Not read: ${(h.play as { error: string }).error}`, '');
|
||||||
|
if (h.apple && !isError(h.apple)) {
|
||||||
|
out.push('## App Store', '', mdTable(['category', 'metric', 'version', 'value', 'goal'], h.apple.metrics.map(m => [m.category, m.metric, m.version, `${m.value} ${m.unit}`, m.goal])),
|
||||||
|
'### Diagnostic signatures', '', mdTable(['build', 'type', 'signature', 'weight'], h.apple.signatures.map(s => [s.build, s.type, s.signature, pctOf(s.weight, 0)])));
|
||||||
|
} else if (h.apple) out.push('## App Store', '', `Not read: ${(h.apple as { error: string }).error}`, '');
|
||||||
|
return out.join('\n');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function validateMd(app: string, v: ValidateResult, at: string | null): string {
|
||||||
|
const lvl = (l: string) => (l === 'blocker' ? 'Blocker' : l === 'warn' ? 'Warning' : 'OK');
|
||||||
|
return [`# ${app}: store readiness`, '', `Read ${at ?? 'now'} · ${v.blockers} blocker(s), ${v.findings.filter(f => f.level === 'warn').length} warning(s)`, '',
|
||||||
|
mdTable(['store', 'level', 'check', 'finding', 'fix'], v.findings.map(f => [f.store === 'apple' ? 'App Store' : 'Google Play', lvl(f.level), f.code, f.msg, f.fix ?? ''])),
|
||||||
|
].join('\n');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function catalogMd(app: string, c: CatalogDiff): string {
|
||||||
|
return [`# ${app}: catalog parity`, '', `${c.errors} error(s)`, '', '## Items', '',
|
||||||
|
mdTable(['item', 'store', 'level', 'code', 'note'], c.rows.map(r => [r.id, r.store === 'apple' ? 'App Store' : 'Google Play', r.level, r.code, r.msg])),
|
||||||
|
'## Price gaps between the stores', '', mdTable(['item', 'region', 'currency', 'App Store', 'Google Play', 'difference'], c.parity.map(g => [g.id, g.region, g.currency, g.apple, g.play, `${g.diffPct.toFixed(1)} %`])),
|
||||||
|
].join('\n');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function listingsMd(app: string, l: ListingText): string {
|
||||||
|
const part = (title: string, f: { path: string; text: string } | null) => (f ? [`<!-- ${title}: ${f.path.split(/[\\/]/).slice(-2).join('/')} -->`, f.text.trim(), ''] : []);
|
||||||
|
return [`# ${app}: store listings`, '', ...part('Google Play', l.play), ...part('App Store', l.apple)].join('\n');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function portfolioCsv(rows: { name: string; studio: string; s?: AppStatus }[]): string {
|
||||||
|
return csv(['app', 'studio', 'ios bundle id', 'android package', 'ios version', 'ios state', 'android version', 'android state', 'next version', 'config problems', 'config warnings'],
|
||||||
|
rows.map(({ name, studio, s }) => {
|
||||||
|
const cur = s?.release.current;
|
||||||
|
return [name, studio, s?.app?.platforms.ios?.bundleId ?? '', s?.app?.platforms.android?.packageName ?? '', cur?.ios?.version ?? '', cur?.ios?.phase ?? '', cur?.android?.version ?? '',
|
||||||
|
cur?.android?.phase ?? '', s?.release.next?.version ?? '', s?.check?.problems.length ?? '', s?.check?.warnings.length ?? ''];
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function declarationsMd(app: string, d: DeclarationsResult): string {
|
||||||
|
const yes = (b: boolean | null | undefined) => (b === null || b === undefined ? 'not answered' : b ? 'yes' : 'no');
|
||||||
|
const out = [`# ${app}: store declarations`, '', 'From storebound.config.ts and .storebound/ (contact and demo account masked).', ''];
|
||||||
|
if (d.ask.length) out.push('## Ask the owner', '', mdTable(['area', 'question', 'how to answer'], d.ask.map(a => [a.area, a.text, a.fix])));
|
||||||
|
if (d.dataSafety) out.push('## Google Play Data safety', '', `Collects data: ${yes(d.dataSafety.collectsData)} · encrypted in transit: ${yes(d.dataSafety.encryptedInTransit)} · deletion request: ${yes(d.dataSafety.deletionRequest)}`, '',
|
||||||
|
mdTable(['data type', 'category', 'collected for', 'shared for', 'optional', 'ephemeral'], d.dataSafety.types.map(x => [x.id, x.category, x.collect.join(', '), x.shared ? x.share.join(', ') : 'not shared', yes(x.optional), yes(x.ephemeral)])));
|
||||||
|
if (d.appPrivacy) out.push('## App Store App Privacy (enter in App Store Connect)', '', mdTable(['data type', 'category', 'purposes', 'third party', 'from'], d.appPrivacy.items.map(x => [x.apple, x.category, x.purposes.join(', '), yes(x.thirdParty), x.from.join(', ')])));
|
||||||
|
if (d.appInfo) out.push('## App Store app info', '', `Category: ${d.appInfo.categories ? [d.appInfo.categories.primary, d.appInfo.categories.primarySubOne, d.appInfo.categories.primarySubTwo].filter(Boolean).join(' / ') : 'not set'}`,
|
||||||
|
`Age rating overrides: ${d.appInfo.ageRating.map(a => `${a.question}=${a.value}`).join(', ') || 'none (every question none / false)'}`, `Content rights: ${d.appInfo.contentRights ?? 'not set'}`, `Export compliance (non-exempt encryption): ${yes(d.encryption)}`, '');
|
||||||
|
out.push('## App Review', '', `Sign-in required: ${yes(d.review.signInRequired)} · contact: ${d.review.contact ?? 'missing'} · demo account: ${d.review.demoAccount ?? 'none'} · notes: ${d.review.notesBytes} / ${d.review.notesMax} bytes`, '');
|
||||||
|
return out.join('\n');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function analyticsCsv(a: AnalyticsCompare): string {
|
||||||
|
const dates = [...new Set([...a.series.apple.map(d => d.date), ...a.series.play.map(d => d.date)])].sort();
|
||||||
|
const ap = new Map(a.series.apple.map(d => [d.date, d] as const)), pl = new Map(a.series.play.map(d => [d.date, d] as const));
|
||||||
|
return csv(['date', 'app store impressions', 'app store page views', 'app store downloads', 'play visitors', 'play acquisitions', 'play installs'],
|
||||||
|
dates.map(d => [d, ap.get(d)?.impressions ?? '', ap.get(d)?.pageViews ?? '', ap.get(d)?.downloads ?? '', pl.get(d)?.visitors ?? '', pl.get(d)?.acquisitions ?? '', pl.get(d)?.installs ?? '']));
|
||||||
|
}
|
||||||
|
|
@ -16,6 +16,12 @@ export function share(x: number): string {
|
||||||
|
|
||||||
export const num = (n: number, digits = 0): string => new Intl.NumberFormat(loc(), { maximumFractionDigits: digits, minimumFractionDigits: digits }).format(n);
|
export const num = (n: number, digits = 0): string => new Intl.NumberFormat(loc(), { maximumFractionDigits: digits, minimumFractionDigits: digits }).format(n);
|
||||||
|
|
||||||
|
/** 4.99 USD -> "$4.99" (Turkish: "$4,99"); an unknown currency code keeps the code. */
|
||||||
|
export function money(n: number, currency: string): string {
|
||||||
|
try { return new Intl.NumberFormat(loc(), { style: 'currency', currency, maximumFractionDigits: n % 1 ? 2 : 0, minimumFractionDigits: n % 1 ? 2 : 0 }).format(n); }
|
||||||
|
catch { return `${num(n, n % 1 ? 2 : 0)} ${currency}`; }
|
||||||
|
}
|
||||||
|
|
||||||
export function bytes(n: number | null | undefined): string {
|
export function bytes(n: number | null | undefined): string {
|
||||||
if (!n) return '–';
|
if (!n) return '–';
|
||||||
const mb = n / 1e6;
|
const mb = n / 1e6;
|
||||||
|
|
|
||||||
128
apps/desktop/src/lib/views.ts
Normal file
128
apps/desktop/src/lib/views.ts
Normal file
|
|
@ -0,0 +1,128 @@
|
||||||
|
// Pure view models of the screens added for full CLI coverage: the price matrix (product x territory, both stores),
|
||||||
|
// the price sheet diff summary, the analytics chart series, render grids, and the "how to fix it" hint of an error.
|
||||||
|
import type { AnalyticsCompare, PriceDiffRow, PriceRowData, PricesCurrent, RendersResult } from '../api';
|
||||||
|
import type { Key } from '../i18n';
|
||||||
|
|
||||||
|
/** Territories shown first in the price overview (big stores, several currencies). */
|
||||||
|
export const KEY_REGIONS = ['US', 'GB', 'DE', 'FR', 'JP', 'KR', 'BR', 'IN', 'TR', 'MX'] as const;
|
||||||
|
|
||||||
|
export interface PriceCell { price: number; currency: string; kind: 'manual' | 'auto'; startDate?: string }
|
||||||
|
export interface RegionRow { region: string; apple: PriceCell | null; play: PriceCell | null; scheduled: PriceCell | null; gapPct: number | null }
|
||||||
|
|
||||||
|
const cellOf = (r: PriceRowData): PriceCell => ({ price: r.price, currency: r.currency, kind: r.kind ?? 'manual', ...(r.startDate ? { startDate: r.startDate } : {}) });
|
||||||
|
|
||||||
|
/** One product across every region either store sells it in. Current prices only (a future App Store start date is
|
||||||
|
* `scheduled`); the gap is |apple - play| / max, only when both use the same currency. */
|
||||||
|
export function regionRows(p: PricesCurrent, product: string): RegionRow[] {
|
||||||
|
const by = new Map<string, RegionRow>();
|
||||||
|
const row = (region: string) => {
|
||||||
|
let r = by.get(region);
|
||||||
|
if (!r) by.set(region, (r = { region, apple: null, play: null, scheduled: null, gapPct: null }));
|
||||||
|
return r;
|
||||||
|
};
|
||||||
|
for (const x of p.rows.filter(r => r.product === product)) {
|
||||||
|
const r = row(x.region);
|
||||||
|
if (x.store === 'apple' && x.startDate) { r.scheduled = cellOf(x); continue; }
|
||||||
|
// a manual Apple price wins over the equalized one of the same territory
|
||||||
|
if (x.store === 'apple' && (!r.apple || (r.apple.kind === 'auto' && x.kind !== 'auto'))) r.apple = cellOf(x);
|
||||||
|
if (x.store === 'play') r.play = cellOf(x);
|
||||||
|
}
|
||||||
|
for (const r of by.values()) {
|
||||||
|
if (r.apple && r.play && r.apple.currency === r.play.currency && Math.max(r.apple.price, r.play.price) > 0)
|
||||||
|
r.gapPct = (Math.abs(r.apple.price - r.play.price) / Math.max(r.apple.price, r.play.price)) * 100;
|
||||||
|
}
|
||||||
|
const key = (x: string) => { const i = (KEY_REGIONS as readonly string[]).indexOf(x); return i < 0 ? 100 : i; };
|
||||||
|
return [...by.values()].sort((a, b) => key(a.region) - key(b.region) || a.region.localeCompare(b.region));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** The overview matrix: products x the key regions (and only regions somebody sells in). */
|
||||||
|
export function priceMatrix(p: PricesCurrent, regions: readonly string[] = KEY_REGIONS): { regions: string[]; rows: { product: string; cells: Record<string, RegionRow> }[] } {
|
||||||
|
const rows = p.products.map(product => ({ product, cells: Object.fromEntries(regionRows(p, product).map(r => [r.region, r] as const)) }));
|
||||||
|
const used = regions.filter(r => rows.some(x => x.cells[r]));
|
||||||
|
return { regions: used, rows };
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PriceStats { products: number; regions: number; rows: number; manual: number; auto: number; gaps: number; missing: number }
|
||||||
|
export function priceStats(p: PricesCurrent, threshold = 10): PriceStats {
|
||||||
|
const regions = new Set(p.rows.map(r => r.region));
|
||||||
|
const gaps = p.products.flatMap(x => regionRows(p, x)).filter(r => r.gapPct !== null && r.gapPct >= threshold).length;
|
||||||
|
return { products: p.products.length, regions: regions.size, rows: p.rows.length, manual: p.rows.filter(r => r.kind !== 'auto').length, auto: p.rows.filter(r => r.kind === 'auto').length, gaps, missing: p.missing.length };
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DiffSummary { changed: number; added: number; same: number; up: number; down: number; products: string[]; pairs: number }
|
||||||
|
export function diffSummary(rows: PriceDiffRow[], changedPairs: string[]): DiffSummary {
|
||||||
|
const live = rows.filter(r => r.change !== 'same');
|
||||||
|
return {
|
||||||
|
changed: live.filter(r => r.change === 'change').length, added: live.filter(r => r.change === 'new').length, same: rows.length - live.length,
|
||||||
|
up: live.filter(r => r.from !== null && r.to > r.from).length, down: live.filter(r => r.from !== null && r.to < r.from).length,
|
||||||
|
products: [...new Set(live.map(r => r.product))].sort(), pairs: changedPairs.length,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
export const changePct = (r: Pick<PriceDiffRow, 'from' | 'to'>): number | null => (r.from ? ((r.to - r.from) / r.from) * 100 : null);
|
||||||
|
|
||||||
|
// ---- analytics chart ----
|
||||||
|
|
||||||
|
export interface ChartSeries { dates: string[]; reach: number[]; installs: number[]; conversion: (number | null)[]; events: { date: string; subject: string; commit: string }[] }
|
||||||
|
/** Daily reach (App Store impressions / Play store listing visitors), installs (downloads / acquisitions) and
|
||||||
|
* conversion, with the store changes from git as markers. */
|
||||||
|
export function chartSeries(a: AnalyticsCompare, store: 'apple' | 'play'): ChartSeries {
|
||||||
|
const pts = store === 'apple'
|
||||||
|
? a.series.apple.map(d => ({ date: d.date, reach: d.impressions, installs: d.downloads }))
|
||||||
|
: a.series.play.map(d => ({ date: d.date, reach: d.visitors, installs: d.acquisitions }));
|
||||||
|
const first = pts[0]?.date ?? '', last = pts[pts.length - 1]?.date ?? '';
|
||||||
|
const seen = new Set<string>();
|
||||||
|
const events = a.effects.filter(e => e.store === store && e.event.date >= first && e.event.date <= last)
|
||||||
|
.filter(e => (seen.has(e.event.commit) ? false : (seen.add(e.event.commit), true))).map(e => ({ date: e.event.date, subject: e.event.subject, commit: e.event.commit }));
|
||||||
|
return { dates: pts.map(p => p.date), reach: pts.map(p => p.reach), installs: pts.map(p => p.installs), conversion: pts.map(p => (p.reach ? p.installs / p.reach : null)), events };
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Conversion before vs after one change (null when a side has no data). */
|
||||||
|
export const effectDelta = (before?: number | null, after?: number | null): number | null => (before && after !== undefined && after !== null ? ((after - before) / before) * 100 : null);
|
||||||
|
|
||||||
|
// ---- store art ----
|
||||||
|
|
||||||
|
export interface ArtFilter { variant: string; lang: string; onlyIssues: boolean }
|
||||||
|
/** The rows of one variant and language, optionally only those with issues. */
|
||||||
|
export function artRows(r: RendersResult, f: ArtFilter) {
|
||||||
|
const v = r.variants.find(x => x.id === f.variant) ?? r.variants[0];
|
||||||
|
const l = v?.langs.find(x => x.lang === f.lang) ?? v?.langs[0];
|
||||||
|
if (!l) return [];
|
||||||
|
return l.rows.map(row => ({ ...row, tiles: f.onlyIssues ? row.tiles.filter(t => t.issues.length || row.issues.length) : row.tiles }))
|
||||||
|
.filter(row => !f.onlyIssues || row.tiles.length || row.issues.length);
|
||||||
|
}
|
||||||
|
/** Issue counts per language of a variant (for the language picker). */
|
||||||
|
export function langIssues(r: RendersResult, variant: string): Record<string, { errors: number; warnings: number; tiles: number }> {
|
||||||
|
const v = r.variants.find(x => x.id === variant) ?? r.variants[0];
|
||||||
|
const out: Record<string, { errors: number; warnings: number; tiles: number }> = {};
|
||||||
|
for (const l of v?.langs ?? []) {
|
||||||
|
const all = l.rows.flatMap(row => [...row.issues, ...row.tiles.flatMap(t => t.issues)]);
|
||||||
|
out[l.lang] = { errors: all.filter(i => i.level === 'error').length, warnings: all.filter(i => i.level === 'warn').length, tiles: l.rows.reduce((n, row) => n + row.tiles.length, 0) };
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---- errors that say how to fix them ----
|
||||||
|
|
||||||
|
const HINTS: [RegExp, Key][] = [
|
||||||
|
[/service[ _]account|ASC_KEY_ID|ASC_ISSUER_ID|App Store Connect key not found/i, 'hint.keys'],
|
||||||
|
[/401|403|unauthori[sz]ed|forbidden|permission|caller does not have/i, 'hint.permission'],
|
||||||
|
[/not set in storebound\.config|storebound\.config\.ts: .* is not set|is not set in storebound/i, 'hint.config'],
|
||||||
|
[/no renders|shots render|nothing in .*renders/i, 'hint.renders'],
|
||||||
|
[/ffmpeg|ffprobe/i, 'hint.ffmpeg'],
|
||||||
|
[/playwright|chrom(e|ium)/i, 'hint.chrome'],
|
||||||
|
[/no snapshots|analytics snapshot/i, 'hint.snapshot'],
|
||||||
|
[/reportsBucket/i, 'hint.bucket'],
|
||||||
|
[/analytics report request|analytics setup/i, 'hint.analyticsSetup'],
|
||||||
|
[/no editable (App Store )?version|apple listing --version/i, 'hint.version'],
|
||||||
|
[/no fastlane folder/i, 'hint.fastlane'],
|
||||||
|
[/no prices CSV|prices export writes one/i, 'hint.priceSheet'],
|
||||||
|
[/price point/i, 'hint.pricePoint'],
|
||||||
|
[/ENOTFOUND|ECONNRESET|ETIMEDOUT|network|fetch failed|timed out/i, 'hint.network'],
|
||||||
|
[/confirm token|confirm-required|terminal only/i, 'hint.confirm'],
|
||||||
|
[/git log|not a git repository/i, 'hint.git'],
|
||||||
|
];
|
||||||
|
/** The fix of a known error in words (an i18n key), or null. */
|
||||||
|
export function fixHint(msg: string | null | undefined): Key | null {
|
||||||
|
if (!msg) return null;
|
||||||
|
return HINTS.find(([re]) => re.test(msg))?.[1] ?? null;
|
||||||
|
}
|
||||||
|
|
@ -6,6 +6,7 @@ import { setLang } from './i18n';
|
||||||
import { applyPrefs, loadPrefs, type Prefs, resolveLang, savePrefs } from './prefs';
|
import { applyPrefs, loadPrefs, type Prefs, resolveLang, savePrefs } from './prefs';
|
||||||
import { PrefsContext } from './prefs-ctx';
|
import { PrefsContext } from './prefs-ctx';
|
||||||
import { DataProvider } from './store';
|
import { DataProvider } from './store';
|
||||||
|
import { ExportProvider } from './ui/Exports';
|
||||||
import './styles.css';
|
import './styles.css';
|
||||||
|
|
||||||
const systemLang = (): string => (typeof navigator !== 'undefined' ? navigator.language : 'en');
|
const systemLang = (): string => (typeof navigator !== 'undefined' ? navigator.language : 'en');
|
||||||
|
|
@ -30,7 +31,7 @@ function Root() {
|
||||||
update({ ...prefs, theme: dark ? 'light' : 'dark' });
|
update({ ...prefs, theme: dark ? 'light' : 'dark' });
|
||||||
}, [prefs, update]);
|
}, [prefs, update]);
|
||||||
// a language change re-renders the whole tree in the new language
|
// a language change re-renders the whole tree in the new language
|
||||||
return <PrefsContext.Provider value={{ prefs, update }}><DataProvider><App key={lang} onTheme={onTheme} /></DataProvider></PrefsContext.Provider>;
|
return <PrefsContext.Provider value={{ prefs, update }}><DataProvider><ExportProvider><App key={lang} onTheme={onTheme} /></ExportProvider></DataProvider></PrefsContext.Provider>;
|
||||||
}
|
}
|
||||||
|
|
||||||
createRoot(document.getElementById('root')!).render(<StrictMode><Root /></StrictMode>);
|
createRoot(document.getElementById('root')!).render(<StrictMode><Root /></StrictMode>);
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,20 @@ import { createContext, useContext } from 'react';
|
||||||
import type { Key } from './i18n';
|
import type { Key } from './i18n';
|
||||||
import type { IconName } from './ui/icons';
|
import type { IconName } from './ui/icons';
|
||||||
|
|
||||||
export const APP_TABS = ['releases', 'catalog', 'listings', 'health', 'reviews', 'testflight', 'checks'] as const;
|
export const APP_TABS = ['releases', 'catalog', 'prices', 'listings', 'art', 'health', 'reviews', 'testflight', 'growth', 'appinfo', 'checks'] as const;
|
||||||
export type AppTab = (typeof APP_TABS)[number];
|
export type AppTab = (typeof APP_TABS)[number];
|
||||||
/** Tabs of a store-only app: store reads only (catalog, listings and checks need the app folder). */
|
/** Tabs of a store-only app: store reads only (catalog, prices, listings, art, app info and checks need the app folder;
|
||||||
export const STORE_TABS: readonly AppTab[] = ['releases', 'health', 'reviews', 'testflight'];
|
* Growth shows the Product Page Optimization tests only). */
|
||||||
|
export const STORE_TABS: readonly AppTab[] = ['releases', 'health', 'reviews', 'testflight', 'growth'];
|
||||||
export const tabsFor = (hasFolder: boolean): readonly AppTab[] => (hasFolder ? APP_TABS : STORE_TABS);
|
export const tabsFor = (hasFolder: boolean): readonly AppTab[] => (hasFolder ? APP_TABS : STORE_TABS);
|
||||||
export const TAB_KEY: Record<AppTab, Key> = { releases: 'tab.releases', catalog: 'tab.catalog', listings: 'tab.listings', health: 'tab.health', reviews: 'tab.reviews', testflight: 'tab.testflight', checks: 'tab.checks' };
|
export const TAB_KEY: Record<AppTab, Key> = {
|
||||||
export const TAB_ICON: Record<AppTab, IconName> = { releases: 'rocket', catalog: 'tag', listings: 'text', health: 'activity', reviews: 'message', testflight: 'plane', checks: 'shield' };
|
releases: 'tab.releases', catalog: 'tab.catalog', prices: 'tab.prices', listings: 'tab.listings', art: 'tab.art', health: 'tab.health', reviews: 'tab.reviews',
|
||||||
|
testflight: 'tab.testflight', growth: 'tab.growth', appinfo: 'tab.appinfo', checks: 'tab.checks',
|
||||||
|
};
|
||||||
|
export const TAB_ICON: Record<AppTab, IconName> = {
|
||||||
|
releases: 'rocket', catalog: 'tag', prices: 'coins', listings: 'text', art: 'grid', health: 'activity', reviews: 'message', testflight: 'plane', growth: 'chart',
|
||||||
|
appinfo: 'clipboard', checks: 'shield',
|
||||||
|
};
|
||||||
export const WORKSPACE = ['apps', 'accounts', 'ignored', 'dependencies', 'settings'] as const;
|
export const WORKSPACE = ['apps', 'accounts', 'ignored', 'dependencies', 'settings'] as const;
|
||||||
export type WorkspaceScreen = (typeof WORKSPACE)[number];
|
export type WorkspaceScreen = (typeof WORKSPACE)[number];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ export function HealthChip({ h }: { h: AccountHealth | undefined }) {
|
||||||
return <span title={h.check.message}><Chip tone={tone}>{t(key)}</Chip></span>;
|
return <span title={h.check.message}><Chip tone={tone}>{t(key)}</Chip></span>;
|
||||||
}
|
}
|
||||||
|
|
||||||
function Swatches({ value, onChange, name }: { value: StudioColor; onChange: (c: StudioColor) => void; name: string }) {
|
export function Swatches({ value, onChange, name }: { value: StudioColor; onChange: (c: StudioColor) => void; name: string }) {
|
||||||
return (
|
return (
|
||||||
<div className="swatches" role="radiogroup" aria-label={t('studio.color')}>
|
<div className="swatches" role="radiogroup" aria-label={t('studio.color')}>
|
||||||
{STUDIO_COLORS.map(c => (
|
{STUDIO_COLORS.map(c => (
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import { api, errorText, newJob, onProgress, type Project, type ToolResult, type
|
||||||
import { devSwitch } from '../dev/switches';
|
import { devSwitch } from '../dev/switches';
|
||||||
import { t } from '../i18n';
|
import { t } from '../i18n';
|
||||||
import { shortPath, tildeText } from '../paths';
|
import { shortPath, tildeText } from '../paths';
|
||||||
|
import { useNav } from '../nav';
|
||||||
import { useData } from '../store';
|
import { useData } from '../store';
|
||||||
import { Icon, StoreGlyph } from '../ui/icons';
|
import { Icon, StoreGlyph } from '../ui/icons';
|
||||||
import { AppIcon, Card, Chip, Empty, Notice, Seg, StoreBadge } from '../ui/kit';
|
import { AppIcon, Card, Chip, Empty, Notice, Seg, StoreBadge } from '../ui/kit';
|
||||||
|
|
@ -15,6 +16,7 @@ interface Run { title: string; project: string; job: string; lines: string[]; re
|
||||||
|
|
||||||
export function AppFolders() {
|
export function AppFolders() {
|
||||||
const d = useData();
|
const d = useData();
|
||||||
|
const nav = useNav();
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
const [busy, setBusy] = useState<string | null>(null);
|
const [busy, setBusy] = useState<string | null>(null);
|
||||||
const [run, setRun] = useState<Run | null>(null);
|
const [run, setRun] = useState<Run | null>(null);
|
||||||
|
|
@ -33,6 +35,7 @@ export function AppFolders() {
|
||||||
};
|
};
|
||||||
const add = () => act('add', async () => { const p = await api.addProject(); if (p) { await d.reload(); d.toast({ kind: 'ok', title: t('folders.added', { name: p.name }) }); } });
|
const add = () => act('add', async () => { const p = await api.addProject(); if (p) { await d.reload(); d.toast({ kind: 'ok', title: t('folders.added', { name: p.name }) }); } });
|
||||||
const init = () => act('init', async () => { const p = await api.initProject(profile); if (p) { await d.reload(); d.toast({ kind: 'ok', title: t('folders.started', { name: p.name }), detail: t('folders.startedDetail') }); } });
|
const init = () => act('init', async () => { const p = await api.initProject(profile); if (p) { await d.reload(); d.toast({ kind: 'ok', title: t('folders.started', { name: p.name }), detail: t('folders.startedDetail') }); } });
|
||||||
|
const fastlane = () => act('fastlane', async () => { const p = await api.importFastlane(profile); if (p) { await d.reload(); d.toast({ kind: 'ok', title: t('folders.imported', { name: p.name }), detail: t('folders.importedDetail') }); } });
|
||||||
const remove = (p: Project) => act(`rm-${p.id}`, async () => { await api.removeProject(p.id); await d.reload(); });
|
const remove = (p: Project) => act(`rm-${p.id}`, async () => { await api.removeProject(p.id); await d.reload(); });
|
||||||
const setAcc = (p: Project, play: string | null, apple: string | null) => act(`acc-${p.id}`, async () => { await api.setProjectAccounts(p.id, play, apple); await d.reload(); });
|
const setAcc = (p: Project, play: string | null, apple: string | null) => act(`acc-${p.id}`, async () => { await api.setProjectAccounts(p.id, play, apple); await d.reload(); });
|
||||||
|
|
||||||
|
|
@ -66,12 +69,20 @@ export function AppFolders() {
|
||||||
<div className="page">
|
<div className="page">
|
||||||
<div className="ph">
|
<div className="ph">
|
||||||
<div><h1>{t('nav.apps')}</h1><p>{t('folders.lead')}</p></div>
|
<div><h1>{t('nav.apps')}</h1><p>{t('folders.lead')}</p></div>
|
||||||
<div className="actions"><button className="btn btn-primary" onClick={add} disabled={!!busy}><Icon name="folderPlus" />{t('action.addFolder')}</button></div>
|
<div className="actions">
|
||||||
|
<button className="btn" onClick={fastlane} disabled={!!busy} title={t('folders.fastlaneHint')}><Icon name="download" />{t('folders.fastlane')}</button>
|
||||||
|
<button className="btn" onClick={init} disabled={!!busy}><Icon name="sparkle" />{t('folders.startShort')}</button>
|
||||||
|
<button className="btn btn-primary" onClick={add} disabled={!!busy}><Icon name="folderPlus" />{t('action.addFolder')}</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{error && <Notice tone="bad">{error}</Notice>}
|
{error && <Notice tone="bad">{error}</Notice>}
|
||||||
|
|
||||||
{!d.projects.length ? (
|
{!d.projects.length ? (
|
||||||
<Card pad={false}><Empty illo="apps" title={t('folders.emptyTitle')}>{t('folders.emptyText')}</Empty></Card>
|
<Card pad={false}><Empty illo="apps" title={t('folders.emptyTitle')} actions={<>
|
||||||
|
<button className="btn" onClick={fastlane} disabled={!!busy}><Icon name="download" />{t('folders.fastlane')}</button>
|
||||||
|
<button className="btn" onClick={init} disabled={!!busy}><Icon name="sparkle" />{t('folders.startShort')}</button>
|
||||||
|
<button className="btn btn-primary" onClick={add} disabled={!!busy}><Icon name="folderPlus" />{t('action.addFolder')}</button>
|
||||||
|
</>}>{t('folders.emptyText')}</Empty></Card>
|
||||||
) : (
|
) : (
|
||||||
<Card title={t('folders.list')} icon="folder" sub={t('folders.listSub', { count: d.projects.length })} pad={false}>
|
<Card title={t('folders.list')} icon="folder" sub={t('folders.listSub', { count: d.projects.length })} pad={false}>
|
||||||
<div className="list">
|
<div className="list">
|
||||||
|
|
@ -102,6 +113,8 @@ export function AppFolders() {
|
||||||
</select></label>
|
</select></label>
|
||||||
</div>
|
</div>
|
||||||
<div className="actions" style={{ flexWrap: 'nowrap' }}>
|
<div className="actions" style={{ flexWrap: 'nowrap' }}>
|
||||||
|
<button className="btn btn-sm" onClick={() => nav.go({ screen: 'app', appId: p.id, tab: 'releases' })} title={t('folders.openApp')}><Icon name="arrowRight" />{t('folders.open')}</button>
|
||||||
|
<button className="btn btn-sm btn-ghost btn-icon" onClick={() => api.reveal(p.id).catch(e => setError(errorText(e)))} aria-label={t('folders.reveal')} title={t('folders.reveal')}><Icon name="eye" /></button>
|
||||||
<button className="btn btn-sm" onClick={() => check(p)} disabled={!!busy}><Icon name="shield" />{t('folders.check')}</button>
|
<button className="btn btn-sm" onClick={() => check(p)} disabled={!!busy}><Icon name="shield" />{t('folders.check')}</button>
|
||||||
<button className="btn btn-sm" onClick={() => gallery(p)} disabled={!!busy} title={t('folders.galleryHint')}><Icon name="image" />{t('folders.gallery')}</button>
|
<button className="btn btn-sm" onClick={() => gallery(p)} disabled={!!busy} title={t('folders.galleryHint')}><Icon name="image" />{t('folders.gallery')}</button>
|
||||||
<button className="btn btn-sm btn-ghost btn-icon" onClick={() => remove(p)} disabled={!!busy} aria-label={t('folders.remove', { name: p.name })} title={t('folders.remove', { name: p.name })}><Icon name="trash" /></button>
|
<button className="btn btn-sm btn-ghost btn-icon" onClick={() => remove(p)} disabled={!!busy} aria-label={t('folders.remove', { name: p.name })} title={t('folders.remove', { name: p.name })}><Icon name="trash" /></button>
|
||||||
|
|
@ -119,8 +132,12 @@ export function AppFolders() {
|
||||||
<Seg value={profile} onChange={setProfile} label={t('folders.profile')} options={[['app', t('profile.app')], ['game', t('profile.game')], ['subscription-app', t('profile.subscription-app')]]} />
|
<Seg value={profile} onChange={setProfile} label={t('folders.profile')} options={[['app', t('profile.app')], ['game', t('profile.game')], ['subscription-app', t('profile.subscription-app')]]} />
|
||||||
<span className="small muted">{t(`folders.profileHint.${profile}` as 'folders.profileHint.app')}</span>
|
<span className="small muted">{t(`folders.profileHint.${profile}` as 'folders.profileHint.app')}</span>
|
||||||
</div>
|
</div>
|
||||||
<button className="btn" onClick={init} disabled={!!busy}><Icon name="folderPlus" />{t('folders.chooseAndStart')}</button>
|
<div className="actions">
|
||||||
|
<button className="btn" onClick={fastlane} disabled={!!busy} title={t('folders.fastlaneHint')}><Icon name="download" />{t('folders.fastlane')}</button>
|
||||||
|
<button className="btn btn-primary" onClick={init} disabled={!!busy}><Icon name="folderPlus" />{t('folders.chooseAndStart')}</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<p className="small muted act-note"><Icon name="info" />{t('folders.newNote')}</p>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
{run && (
|
{run && (
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,14 @@ import { type AppTab, TAB_ICON, TAB_KEY, tabsFor, useNav } from '../nav';
|
||||||
import { useData } from '../store';
|
import { useData } from '../store';
|
||||||
import { Icon } from '../ui/icons';
|
import { Icon } from '../ui/icons';
|
||||||
import { AppIcon, Chip, Notice, PhaseChip, StoreBadge, StoreOnlyTag, StudioMark } from '../ui/kit';
|
import { AppIcon, Chip, Notice, PhaseChip, StoreBadge, StoreOnlyTag, StudioMark } from '../ui/kit';
|
||||||
|
import { AppInfoTab } from './tabs/AppInfo';
|
||||||
|
import { ArtTab } from './tabs/Art';
|
||||||
import { CatalogTab } from './tabs/Catalog';
|
import { CatalogTab } from './tabs/Catalog';
|
||||||
import { ChecksTab } from './tabs/Checks';
|
import { ChecksTab } from './tabs/Checks';
|
||||||
import { HealthTab } from './tabs/Health';
|
import { HealthTab } from './tabs/Health';
|
||||||
|
import { GrowthTab } from './tabs/Growth';
|
||||||
import { ListingsTab } from './tabs/Listings';
|
import { ListingsTab } from './tabs/Listings';
|
||||||
|
import { PricesTab } from './tabs/Prices';
|
||||||
import { ReleasesTab } from './tabs/Releases';
|
import { ReleasesTab } from './tabs/Releases';
|
||||||
import { ReviewsTab } from './tabs/Reviews';
|
import { ReviewsTab } from './tabs/Reviews';
|
||||||
import { TestFlightTab } from './tabs/TestFlight';
|
import { TestFlightTab } from './tabs/TestFlight';
|
||||||
|
|
@ -59,24 +63,25 @@ function StoreOnlyBanner({ app }: { app: UnifiedApp }) {
|
||||||
const d = useData();
|
const d = useData();
|
||||||
const [busy, setBusy] = useState(false);
|
const [busy, setBusy] = useState(false);
|
||||||
const [profile, setProfile] = useState<'app' | 'game' | 'subscription-app'>('app');
|
const [profile, setProfile] = useState<'app' | 'game' | 'subscription-app'>('app');
|
||||||
const link = async (init: boolean) => {
|
const link = async (how: 'add' | 'init' | 'fastlane') => {
|
||||||
setBusy(true);
|
setBusy(true);
|
||||||
try {
|
try {
|
||||||
const p = init ? await api.initProject(profile) : await api.addProject();
|
const p = how === 'init' ? await api.initProject(profile) : how === 'fastlane' ? await api.importFastlane(profile) : await api.addProject();
|
||||||
if (p) {
|
if (p) {
|
||||||
await d.updateOverrides(o => withLink(o, app, p.id));
|
await d.updateOverrides(o => withLink(o, app, p.id));
|
||||||
await d.reload();
|
await d.reload();
|
||||||
d.toast({ kind: 'ok', title: t('app.linked', { name: p.name }), detail: init ? t('folders.startedDetail') : undefined });
|
d.toast({ kind: 'ok', title: t('app.linked', { name: p.name }), detail: how === 'init' ? t('folders.startedDetail') : how === 'fastlane' ? t('folders.importedDetail') : undefined });
|
||||||
}
|
}
|
||||||
} catch (e) { d.toast({ kind: 'bad', title: t('app.linkFailed'), detail: errorText(e) }); } finally { setBusy(false); }
|
} catch (e) { d.toast({ kind: 'bad', title: t('app.linkFailed'), detail: errorText(e) }); } finally { setBusy(false); }
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Notice tone="info" icon="cloud" action={<div className="actions">
|
<Notice tone="info" icon="cloud" action={<div className="actions">
|
||||||
<button className="btn btn-sm btn-primary" onClick={() => link(false)} disabled={busy}><Icon name="link" />{t('app.linkFolder')}</button>
|
<button className="btn btn-sm btn-primary" onClick={() => link('add')} disabled={busy}><Icon name="link" />{t('app.linkFolder')}</button>
|
||||||
<select className="input input-sm" value={profile} onChange={e => setProfile(e.target.value as typeof profile)} aria-label={t('folders.profile')}>
|
<select className="input input-sm" value={profile} onChange={e => setProfile(e.target.value as typeof profile)} aria-label={t('folders.profile')}>
|
||||||
<option value="app">{t('profile.app')}</option><option value="game">{t('profile.game')}</option><option value="subscription-app">{t('profile.subscription-app')}</option>
|
<option value="app">{t('profile.app')}</option><option value="game">{t('profile.game')}</option><option value="subscription-app">{t('profile.subscription-app')}</option>
|
||||||
</select>
|
</select>
|
||||||
<button className="btn btn-sm" onClick={() => link(true)} disabled={busy}><Icon name="folderPlus" />{t('app.initHere')}</button>
|
<button className="btn btn-sm" onClick={() => link('init')} disabled={busy}><Icon name="folderPlus" />{t('app.initHere')}</button>
|
||||||
|
<button className="btn btn-sm" onClick={() => link('fastlane')} disabled={busy} title={t('folders.fastlaneHint')}><Icon name="download" />{t('folders.fastlane')}</button>
|
||||||
</div>}>
|
</div>}>
|
||||||
<b>{t('app.storeOnlyTitle')}</b> {t('app.storeOnlyText')}
|
<b>{t('app.storeOnlyTitle')}</b> {t('app.storeOnlyText')}
|
||||||
</Notice>
|
</Notice>
|
||||||
|
|
@ -144,10 +149,14 @@ export function AppView({ app, tab }: { app: UnifiedApp; tab: AppTab }) {
|
||||||
<div role="tabpanel" id="tabpanel" aria-labelledby={`tab-${tab}`} className="stack" style={{ gap: 16 }}>
|
<div role="tabpanel" id="tabpanel" aria-labelledby={`tab-${tab}`} className="stack" style={{ gap: 16 }}>
|
||||||
{tab === 'releases' && <ReleasesTab app={app} />}
|
{tab === 'releases' && <ReleasesTab app={app} />}
|
||||||
{tab === 'catalog' && app.project && <CatalogTab project={app.project} />}
|
{tab === 'catalog' && app.project && <CatalogTab project={app.project} />}
|
||||||
|
{tab === 'prices' && app.project && <PricesTab project={app.project} />}
|
||||||
{tab === 'listings' && app.project && <ListingsTab project={app.project} />}
|
{tab === 'listings' && app.project && <ListingsTab project={app.project} />}
|
||||||
|
{tab === 'art' && app.project && <ArtTab project={app.project} />}
|
||||||
{tab === 'health' && <HealthTab app={app} />}
|
{tab === 'health' && <HealthTab app={app} />}
|
||||||
{tab === 'reviews' && <ReviewsTab app={app} />}
|
{tab === 'reviews' && <ReviewsTab app={app} />}
|
||||||
{tab === 'testflight' && <TestFlightTab app={app} />}
|
{tab === 'testflight' && <TestFlightTab app={app} />}
|
||||||
|
{tab === 'growth' && <GrowthTab app={app} />}
|
||||||
|
{tab === 'appinfo' && app.project && <AppInfoTab project={app.project} />}
|
||||||
{tab === 'checks' && app.project && <ChecksTab project={app.project} />}
|
{tab === 'checks' && app.project && <ChecksTab project={app.project} />}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,31 @@
|
||||||
// First-run guide: what the app does, add or start an app folder, store keys into the keychain, local tools, and the
|
// First-run guide: what the app does, the studio the keys belong to (pick one or create it), add / start / import an
|
||||||
// first read of the stores. Every step can be skipped; it opens again from Settings or the command palette.
|
// app folder (fastlane import: plan in a native dialog first), store keys into the keychain, local tools, and the first
|
||||||
|
// read of the stores. Every step can be skipped; it opens again from Settings or the command palette.
|
||||||
import { type KeyboardEvent, useEffect, useRef, useState } from 'react';
|
import { type KeyboardEvent, useEffect, useRef, useState } from 'react';
|
||||||
import { api, errorText, newJob } from '../api';
|
import { api, errorText, newJob, type StudioColor } from '../api';
|
||||||
import { devSwitch } from '../dev/switches';
|
import { devSwitch } from '../dev/switches';
|
||||||
import { type Key, t } from '../i18n';
|
import { type Key, t } from '../i18n';
|
||||||
import { ago } from '../lib/format';
|
import { ago } from '../lib/format';
|
||||||
import { useData } from '../store';
|
import { useData } from '../store';
|
||||||
import { Icon, type IconName, Mark } from '../ui/icons';
|
import { Icon, type IconName, Mark } from '../ui/icons';
|
||||||
import { Illo } from '../ui/illustrations';
|
import { Illo } from '../ui/illustrations';
|
||||||
import { AppIcon, Chip, Notice, Seg } from '../ui/kit';
|
import { AppIcon, Chip, Notice, Seg, StudioMark } from '../ui/kit';
|
||||||
|
import { Swatches } from './Accounts';
|
||||||
|
|
||||||
const STEPS: [Key, IconName][] = [['wz.s1', 'sparkle'], ['wz.s2', 'folder'], ['wz.s3', 'key'], ['wz.s4', 'package'], ['wz.s5', 'refresh']];
|
const STEPS: [Key, IconName][] = [['wz.s1', 'sparkle'], ['wz.s0', 'building'], ['wz.s2', 'folder'], ['wz.s3', 'key'], ['wz.s4', 'package'], ['wz.s5', 'refresh']];
|
||||||
|
const LAST = STEPS.length - 1;
|
||||||
type Profile = 'app' | 'game' | 'subscription-app';
|
type Profile = 'app' | 'game' | 'subscription-app';
|
||||||
|
|
||||||
export function Onboarding({ onClose }: { onClose: () => void }) {
|
export function Onboarding({ onClose }: { onClose: () => void }) {
|
||||||
const d = useData();
|
const d = useData();
|
||||||
const v = devSwitch('start');
|
const v = devSwitch('start');
|
||||||
const [step, setStep] = useState(() => (v.startsWith('welcome:') ? Math.max(0, Math.min(4, Number(v.split(':')[1]) - 1)) : 0));
|
const [step, setStep] = useState(() => (v.startsWith('welcome:') ? Math.max(0, Math.min(LAST, Number(v.split(':')[1]) - 1)) : 0));
|
||||||
const [busy, setBusy] = useState<string | null>(null);
|
const [busy, setBusy] = useState<string | null>(null);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
const [mode, setMode] = useState<'add' | 'init'>('add');
|
const [mode, setMode] = useState<'add' | 'init' | 'fastlane'>('add');
|
||||||
|
const [studio, setStudio] = useState<string | null>(() => d.studios[0]?.id ?? null);
|
||||||
|
const [studioName, setStudioName] = useState('');
|
||||||
|
const [studioColor, setStudioColor] = useState<StudioColor>('indigo');
|
||||||
const [profile, setProfile] = useState<Profile>('app');
|
const [profile, setProfile] = useState<Profile>('app');
|
||||||
const [playLabel, setPlayLabel] = useState('');
|
const [playLabel, setPlayLabel] = useState('');
|
||||||
const [appleLabel, setAppleLabel] = useState('');
|
const [appleLabel, setAppleLabel] = useState('');
|
||||||
|
|
@ -57,7 +63,12 @@ export function Onboarding({ onClose }: { onClose: () => void }) {
|
||||||
try { const r = await api.installTool(tool, job); d.updateToast(tid, { kind: 'ok', title: t('deps.installedToast', { tool }), detail: r, job: undefined, progress: undefined }); }
|
try { const r = await api.installTool(tool, job); d.updateToast(tid, { kind: 'ok', title: t('deps.installedToast', { tool }), detail: r, job: undefined, progress: undefined }); }
|
||||||
catch (e) { d.updateToast(tid, { kind: 'bad', title: t('deps.failed'), detail: errorText(e), job: undefined, progress: undefined }); }
|
catch (e) { d.updateToast(tid, { kind: 'bad', title: t('deps.failed'), detail: errorText(e), job: undefined, progress: undefined }); }
|
||||||
});
|
});
|
||||||
const done = [d.projects.length > 0 || step > 0, d.projects.length > 0, d.accounts.length > 0, tools.length > 0 && tools.filter(x => x.id === 'ffmpeg' || x.id === 'chrome').every(x => x.found), !!d.live];
|
const studioOf = d.studios.find(x => x.id === studio) ?? null;
|
||||||
|
const createStudio = () => act('studio', async () => {
|
||||||
|
const s = await api.saveStudio(null, studioName.trim(), studioColor);
|
||||||
|
setStudio(s.id); setStudioName('');
|
||||||
|
});
|
||||||
|
const done = [d.projects.length > 0 || step > 0, d.studios.length > 0 || step > 1, d.projects.length > 0, d.accounts.length > 0, tools.length > 0 && tools.filter(x => x.id === 'ffmpeg' || x.id === 'chrome').every(x => x.found), !!d.live];
|
||||||
const liveApps = d.live?.value.apps.length ?? 0;
|
const liveApps = d.live?.value.apps.length ?? 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -91,27 +102,62 @@ export function Onboarding({ onClose }: { onClose: () => void }) {
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{step === 1 && (
|
{step === 1 && (
|
||||||
|
<>
|
||||||
|
<h2 id="wz-title" tabIndex={-1}>{t('wz.studioTitle')}</h2>
|
||||||
|
<p className="lead">{t('wz.studioLead')}</p>
|
||||||
|
{d.studios.length > 0 && (
|
||||||
|
<div className="checklist" role="radiogroup" aria-label={t('wz.studioPick')}>
|
||||||
|
{d.studios.map(x => (
|
||||||
|
<button key={x.id} type="button" role="radio" aria-checked={studio === x.id} className="ck ck-pick" onClick={() => setStudio(x.id)}>
|
||||||
|
<StudioMark studio={x} />
|
||||||
|
<div className="grow"><div className="t">{x.name}</div><div className="s">{t('wz.studioAccounts', { count: d.accounts.filter(a => a.studio === x.id).length })}</div></div>
|
||||||
|
{studio === x.id && <Chip tone="accent" icon="check">{t('wz.studioPicked')}</Chip>}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
<button type="button" role="radio" aria-checked={studio === null} className="ck ck-pick" onClick={() => setStudio(null)}>
|
||||||
|
<StudioMark studio={null} /><div className="grow"><div className="t">{t('studio.none')}</div><div className="s">{t('wz.studioNoneHint')}</div></div>
|
||||||
|
{studio === null && <Chip tone="accent" icon="check">{t('wz.studioPicked')}</Chip>}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<form className="choice studio-new" onSubmit={e => { e.preventDefault(); if (studioName.trim()) createStudio(); }}>
|
||||||
|
<span className="ch-icon"><Icon name="building" /></span>
|
||||||
|
<b>{d.studios.length ? t('wz.studioAnother') : t('wz.studioNew')}</b>
|
||||||
|
<span>{t('wz.studioNewText')}</span>
|
||||||
|
<div className="row" style={{ gap: 12, flexWrap: 'wrap' }}>
|
||||||
|
<input className="input" style={{ maxWidth: 260 }} value={studioName} onChange={e => setStudioName(e.target.value)} placeholder={t('wz.studioPlaceholder')} aria-label={t('studio.name')} maxLength={60} />
|
||||||
|
<Swatches value={studioColor} onChange={setStudioColor} name={studioName} />
|
||||||
|
</div>
|
||||||
|
<div><button className="btn btn-sm btn-primary" type="submit" disabled={!studioName.trim() || !!busy}><Icon name="plus" />{t('wz.studioCreate')}</button></div>
|
||||||
|
</form>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
{step === 2 && (
|
||||||
<>
|
<>
|
||||||
<h2 id="wz-title" tabIndex={-1}>{t('wz.appsTitle')}</h2>
|
<h2 id="wz-title" tabIndex={-1}>{t('wz.appsTitle')}</h2>
|
||||||
<p className="lead">{t('wz.appsLead')}</p>
|
<p className="lead">{t('wz.appsLead')}</p>
|
||||||
<div className="choice-grid">
|
<div className="choice-grid three">
|
||||||
<button className="choice" aria-pressed={mode === 'add'} onClick={() => setMode('add')}>
|
<button className="choice" aria-pressed={mode === 'add'} onClick={() => setMode('add')}>
|
||||||
<span className="ch-icon"><Icon name="folder" /></span><b>{t('wz.addTitle')}</b><span>{t('wz.addText')}</span>
|
<span className="ch-icon"><Icon name="folder" /></span><b>{t('wz.addTitle')}</b><span>{t('wz.addText')}</span>
|
||||||
</button>
|
</button>
|
||||||
<button className="choice" aria-pressed={mode === 'init'} onClick={() => setMode('init')}>
|
<button className="choice" aria-pressed={mode === 'init'} onClick={() => setMode('init')}>
|
||||||
<span className="ch-icon"><Icon name="sparkle" /></span><b>{t('wz.initTitle')}</b><span>{t('wz.initText')}</span>
|
<span className="ch-icon"><Icon name="sparkle" /></span><b>{t('wz.initTitle')}</b><span>{t('wz.initText')}</span>
|
||||||
</button>
|
</button>
|
||||||
|
<button className="choice" aria-pressed={mode === 'fastlane'} onClick={() => setMode('fastlane')}>
|
||||||
|
<span className="ch-icon"><Icon name="download" /></span><b>{t('wz.fastlaneTitle')}</b><span>{t('wz.fastlaneText')}</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{mode === 'init' && (
|
{mode !== 'add' && (
|
||||||
<div className="stack" style={{ gap: 8 }}>
|
<div className="stack" style={{ gap: 8 }}>
|
||||||
<Seg value={profile} onChange={setProfile} label={t('folders.profile')} options={[['app', t('profile.app')], ['game', t('profile.game')], ['subscription-app', t('profile.subscription-app')]]} />
|
<Seg value={profile} onChange={setProfile} label={t('folders.profile')} options={[['app', t('profile.app')], ['game', t('profile.game')], ['subscription-app', t('profile.subscription-app')]]} />
|
||||||
<span className="small muted">{t(`folders.profileHint.${profile}` as Key)}</span>
|
<span className="small muted">{t(`folders.profileHint.${profile}` as Key)}</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="actions">
|
<div className="actions">
|
||||||
{mode === 'add'
|
{mode === 'add' ? <button className="btn btn-primary" onClick={() => act('add', () => api.addProject())} disabled={!!busy}><Icon name="folderPlus" />{t('action.addFolder')}</button>
|
||||||
? <button className="btn btn-primary" onClick={() => act('add', () => api.addProject())} disabled={!!busy}><Icon name="folderPlus" />{t('action.addFolder')}</button>
|
: mode === 'init' ? <button className="btn btn-primary" onClick={() => act('init', () => api.initProject(profile))} disabled={!!busy}><Icon name="folderPlus" />{t('folders.chooseAndStart')}</button>
|
||||||
: <button className="btn btn-primary" onClick={() => act('init', () => api.initProject(profile))} disabled={!!busy}><Icon name="folderPlus" />{t('folders.chooseAndStart')}</button>}
|
: <button className="btn btn-primary" onClick={() => act('fastlane', () => api.importFastlane(profile))} disabled={!!busy}><Icon name="download" />{t('wz.fastlaneGo')}</button>}
|
||||||
|
{mode === 'fastlane' && <span className="small muted">{t('wz.fastlaneNote')}</span>}
|
||||||
</div>
|
</div>
|
||||||
{d.projects.length > 0 && (
|
{d.projects.length > 0 && (
|
||||||
<div className="checklist">
|
<div className="checklist">
|
||||||
|
|
@ -120,17 +166,18 @@ export function Onboarding({ onClose }: { onClose: () => void }) {
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{step === 2 && (
|
{step === 3 && (
|
||||||
<>
|
<>
|
||||||
<h2 id="wz-title" tabIndex={-1}>{t('wz.keysTitle')}</h2>
|
<h2 id="wz-title" tabIndex={-1}>{t('wz.keysTitle')}</h2>
|
||||||
<p className="lead">{t('wz.keysLead')}</p>
|
<p className="lead">{t('wz.keysLead')}</p>
|
||||||
|
<span className="row small" style={{ gap: 8 }}><StudioMark studio={studioOf} size="sm" />{studioOf ? t('wz.keysInto', { name: studioOf.name }) : t('wz.keysNoStudio')}<button className="link" onClick={() => setStep(1)}>{t('wz.change')}</button></span>
|
||||||
<div className="choice-grid">
|
<div className="choice-grid">
|
||||||
<form className="choice" onSubmit={e => { e.preventDefault(); act('play', async () => { if (await api.addPlayAccount(playLabel)) setPlayLabel(''); }); }}>
|
<form className="choice" onSubmit={e => { e.preventDefault(); act('play', async () => { if (await api.addPlayAccount(playLabel, studio)) setPlayLabel(''); }); }}>
|
||||||
<span className="ch-icon"><Icon name="key" /></span><b>Google Play</b><span>{t('accounts.playHow')}</span>
|
<span className="ch-icon"><Icon name="key" /></span><b>Google Play</b><span>{t('accounts.playHow')}</span>
|
||||||
<input className="input" value={playLabel} onChange={e => setPlayLabel(e.target.value)} placeholder={t('accounts.playPlaceholder')} aria-label={t('accounts.label')} maxLength={60} />
|
<input className="input" value={playLabel} onChange={e => setPlayLabel(e.target.value)} placeholder={t('accounts.playPlaceholder')} aria-label={t('accounts.label')} maxLength={60} />
|
||||||
<div><button className="btn btn-sm btn-primary" type="submit" disabled={!playLabel.trim() || !!busy}>{t('accounts.choosePlay')}</button></div>
|
<div><button className="btn btn-sm btn-primary" type="submit" disabled={!playLabel.trim() || !!busy}>{t('accounts.choosePlay')}</button></div>
|
||||||
</form>
|
</form>
|
||||||
<form className="choice" onSubmit={e => { e.preventDefault(); act('apple', async () => { if (await api.addAppleAccount(appleLabel, keyId, issuerId)) { setAppleLabel(''); setKeyId(''); setIssuerId(''); } }); }}>
|
<form className="choice" onSubmit={e => { e.preventDefault(); act('apple', async () => { if (await api.addAppleAccount(appleLabel, keyId, issuerId, studio)) { setAppleLabel(''); setKeyId(''); setIssuerId(''); } }); }}>
|
||||||
<span className="ch-icon"><Icon name="key" /></span><b>App Store Connect</b><span>{t('accounts.appleSub')}</span>
|
<span className="ch-icon"><Icon name="key" /></span><b>App Store Connect</b><span>{t('accounts.appleSub')}</span>
|
||||||
<input className="input" value={appleLabel} onChange={e => setAppleLabel(e.target.value)} placeholder={t('accounts.applePlaceholder')} aria-label={t('accounts.label')} maxLength={60} />
|
<input className="input" value={appleLabel} onChange={e => setAppleLabel(e.target.value)} placeholder={t('accounts.applePlaceholder')} aria-label={t('accounts.label')} maxLength={60} />
|
||||||
<div className="row"><input className="input mono" value={keyId} onChange={e => setKeyId(e.target.value.toUpperCase())} placeholder={t('accounts.keyId')} aria-label={t('accounts.keyId')} maxLength={10} />
|
<div className="row"><input className="input mono" value={keyId} onChange={e => setKeyId(e.target.value.toUpperCase())} placeholder={t('accounts.keyId')} aria-label={t('accounts.keyId')} maxLength={10} />
|
||||||
|
|
@ -157,7 +204,7 @@ export function Onboarding({ onClose }: { onClose: () => void }) {
|
||||||
<Notice tone="info" icon="shield">{t('accounts.safety')}</Notice>
|
<Notice tone="info" icon="shield">{t('accounts.safety')}</Notice>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{step === 3 && (
|
{step === 4 && (
|
||||||
<>
|
<>
|
||||||
<h2 id="wz-title" tabIndex={-1}>{t('wz.toolsTitle')}</h2>
|
<h2 id="wz-title" tabIndex={-1}>{t('wz.toolsTitle')}</h2>
|
||||||
<p className="lead">{t('wz.toolsLead')}</p>
|
<p className="lead">{t('wz.toolsLead')}</p>
|
||||||
|
|
@ -176,7 +223,7 @@ export function Onboarding({ onClose }: { onClose: () => void }) {
|
||||||
<p className="small muted">{t('wz.toolsNote')} <code className="selectable">storebound doctor</code></p>
|
<p className="small muted">{t('wz.toolsNote')} <code className="selectable">storebound doctor</code></p>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{step === 4 && (
|
{step === 5 && (
|
||||||
<>
|
<>
|
||||||
<Illo name="cloud" />
|
<Illo name="cloud" />
|
||||||
<h2 id="wz-title" tabIndex={-1}>{t('wz.readTitle')}</h2>
|
<h2 id="wz-title" tabIndex={-1}>{t('wz.readTitle')}</h2>
|
||||||
|
|
@ -191,10 +238,10 @@ export function Onboarding({ onClose }: { onClose: () => void }) {
|
||||||
{error && <Notice tone="bad">{error}</Notice>}
|
{error && <Notice tone="bad">{error}</Notice>}
|
||||||
</div>
|
</div>
|
||||||
<div className="wz-foot">
|
<div className="wz-foot">
|
||||||
<button className="btn btn-ghost" onClick={onClose}>{step === 4 ? t('common.close') : t('wz.skip')}</button>
|
<button className="btn btn-ghost" onClick={onClose}>{step === LAST ? t('common.close') : t('wz.skip')}</button>
|
||||||
<span className="grow" />
|
<span className="grow" />
|
||||||
{step > 0 && <button className="btn" onClick={() => setStep(s => s - 1)}><Icon name="arrowLeft" />{t('wz.back')}</button>}
|
{step > 0 && <button className="btn" onClick={() => setStep(s => s - 1)}><Icon name="arrowLeft" />{t('wz.back')}</button>}
|
||||||
{step < 4 ? <button className="btn btn-primary" onClick={() => setStep(s => s + 1)}>{t('wz.next')}<Icon name="arrowRight" /></button>
|
{step < LAST ? <button className="btn btn-primary" onClick={() => setStep(s => s + 1)}>{t('wz.next')}<Icon name="arrowRight" /></button>
|
||||||
: <button className="btn btn-primary" onClick={onClose}><Icon name="check" />{t('wz.finish')}</button>}
|
: <button className="btn btn-primary" onClick={onClose}><Icon name="check" />{t('wz.finish')}</button>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ import { filterSort, groupByStudio, type ListRow, type SortBy, studioCounts, typ
|
||||||
import { type Attention, attention, healthSeries, type HealthSnapshot, isError, laneOf, PLAY_THRESHOLDS, STAGES, storeNow, type Tone } from '../lib/model';
|
import { type Attention, attention, healthSeries, type HealthSnapshot, isError, laneOf, PLAY_THRESHOLDS, STAGES, storeNow, type Tone } from '../lib/model';
|
||||||
import { useNav } from '../nav';
|
import { useNav } from '../nav';
|
||||||
import { useData } from '../store';
|
import { useData } from '../store';
|
||||||
|
import { exportName, portfolioCsv } from '../lib/exports';
|
||||||
|
import { useExports } from '../ui/Exports';
|
||||||
import { Icon, StoreGlyph } from '../ui/icons';
|
import { Icon, StoreGlyph } from '../ui/icons';
|
||||||
import { AppIcon, Card, Chip, Empty, Kpi, Notice, PhaseChip, Seg, Skeleton, Sparkline, StudioMark } from '../ui/kit';
|
import { AppIcon, Card, Chip, Empty, Kpi, Notice, PhaseChip, Seg, Skeleton, Sparkline, StudioMark } from '../ui/kit';
|
||||||
|
|
||||||
|
|
@ -141,6 +143,8 @@ export function Portfolio() {
|
||||||
const studioOk = view.studio === 'all' || view.studio === 'none' || d.studios.some(s => s.id === view.studio);
|
const studioOk = view.studio === 'all' || view.studio === 'none' || d.studios.some(s => s.id === view.studio);
|
||||||
const rows = filterSort(all as (ListRow & typeof all[number])[], { studio: studioOk ? view.studio : 'all', query, sort: view.sort }) as typeof all;
|
const rows = filterSort(all as (ListRow & typeof all[number])[], { studio: studioOk ? view.studio : 'all', query, sort: view.sort }) as typeof all;
|
||||||
const grouped = view.group && d.studios.length ? groupByStudio(rows, d.studios) : [{ studio: undefined as string | null | undefined, rows }];
|
const grouped = view.group && d.studios.length ? groupByStudio(rows, d.studios) : [{ studio: undefined as string | null | undefined, rows }];
|
||||||
|
useExports('portfolio', [{ id: 'portfolio-csv', label: t('export.portfolio'), icon: 'portfolio', kind: 'csv', file: exportName('storebound', 'portfolio'), disabled: visible.length ? false : t('export.noApps'),
|
||||||
|
build: () => portfolioCsv(rows.map(r => ({ name: r.app.name, studio: d.studios.find(s => s.id === r.app.studio)?.name ?? '', s: r.l ?? r.e }))) }]);
|
||||||
|
|
||||||
if (d.ready && !visible.length) {
|
if (d.ready && !visible.length) {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
184
apps/desktop/src/screens/tabs/AppInfo.tsx
Normal file
184
apps/desktop/src/screens/tabs/AppInfo.tsx
Normal file
|
|
@ -0,0 +1,184 @@
|
||||||
|
// App info & privacy: the store declarations from the config (`inspect --declarations --json`, offline) with every
|
||||||
|
// question only the owner can answer at the top. Google Play Data safety (upload: dry run, native dialog, real run;
|
||||||
|
// Play cannot read the form back, so the tab compares with the CSV storebound uploaded last), App Store App Privacy
|
||||||
|
// (no API: the answers to enter in App Store Connect), app info, export compliance and the App Review details.
|
||||||
|
import { useState } from 'react';
|
||||||
|
import { api, type DeclarationsResult, type DeclAsk, type Project } from '../../api';
|
||||||
|
import { type Key, t } from '../../i18n';
|
||||||
|
import { declarationsMd, exportName } from '../../lib/exports';
|
||||||
|
import { ago, num } from '../../lib/format';
|
||||||
|
import { useData, useRead, useWrite } from '../../store';
|
||||||
|
import { useExports, useRunExport } from '../../ui/Exports';
|
||||||
|
import { Icon, StoreGlyph } from '../../ui/icons';
|
||||||
|
import { Bar, Card, Chip, Empty, ErrorNotice, Notice, Skeleton } from '../../ui/kit';
|
||||||
|
import { WriteButton } from '../../ui/WriteButton';
|
||||||
|
import { ascUrl } from '../AppView';
|
||||||
|
|
||||||
|
const AREA: Record<DeclAsk['area'], Key> = { dataSafety: 'ai.aDataSafety', appPrivacy: 'ai.aAppPrivacy', appInfo: 'ai.aAppInfo', encryption: 'ai.aEncryption', review: 'ai.aReview' };
|
||||||
|
const PURPOSE: Record<string, Key> = {
|
||||||
|
functionality: 'ds.functionality', analytics: 'ds.analytics', communications: 'ds.communications', fraud: 'ds.fraud', advertising: 'ds.advertising', personalization: 'ds.personalization', account: 'ds.account',
|
||||||
|
};
|
||||||
|
/** "PSL_DEVICE_ID" -> "Device ID". */
|
||||||
|
export const typeLabel = (id: string): string => {
|
||||||
|
const s = id.replace(/^PSL_/, '').toLowerCase().replace(/_/g, ' ');
|
||||||
|
return (s.charAt(0).toUpperCase() + s.slice(1)).replace(/\bid\b/g, 'ID').replace(/\bsms\b/g, 'SMS');
|
||||||
|
};
|
||||||
|
const yes = (b: boolean | null | undefined): string => (b === null || b === undefined ? t('ai.notAnswered') : b ? t('common.yes') : t('common.no'));
|
||||||
|
|
||||||
|
function AskCard({ ask }: { ask: DeclAsk[] }) {
|
||||||
|
if (!ask.length) return <Notice tone="ok" icon="check">{t('ai.allAnswered')}</Notice>;
|
||||||
|
return (
|
||||||
|
<Card className="ask-card" title={t('ai.askTitle', { count: ask.length })} icon="question" sub={t('ai.askSub')} pad={false}>
|
||||||
|
<div className="list">
|
||||||
|
{ask.map(a => (
|
||||||
|
<div className="li" key={a.id}>
|
||||||
|
<span className="li-icon tone-bg-warn"><Icon name="question" /></span>
|
||||||
|
<div className="li-main"><span className="li-title">{a.text}</span><span className="fix"><Icon name="wand" />{a.fix}</span></div>
|
||||||
|
<Chip tone="outline">{t(AREA[a.area])}</Chip>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function DataSafety({ project, d, onDone }: { project: Project; d: DeclarationsResult; onDone: () => void }) {
|
||||||
|
const w = useWrite(project.id);
|
||||||
|
const run = useRunExport();
|
||||||
|
const [open, setOpen] = useState(false);
|
||||||
|
const ds = d.dataSafety;
|
||||||
|
const up = ds?.uploaded ?? null;
|
||||||
|
const asked = d.ask.filter(a => a.area === 'dataSafety').length;
|
||||||
|
return (
|
||||||
|
<Card title={t('ai.dsTitle')} icon="shield" sub={<span className="row" style={{ gap: 6 }}><StoreGlyph store="android" className="ic13" />{t('ai.dsSub')}</span>} pad={false}
|
||||||
|
actions={ds ? <>
|
||||||
|
<button className="btn btn-sm btn-ghost" onClick={() => run({ id: 'ds', label: t('export.dataSafety'), kind: 'csv', file: exportName(project.name, 'data safety'), build: () => ds.csv })}><Icon name="download" />CSV</button>
|
||||||
|
<WriteButton run={w} primary icon="upload" w={{ method: 'play.data_safety', args: {}, title: t('ai.dsUpload'), done: t('ai.dsUploaded'), after: onDone }} hint={t('ai.dsUploadHint')}>{t('ai.dsUpload')}</WriteButton>
|
||||||
|
</> : undefined}>
|
||||||
|
{!ds ? <Empty compact illo="shield" title={t('ai.dsNoneTitle')}>{t('ai.dsNoneText')}</Empty> : (
|
||||||
|
<>
|
||||||
|
<div className="card-body stack">
|
||||||
|
<dl className="kv">
|
||||||
|
<dt>{t('ai.dsCollects')}</dt><dd>{yes(ds.collectsData)}</dd>
|
||||||
|
<dt>{t('ai.dsEncrypted')}</dt><dd>{yes(ds.encryptedInTransit)}</dd>
|
||||||
|
<dt>{t('ai.dsDeletion')}</dt><dd>{yes(ds.deletionRequest)}</dd>
|
||||||
|
<dt>{t('ai.dsAccounts')}</dt><dd className="small">{ds.accountCreation.map(x => typeLabel(x.replace('ACM_', ''))).join(', ')}</dd>
|
||||||
|
</dl>
|
||||||
|
{up === null ? <Notice tone="info" icon="info">{t('ai.dsNever')}</Notice>
|
||||||
|
: !up.changes.length ? <Notice tone="ok" icon="check">{t('ai.dsSame', { when: ago(up.at) })}</Notice>
|
||||||
|
: <Notice tone="warn" action={<button className="btn btn-sm btn-ghost" onClick={() => setOpen(o => !o)} aria-expanded={open}>{open ? t('ai.hide') : t('ai.show')}</button>}>{t('ai.dsChanged', { count: up.changes.length, when: ago(up.at) })}</Notice>}
|
||||||
|
{open && up && up.changes.length > 0 && (
|
||||||
|
<ul className="note-list ds-changes">{up.changes.slice(0, 40).map((c, i) => <li key={i}><code>{c.question.replace(/^PSL_DATA_USAGE_RESPONSES:/, '')}{c.response ? ` · ${c.response}` : ''}</code>: {c.from || '∅'} → <b>{c.to || '∅'}</b></li>)}</ul>
|
||||||
|
)}
|
||||||
|
{asked > 0 && <span className="small muted row" style={{ gap: 6 }}><Icon name="question" className="ic13" />{t('ai.askedHere', { count: asked })}</span>}
|
||||||
|
</div>
|
||||||
|
{ds.types.length > 0 && (
|
||||||
|
<table className="table">
|
||||||
|
<thead><tr><th>{t('ai.colType')}</th><th>{t('ai.colCollected')}</th><th>{t('ai.colShared')}</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
{ds.types.map(x => (
|
||||||
|
<tr key={x.id}>
|
||||||
|
<td><div className="strong">{typeLabel(x.id)}</div><div className="small muted">{x.category}{x.optional ? ` · ${t('ai.optional')}` : ''}{x.ephemeral ? ` · ${t('ai.ephemeral')}` : ''}</div></td>
|
||||||
|
<td><div className="chips">{x.collect.map(p => <Chip key={p} tone="neutral" dot={false}>{t(PURPOSE[p] ?? 'ds.functionality')}</Chip>)}</div></td>
|
||||||
|
<td>{x.shared ? <div className="chips">{x.share.map(p => <Chip key={p} tone="warn" dot={false}>{t(PURPOSE[p] ?? 'ds.functionality')}</Chip>)}</div> : <span className="muted small">{t('ai.notShared')}</span>}</td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
)}
|
||||||
|
<div className="card-foot"><Icon name="info" />{t('ai.dsFoot', { rows: ds.rows })}</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function AppPrivacy({ d, appId }: { d: DeclarationsResult; appId: string | null | undefined }) {
|
||||||
|
const ap = d.appPrivacy;
|
||||||
|
if (!ap) return null;
|
||||||
|
return (
|
||||||
|
<Card title={t('ai.apTitle')} icon="lock" sub={<span className="row" style={{ gap: 6 }}><StoreGlyph store="ios" className="ic13" />{t('ai.apSub')}</span>} pad={false}
|
||||||
|
actions={<button className="btn btn-sm" onClick={() => api.openExternal(ascUrl(appId).replace(/\/distribution$/, '/distribution/privacy')).catch(() => {})}><Icon name="external" />{t('ai.apOpen')}</button>}>
|
||||||
|
<div className="card-body"><Notice tone="info" icon="info">{t('ai.apNote')}</Notice></div>
|
||||||
|
{!ap.items.length ? <Empty compact illo="shield" title={ap.fromDataSafety ? t('ai.apNoneTitle') : t('ai.apUnknownTitle')}>{ap.fromDataSafety ? t('ai.apNoneText') : t('ai.apUnknownText')}</Empty> : (
|
||||||
|
<table className="table">
|
||||||
|
<thead><tr><th>{t('ai.colAppleType')}</th><th>{t('ai.colPurposes')}</th><th>{t('ai.colLinked')}</th><th>{t('ai.colTracking')}</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
{ap.items.map(x => (
|
||||||
|
<tr key={x.apple}>
|
||||||
|
<td><div className="strong">{x.apple}</div><div className="small muted">{x.category} · {x.from.map(typeLabel).join(', ')}</div></td>
|
||||||
|
<td><div className="chips">{x.purposes.map(p => <Chip key={p} tone={/Third-Party/.test(p) ? 'warn' : 'neutral'} dot={false}>{p}</Chip>)}</div></td>
|
||||||
|
<td><Chip tone="warn" icon="question">{t('ai.ask')}</Chip></td>
|
||||||
|
<td><Chip tone={x.thirdParty ? 'warn' : 'outline'} icon="question">{x.thirdParty ? t('ai.askLikely') : t('ai.ask')}</Chip></td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
)}
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function AppInfoTab({ project }: { project: Project }) {
|
||||||
|
const data = useData();
|
||||||
|
const e = data.statusOf(project);
|
||||||
|
const r = useRead<DeclarationsResult>(project.id, 'project.declarations', { network: false });
|
||||||
|
const w = useWrite(project.id);
|
||||||
|
const name = e?.summary?.name ?? project.name;
|
||||||
|
useExports('appinfo', [
|
||||||
|
{ id: 'decl-md', label: t('export.declarations'), icon: 'clipboard', kind: 'md', file: exportName(name, 'store declarations'), disabled: r.data ? false : t('export.readFirst'), build: () => declarationsMd(name, r.data!) },
|
||||||
|
{ id: 'ds-csv', label: t('export.dataSafety'), icon: 'shield', kind: 'csv', file: exportName(name, 'data safety'), disabled: r.data?.dataSafety ? false : t('export.noDataSafety'), build: () => r.data!.dataSafety!.csv },
|
||||||
|
]);
|
||||||
|
if (!r.data) return r.error ? <ErrorNotice error={r.error} tone="bad" /> : <Card><Skeleton lines={6} block /></Card>;
|
||||||
|
const d = r.data;
|
||||||
|
const info = d.appInfo;
|
||||||
|
const enc = d.encryption;
|
||||||
|
const rv = d.review;
|
||||||
|
const cat = info?.categories ? [info.categories.primary, info.categories.primarySubOne, info.categories.primarySubTwo].filter(Boolean).join(' / ') : null;
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<AskCard ask={d.ask} />
|
||||||
|
<div className="grid g2" style={{ alignItems: 'start' }}>
|
||||||
|
{d.stores.play ? <DataSafety project={project} d={d} onDone={r.refresh} /> : <Card title={t('ai.dsTitle')} icon="shield" pad={false}><Empty compact illo="shield" title={t('ai.noPlay')}>{t('ai.noPlayText')}</Empty></Card>}
|
||||||
|
{d.stores.apple ? <AppPrivacy d={d} appId={e?.app?.platforms.ios?.ascAppId} /> : <Card title={t('ai.apTitle')} icon="lock" pad={false}><Empty compact illo="shield" title={t('ai.noApple')}>{t('ai.noAppleText')}</Empty></Card>}
|
||||||
|
</div>
|
||||||
|
{d.stores.apple && (
|
||||||
|
<div className="grid g3" style={{ alignItems: 'start' }}>
|
||||||
|
<Card title={t('ai.infoTitle')} icon="clipboard" sub={t('ai.infoSub')}
|
||||||
|
actions={<WriteButton run={w} icon="upload" w={{ method: 'apple.appinfo', args: {}, title: t('ai.infoPush'), done: t('ai.pushed') }}>{t('ai.push')}</WriteButton>}>
|
||||||
|
<dl className="kv">
|
||||||
|
<dt>{t('ai.category')}</dt><dd>{cat ?? <Chip tone="warn" icon="question">{t('ai.notSet')}</Chip>}</dd>
|
||||||
|
<dt>{t('ai.age')}</dt><dd>{info!.ageRating.length ? <span className="small">{info!.ageRating.map(a => `${a.question} = ${a.value}`).join(', ')}</span> : <Chip tone="warn" icon="question">{t('ai.ageAllNone')}</Chip>}</dd>
|
||||||
|
<dt>{t('ai.rights')}</dt><dd>{info!.contentRights ? <span className="small">{info!.contentRights === 'USES_THIRD_PARTY_CONTENT' ? t('ai.rightsThird') : t('ai.rightsOwn')}</span> : <Chip tone="warn" icon="question">{t('ai.notSet')}</Chip>}</dd>
|
||||||
|
<dt>{t('ai.price')}</dt><dd>{info!.free ? t('ai.free') : t('ai.paid')}</dd>
|
||||||
|
</dl>
|
||||||
|
</Card>
|
||||||
|
<Card title={t('ai.encTitle')} icon="lock" sub={t('ai.encSub')}
|
||||||
|
actions={<WriteButton run={w} icon="upload" disabled={enc === null} hint={enc === null ? t('ai.encUnsetHint') : undefined} w={{ method: 'apple.encryption', args: {}, title: t('ai.encPush'), done: t('ai.pushed') }}>{t('ai.encAnswer')}</WriteButton>}>
|
||||||
|
<div className="stack" style={{ gap: 8 }}>
|
||||||
|
{enc === null ? <Chip tone="warn" icon="question">{t('ai.notAnswered')}</Chip> : <Chip tone={enc ? 'info' : 'ok'}>{enc ? t('ai.encYes') : t('ai.encNo')}</Chip>}
|
||||||
|
<span className="small muted">{enc === null ? t('ai.encUnset') : enc ? t('ai.encYesText') : t('ai.encNoText')}</span>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
<Card title={t('ai.reviewTitle')} icon="users" sub={t('ai.reviewSub')}
|
||||||
|
actions={<WriteButton run={w} icon="upload" w={{ method: 'apple.review_details', args: {}, title: t('ai.reviewPush'), done: t('ai.pushed') }}>{t('ai.push')}</WriteButton>}>
|
||||||
|
<div className="stack" style={{ gap: 10 }}>
|
||||||
|
<dl className="kv">
|
||||||
|
<dt>{t('ai.signIn')}</dt><dd>{rv.signInRequired === null ? <Chip tone="warn" icon="question">{t('ai.notAnswered')}</Chip> : yes(rv.signInRequired)}</dd>
|
||||||
|
<dt>{t('ai.contact')}</dt><dd>{rv.contact ? <span className="mono-id">{rv.contact}</span> : <Chip tone="bad">{t('ai.missing')}</Chip>}</dd>
|
||||||
|
<dt>{t('ai.demo')}</dt><dd>{rv.demoAccount ? <span className="mono-id">{rv.demoAccount} · ••••••••</span> : rv.signInRequired ? <Chip tone="bad">{t('ai.missing')}</Chip> : <span className="muted small">{t('ai.demoNone')}</span>}</dd>
|
||||||
|
</dl>
|
||||||
|
<div className="stack" style={{ gap: 4 }}>
|
||||||
|
<div className="row between small"><span className="muted">{t('ai.notes')}</span><span className="num">{t('ai.notesBytes', { n: num(rv.notesBytes), max: num(rv.notesMax) })}</span></div>
|
||||||
|
<Bar value={rv.notesBytes / rv.notesMax} tone={rv.notesBytes > rv.notesMax ? 'bad' : rv.notesBytes > rv.notesMax * 0.9 ? 'warn' : 'ok'} thin label={t('ai.notes')} />
|
||||||
|
{rv.notes ? <div className="reply-box small notes-preview">{rv.notes}</div> : <span className="small muted">{t('ai.notesNone')}</span>}
|
||||||
|
</div>
|
||||||
|
<span className="small muted row" style={{ gap: 6 }}><Icon name="lock" className="ic13" />{t('ai.reviewSafe')}</span>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<p className="small muted">{t('ai.foot', { when: ago(r.at) })}</p>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
168
apps/desktop/src/screens/tabs/Art.tsx
Normal file
168
apps/desktop/src/screens/tabs/Art.tsx
Normal file
|
|
@ -0,0 +1,168 @@
|
||||||
|
// Store art: every rendered screenshot, feature graphic and app preview of the app folder per variant, language and
|
||||||
|
// size (`shots gallery --json`, offline), store check issues outlined. Images load one by one as they scroll into view
|
||||||
|
// (`project.render`, a data: URL each: the window loads no files itself). Re-render (dry run, dialog, real run), write
|
||||||
|
// the review page, open it or the folder.
|
||||||
|
import { type KeyboardEvent, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
|
import { api, errorText, type Project, type RenderImage, type RendersResult, type RenderTile, type ToolResult } from '../../api';
|
||||||
|
import { t } from '../../i18n';
|
||||||
|
import { ago, bytes, num } from '../../lib/format';
|
||||||
|
import { artRows, langIssues } from '../../lib/views';
|
||||||
|
import { useData, useRead, useWrite } from '../../store';
|
||||||
|
import { Icon } from '../../ui/icons';
|
||||||
|
import { Card, Chip, Empty, ErrorNotice, Kpi, Seg, Skeleton } from '../../ui/kit';
|
||||||
|
import { WriteButton } from '../../ui/WriteButton';
|
||||||
|
|
||||||
|
// loaded images by project + file + render time, three at a time
|
||||||
|
const cache = new Map<string, string | null>();
|
||||||
|
const waiting: (() => Promise<void>)[] = [];
|
||||||
|
let active = 0;
|
||||||
|
function pump() {
|
||||||
|
while (active < 3 && waiting.length) {
|
||||||
|
const job = waiting.shift()!;
|
||||||
|
active++;
|
||||||
|
job().finally(() => { active--; pump(); });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function loadRender(projectId: string, file: string, stamp: string): Promise<string | null> {
|
||||||
|
const key = `${projectId}|${file}|${stamp}`;
|
||||||
|
if (cache.has(key)) return Promise.resolve(cache.get(key)!);
|
||||||
|
return new Promise(resolve => {
|
||||||
|
waiting.push(async () => {
|
||||||
|
try {
|
||||||
|
const r = await api.call<ToolResult & { data?: RenderImage }>('project.render', projectId, { args: { file } });
|
||||||
|
cache.set(key, r.data?.dataUrl ?? null);
|
||||||
|
} catch { cache.set(key, null); }
|
||||||
|
resolve(cache.get(key) ?? null);
|
||||||
|
});
|
||||||
|
pump();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function Thumb({ projectId, tile, stamp, onOpen }: { projectId: string; tile: RenderTile; stamp: string; onOpen: () => void }) {
|
||||||
|
const ref = useRef<HTMLButtonElement>(null);
|
||||||
|
const file = tile.kind === 'video' ? tile.poster : tile.src;
|
||||||
|
const [src, setSrc] = useState<string | null | undefined>(file ? cache.get(`${projectId}|${file}|${stamp}`) : null);
|
||||||
|
useEffect(() => {
|
||||||
|
if (!file || src !== undefined) return;
|
||||||
|
const el = ref.current;
|
||||||
|
if (!el) return;
|
||||||
|
let alive = true;
|
||||||
|
const io = new IntersectionObserver(es => {
|
||||||
|
if (!es.some(x => x.isIntersecting)) return;
|
||||||
|
io.disconnect();
|
||||||
|
loadRender(projectId, file, stamp).then(u => { if (alive) setSrc(u); });
|
||||||
|
}, { rootMargin: '300px' });
|
||||||
|
io.observe(el);
|
||||||
|
return () => { alive = false; io.disconnect(); };
|
||||||
|
}, [projectId, file, stamp, src]);
|
||||||
|
const lvl = tile.issues.some(i => i.level === 'error') ? 'err' : tile.issues.length ? 'warn' : '';
|
||||||
|
return (
|
||||||
|
<figure className={`art-tile ${lvl}`} style={{ ['--ar' as string]: `${tile.w} / ${tile.h}` }}>
|
||||||
|
<button ref={ref} className="art-pic" onClick={onOpen} aria-label={t('art.open', { name: tile.name })}>
|
||||||
|
{src ? <img src={src} alt="" draggable={false} /> : src === null && file ? <span className="art-ph"><Icon name="image" />{t('art.tooBig')}</span> : <span className="art-ph">{tile.kind === 'video' ? <Icon name="play" /> : <span className="sk sk-block" />}</span>}
|
||||||
|
{tile.kind === 'video' && <span className="art-play"><Icon name="play" /></span>}
|
||||||
|
</button>
|
||||||
|
<figcaption><span className="mono-id">{tile.name}</span><span className="muted">{tile.w}×{tile.h}{tile.bytes ? ` · ${bytes(tile.bytes)}` : ''}</span></figcaption>
|
||||||
|
{tile.issues.length > 0 && <ul className="note-list art-issues">{tile.issues.slice(0, 2).map((i, k) => <li key={k} className={i.level}>{i.msg}</li>)}</ul>}
|
||||||
|
</figure>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Lightbox({ projectId, tiles, index, stamp, onClose, onMove }: { projectId: string; tiles: RenderTile[]; index: number; stamp: string; onClose: () => void; onMove: (i: number) => void }) {
|
||||||
|
const tile = tiles[index]!;
|
||||||
|
const file = tile.kind === 'video' ? tile.poster : tile.src;
|
||||||
|
const [src, setSrc] = useState<string | null>(null);
|
||||||
|
const root = useRef<HTMLDivElement>(null);
|
||||||
|
useEffect(() => { setSrc(null); if (file) loadRender(projectId, file, stamp).then(setSrc); }, [projectId, file, stamp]);
|
||||||
|
useEffect(() => { root.current?.focus(); }, []);
|
||||||
|
const onKey = (e: KeyboardEvent) => {
|
||||||
|
if (e.key === 'Escape') { e.preventDefault(); onClose(); }
|
||||||
|
if (e.key === 'ArrowRight') { e.preventDefault(); onMove((index + 1) % tiles.length); }
|
||||||
|
if (e.key === 'ArrowLeft') { e.preventDefault(); onMove((index - 1 + tiles.length) % tiles.length); }
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<div className="scrim lightbox" onMouseDown={e => { if (e.target === e.currentTarget) onClose(); }}>
|
||||||
|
<div className="lb" role="dialog" aria-modal="true" aria-label={tile.name} tabIndex={-1} ref={root} onKeyDown={onKey}>
|
||||||
|
<div className="lb-img">{src ? <img src={src} alt={tile.name} /> : <Skeleton lines={2} block />}</div>
|
||||||
|
<div className="lb-foot">
|
||||||
|
<div className="grow"><b className="mono-id">{tile.src}</b><div className="small muted">{tile.w}×{tile.h} · {bytes(tile.bytes)} · {num(index + 1)} / {num(tiles.length)}</div>
|
||||||
|
{tile.issues.map((i, k) => <div key={k} className={`small ${i.level === 'error' ? 'bad-ink' : 'warn-ink'}`}>{i.msg}</div>)}</div>
|
||||||
|
<button className="btn btn-sm" onClick={() => onMove((index - 1 + tiles.length) % tiles.length)} aria-label={t('art.prev')}><Icon name="arrowLeft" /></button>
|
||||||
|
<button className="btn btn-sm" onClick={() => onMove((index + 1) % tiles.length)} aria-label={t('art.next')}><Icon name="arrowRight" /></button>
|
||||||
|
<button className="btn btn-sm btn-ghost" onClick={onClose}><Icon name="x" />{t('common.close')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ArtTab({ project }: { project: Project }) {
|
||||||
|
const d = useData();
|
||||||
|
const r = useRead<RendersResult>(project.id, 'project.renders', { network: false });
|
||||||
|
const w = useWrite(project.id);
|
||||||
|
const [variant, setVariant] = useState('');
|
||||||
|
const [lang, setLang] = useState('');
|
||||||
|
const [onlyIssues, setOnlyIssues] = useState(false);
|
||||||
|
const [open, setOpen] = useState<{ tiles: RenderTile[]; i: number } | null>(null);
|
||||||
|
const data = r.data;
|
||||||
|
const v = data?.variants.find(x => x.id === variant) ?? data?.variants[0];
|
||||||
|
const langs = v?.langs.map(l => l.lang) ?? [];
|
||||||
|
const lg = langs.includes(lang) ? lang : langs[0] ?? '';
|
||||||
|
const rows = useMemo(() => (data ? artRows(data, { variant: v?.id ?? '', lang: lg, onlyIssues }) : []), [data, v, lg, onlyIssues]);
|
||||||
|
const counts = useMemo(() => (data ? langIssues(data, v?.id ?? '') : {}), [data, v]);
|
||||||
|
const dir = data?.dir ?? 'store/renders';
|
||||||
|
const reveal = useCallback((rel: string, openIt = false) => { api.reveal(project.id, rel, openIt).catch(e => d.toast({ kind: 'info', title: t('art.notThere'), detail: errorText(e) })); }, [project.id, d]);
|
||||||
|
const stamp = data?.generated ?? '';
|
||||||
|
|
||||||
|
if (!data) return r.error ? <ErrorNotice error={r.error} tone="bad" /> : <Card><Skeleton lines={6} block /></Card>;
|
||||||
|
const total = data.totals.images + data.totals.videos;
|
||||||
|
const toolbar = (
|
||||||
|
<>
|
||||||
|
<button className="btn btn-sm btn-ghost" onClick={() => reveal(dir)}><Icon name="folder" />{t('art.openFolder')}</button>
|
||||||
|
<button className="btn btn-sm btn-ghost" onClick={() => reveal(`${dir}/index.html`, true)} title={t('art.openPageHint')}><Icon name="external" />{t('art.openPage')}</button>
|
||||||
|
<WriteButton run={w} icon="layers" w={{ method: 'shots.gallery', args: {}, title: t('act.gallery'), done: t('act.galleryDone') }} hint={t('act.localHint')}>{t('art.writePage')}</WriteButton>
|
||||||
|
<WriteButton run={w} primary icon="wand" w={{ method: 'shots.render', args: lg ? { lang: lg, ...(v?.id ? { variant: v.id } : {}) } : {}, title: t('art.render', { lang: lg || t('act.allLangs') }), done: t('act.rendered'), after: r.refresh }} hint={t('act.localHint')}>{t('art.render', { lang: lg || t('act.allLangs') })}</WriteButton>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className="kpis" style={{ gridTemplateColumns: 'repeat(4, minmax(0, 1fr))' }}>
|
||||||
|
<Kpi icon="image" label={t('art.images')} value={num(data.totals.images)} sub={t('art.imagesSub', { count: langs.length })} />
|
||||||
|
<Kpi icon="play" label={t('art.videos')} value={num(data.totals.videos)} sub={t('art.videosSub')} />
|
||||||
|
<Kpi icon="alertCircle" label={t('art.errors')} value={num(data.totals.errors)} sub={t('art.errorsSub')} tone={data.totals.errors ? 'bad' : undefined} />
|
||||||
|
<Kpi icon="alert" label={t('art.warnings')} value={num(data.totals.warnings)} sub={t('art.rendered', { when: data.generated })} tone={data.totals.warnings ? 'warn' : undefined} />
|
||||||
|
</div>
|
||||||
|
<Card title={t('art.title')} icon="grid" sub={<span className="mono-id">{dir}</span>} actions={toolbar} pad={false}>
|
||||||
|
<div className="card-body art-bar">
|
||||||
|
{data.variants.length > 1 && <Seg value={v?.id ?? ''} onChange={setVariant} label={t('art.variant')} options={data.variants.map(x => [x.id, x.id ? t('gr.variant', { id: x.id }) : t('art.base')] as [string, string])} />}
|
||||||
|
<div className="fchips" role="group" aria-label={t('col.language')}>
|
||||||
|
{langs.map(l => (
|
||||||
|
<button key={l} className="fchip" aria-pressed={l === lg} onClick={() => setLang(l)}>
|
||||||
|
{l}<span className="n">{counts[l]?.tiles ?? 0}</span>{(counts[l]?.errors ?? 0) > 0 && <span className="tag-count bad">{counts[l]!.errors}</span>}{!(counts[l]?.errors) && (counts[l]?.warnings ?? 0) > 0 && <span className="tag-count warn">{counts[l]!.warnings}</span>}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<span className="grow" />
|
||||||
|
<label className="check"><input type="checkbox" checked={onlyIssues} onChange={e => setOnlyIssues(e.target.checked)} />{t('art.onlyIssues')}</label>
|
||||||
|
</div>
|
||||||
|
{!total ? (
|
||||||
|
<Empty illo="text" title={t('art.emptyTitle')}>{t('art.emptyText')}</Empty>
|
||||||
|
) : !rows.length ? <Empty compact illo="shield" title={t('art.noIssues')}>{t('art.noIssuesText')}</Empty> : (
|
||||||
|
<div className="art-rows">
|
||||||
|
{rows.map(row => (
|
||||||
|
<section className={`art-row${row.issues.some(i => i.level === 'error') ? ' bad' : ''}`} key={row.size}>
|
||||||
|
<h3><span>{row.label}</span><code>{lg}/{row.size}</code><Chip tone="outline" dot={false}>{row.store === 'apple' ? 'App Store' : 'Google Play'}</Chip><span className="muted small">{t('art.count', { count: row.tiles.length })}</span></h3>
|
||||||
|
{row.issues.length > 0 && <ul className="note-list art-issues">{row.issues.map((i, k) => <li key={k} className={i.level}>{i.msg}</li>)}</ul>}
|
||||||
|
<div className="art-tiles" style={{ ['--tw' as string]: row.size === 'feature' || /landscape/.test(row.size) ? '300px' : row.tiles[0] && row.tiles[0].w > row.tiles[0].h ? '260px' : '150px' }}>
|
||||||
|
{row.tiles.map((tile, i) => <Thumb key={tile.src} projectId={project.id} tile={tile} stamp={stamp} onOpen={() => setOpen({ tiles: row.tiles, i })} />)}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<div className="card-foot"><Icon name="info" />{t('art.foot', { when: ago(r.at) })}</div>
|
||||||
|
</Card>
|
||||||
|
{open && <Lightbox projectId={project.id} tiles={open.tiles} index={open.i} stamp={stamp} onClose={() => setOpen(null)} onMove={i => setOpen(o => (o ? { ...o, i } : o))} />}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,10 @@ import { type CatalogDiff, type CellState, parityMatrix } from '../../lib/model'
|
||||||
import { useData, useRead, useWrite } from '../../store';
|
import { useData, useRead, useWrite } from '../../store';
|
||||||
import { Icon, type IconName, StoreGlyph } from '../../ui/icons';
|
import { Icon, type IconName, StoreGlyph } from '../../ui/icons';
|
||||||
import { WriteButton } from '../../ui/WriteButton';
|
import { WriteButton } from '../../ui/WriteButton';
|
||||||
import { Card, Chip, Empty, Kpi, Notice, Skeleton } from '../../ui/kit';
|
import { Card, Chip, Empty, ErrorNotice, Kpi, Skeleton } from '../../ui/kit';
|
||||||
|
import { catalogMd, exportName } from '../../lib/exports';
|
||||||
|
import { useExports } from '../../ui/Exports';
|
||||||
|
import { useNav } from '../../nav';
|
||||||
|
|
||||||
const CELL: Record<CellState, [IconName, Key]> = { ok: ['check', 'cat.ok'], warn: ['alert', 'cat.warn'], error: ['x', 'cat.error'], na: ['dot', 'cat.na'], unknown: ['info', 'cat.unknown'] };
|
const CELL: Record<CellState, [IconName, Key]> = { ok: ['check', 'cat.ok'], warn: ['alert', 'cat.warn'], error: ['x', 'cat.error'], na: ['dot', 'cat.na'], unknown: ['info', 'cat.unknown'] };
|
||||||
|
|
||||||
|
|
@ -24,6 +27,7 @@ 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. */
|
/** 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 }) {
|
function CatalogActions({ project, products, subs, refresh }: { project: Project; products: number; subs: number; refresh: () => void }) {
|
||||||
const d = useData();
|
const d = useData();
|
||||||
|
const nav = useNav();
|
||||||
const w = useWrite(project.id);
|
const w = useWrite(project.id);
|
||||||
const e = d.statusOf(project);
|
const e = d.statusOf(project);
|
||||||
const ios = !!e?.app?.platforms.ios, android = !!e?.app?.platforms.android;
|
const ios = !!e?.app?.platforms.ios, android = !!e?.app?.platforms.android;
|
||||||
|
|
@ -45,9 +49,10 @@ function CatalogActions({ project, products, subs, refresh }: { project: Project
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="act-col">
|
<div className="act-col">
|
||||||
<div className="act-head"><Icon name="database" />{t('act.prices')}</div>
|
<div className="act-head"><Icon name="coins" />{t('act.prices')}</div>
|
||||||
|
<button className="btn btn-sm" onClick={() => nav.go({ screen: 'app', appId: project.id, tab: 'prices' })}><Icon name="coins" />{t('cat.openPrices')}</button>
|
||||||
<WriteButton run={w} icon="download" w={{ method: 'prices.export', args: {}, title: t('act.pricesExport'), done: t('act.pricesExported') }}>{t('act.pricesExport')}</WriteButton>
|
<WriteButton run={w} icon="download" w={{ method: 'prices.export', args: {}, title: t('act.pricesExport'), done: t('act.pricesExported') }}>{t('act.pricesExport')}</WriteButton>
|
||||||
<span className="small muted">{t('act.pricesImport')} <code className="selectable">storebound prices import</code></span>
|
<span className="small muted">{t('cat.pricesHere')}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p className="small muted act-note"><Icon name="shield" />{t('act.catalogNote')}</p>
|
<p className="small muted act-note"><Icon name="shield" />{t('act.catalogNote')}</p>
|
||||||
|
|
@ -60,6 +65,10 @@ export function CatalogTab({ project }: { project: Project }) {
|
||||||
const e = d.statusOf(project);
|
const e = d.statusOf(project);
|
||||||
const diff = useRead<CatalogDiff>(project.id, 'catalog.diff', { network: true, title: t('tab.catalog') });
|
const diff = useRead<CatalogDiff>(project.id, 'catalog.diff', { network: true, title: t('tab.catalog') });
|
||||||
const s = e?.summary ?? null;
|
const s = e?.summary ?? null;
|
||||||
|
const name = s?.name ?? project.name;
|
||||||
|
useExports('catalog', [
|
||||||
|
{ id: 'catalog-md', label: t('export.catalog'), icon: 'layers', kind: 'md', file: exportName(name, 'catalog parity'), disabled: diff.data ? false : t('export.readFirst'), build: () => catalogMd(name, diff.data!) },
|
||||||
|
]);
|
||||||
if (!e) return <Card><Skeleton lines={5} block /></Card>;
|
if (!e) return <Card><Skeleton lines={5} block /></Card>;
|
||||||
const rows = parityMatrix(s, diff.data);
|
const rows = parityMatrix(s, diff.data);
|
||||||
const read = !!diff.data;
|
const read = !!diff.data;
|
||||||
|
|
@ -77,7 +86,7 @@ export function CatalogTab({ project }: { project: Project }) {
|
||||||
<Kpi icon="check" label={t('cat.parity')} value={read ? `${inParity}/${rows.filter(r => r.kind !== 'extra').length}` : '–'} sub={read ? t('cat.parityRead', { when: ago(diff.at) }) : t('kpi.notRead')} tone={read && inParity < rows.length ? 'warn' : undefined} />
|
<Kpi icon="check" label={t('cat.parity')} value={read ? `${inParity}/${rows.filter(r => r.kind !== 'extra').length}` : '–'} sub={read ? t('cat.parityRead', { when: ago(diff.at) }) : t('kpi.notRead')} tone={read && inParity < rows.length ? 'warn' : undefined} />
|
||||||
<Kpi icon="globe" label={t('cat.gaps')} value={read ? gaps.length : '–'} sub={read ? t('cat.gapsSub') : t('kpi.notRead')} />
|
<Kpi icon="globe" label={t('cat.gaps')} value={read ? gaps.length : '–'} sub={read ? t('cat.gapsSub') : t('kpi.notRead')} />
|
||||||
</div>
|
</div>
|
||||||
{diff.error && <Notice tone="warn">{t('common.readFailedKeep', { error: diff.error })}</Notice>}
|
{diff.error && <ErrorNotice error={diff.error} keep />}
|
||||||
<CatalogActions project={project} products={s?.products ?? 0} subs={s?.subscriptions ?? 0} refresh={() => { diff.refresh(); }} />
|
<CatalogActions project={project} products={s?.products ?? 0} subs={s?.subscriptions ?? 0} refresh={() => { diff.refresh(); }} />
|
||||||
<Card title={t('cat.matrix')} icon="layers" sub={read ? (diff.fromCache ? t('common.cachedFrom', { when: ago(diff.at) }) : t('common.readWhen', { when: ago(diff.at) })) : t('cat.configOnly')} pad={false}
|
<Card title={t('cat.matrix')} icon="layers" sub={read ? (diff.fromCache ? t('common.cachedFrom', { when: ago(diff.at) }) : t('common.readWhen', { when: ago(diff.at) })) : t('cat.configOnly')} pad={false}
|
||||||
actions={<button className="btn btn-sm" onClick={diff.refresh} disabled={diff.loading}><Icon name="refresh" className={diff.loading ? 'spin' : undefined} />{read ? t('action.refresh') : t('cat.compare')}</button>}>
|
actions={<button className="btn btn-sm" onClick={diff.refresh} disabled={diff.loading}><Icon name="refresh" className={diff.loading ? 'spin' : undefined} />{read ? t('action.refresh') : t('cat.compare')}</button>}>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,9 @@ import { ago } from '../../lib/format';
|
||||||
import type { Finding, ValidateResult } from '../../lib/model';
|
import type { Finding, ValidateResult } from '../../lib/model';
|
||||||
import { useData, useRead } from '../../store';
|
import { useData, useRead } from '../../store';
|
||||||
import { Icon } from '../../ui/icons';
|
import { Icon } from '../../ui/icons';
|
||||||
import { Card, Chip, Empty, Notice, Skeleton } from '../../ui/kit';
|
import { Card, Chip, Empty, ErrorNotice, Skeleton } from '../../ui/kit';
|
||||||
|
import { exportName, validateMd } from '../../lib/exports';
|
||||||
|
import { useExports } from '../../ui/Exports';
|
||||||
|
|
||||||
const LEVEL: Record<Finding['level'], ['bad' | 'warn' | 'ok', 'alertCircle' | 'alert' | 'check']> = { blocker: ['bad', 'alertCircle'], warn: ['warn', 'alert'], ok: ['ok', 'check'] };
|
const LEVEL: Record<Finding['level'], ['bad' | 'warn' | 'ok', 'alertCircle' | 'alert' | 'check']> = { blocker: ['bad', 'alertCircle'], warn: ['warn', 'alert'], ok: ['ok', 'check'] };
|
||||||
|
|
||||||
|
|
@ -14,6 +16,8 @@ export function ChecksTab({ project }: { project: Project }) {
|
||||||
const d = useData();
|
const d = useData();
|
||||||
const e = d.statusOf(project);
|
const e = d.statusOf(project);
|
||||||
const v = useRead<ValidateResult>(project.id, 'validate', { network: true, title: t('checks.validate') });
|
const v = useRead<ValidateResult>(project.id, 'validate', { network: true, title: t('checks.validate') });
|
||||||
|
const name = e?.summary?.name ?? project.name;
|
||||||
|
useExports('checks', [{ id: 'validate-md', label: t('export.validate'), icon: 'shield', kind: 'md', file: exportName(name, 'store readiness'), disabled: v.data ? false : t('export.readFirst'), build: () => validateMd(name, v.data!, v.at) }]);
|
||||||
const problems = [...(e?.errors ?? []), ...(e?.check?.problems ?? [])];
|
const problems = [...(e?.errors ?? []), ...(e?.check?.problems ?? [])];
|
||||||
const warnings = e?.check?.warnings ?? [];
|
const warnings = e?.check?.warnings ?? [];
|
||||||
const findings = [...(v.data?.findings ?? [])].sort((a, b) => ['blocker', 'warn', 'ok'].indexOf(a.level) - ['blocker', 'warn', 'ok'].indexOf(b.level));
|
const findings = [...(v.data?.findings ?? [])].sort((a, b) => ['blocker', 'warn', 'ok'].indexOf(a.level) - ['blocker', 'warn', 'ok'].indexOf(b.level));
|
||||||
|
|
@ -32,7 +36,7 @@ export function ChecksTab({ project }: { project: Project }) {
|
||||||
</Card>
|
</Card>
|
||||||
<Card title={t('checks.validate')} icon="layers" sub={v.data ? (v.fromCache ? t('common.cachedFrom', { when: ago(v.at) }) : t('common.readWhen', { when: ago(v.at) })) : t('checks.validateSub')} pad={false}
|
<Card title={t('checks.validate')} icon="layers" sub={v.data ? (v.fromCache ? t('common.cachedFrom', { when: ago(v.at) }) : t('common.readWhen', { when: ago(v.at) })) : t('checks.validateSub')} pad={false}
|
||||||
actions={<button className="btn btn-sm" onClick={v.refresh} disabled={v.loading}><Icon name="refresh" />{v.data ? t('action.refresh') : t('checks.run')}</button>}>
|
actions={<button className="btn btn-sm" onClick={v.refresh} disabled={v.loading}><Icon name="refresh" />{v.data ? t('action.refresh') : t('checks.run')}</button>}>
|
||||||
{v.error && <div className="card-body"><Notice tone="warn">{v.error}</Notice></div>}
|
{v.error && <div className="card-body"><ErrorNotice error={v.error} keep={!!v.data} /></div>}
|
||||||
{!v.data ? (
|
{!v.data ? (
|
||||||
v.loading && !v.error ? <div className="card-body"><Skeleton lines={4} /></div> : <Empty compact illo="cloud" title={t('checks.validateEmpty')}>{t('checks.validateEmptyText')}</Empty>
|
v.loading && !v.error ? <div className="card-body"><Skeleton lines={4} /></div> : <Empty compact illo="cloud" title={t('checks.validateEmpty')}>{t('checks.validateEmptyText')}</Empty>
|
||||||
) : !findings.length ? <Empty compact illo="shield" title={t('checks.ready')}>{t('checks.readyText')}</Empty> : (
|
) : !findings.length ? <Empty compact illo="shield" title={t('checks.ready')}>{t('checks.readyText')}</Empty> : (
|
||||||
|
|
|
||||||
189
apps/desktop/src/screens/tabs/Growth.tsx
Normal file
189
apps/desktop/src/screens/tabs/Growth.tsx
Normal file
|
|
@ -0,0 +1,189 @@
|
||||||
|
// Growth: store analytics snapshots against the listing changes from git (`analytics compare --json`, offline; a new
|
||||||
|
// snapshot and the App Store report request are confirm-gated writes), App Store Product Page Optimization tests
|
||||||
|
// (status read; create and upload treatments: dry run, dialog, real run; start / stop are owner actions with their
|
||||||
|
// own dialog, never MCP tools), and Google Play store listing experiments (no API: Play Console).
|
||||||
|
import { useMemo, useState } from 'react';
|
||||||
|
import { type AnalyticsCompare, api, type PpoStatus, type PpoTest } from '../../api';
|
||||||
|
import { t } from '../../i18n';
|
||||||
|
import type { UnifiedApp } from '../../lib/identity';
|
||||||
|
import { analyticsCsv, exportName } from '../../lib/exports';
|
||||||
|
import { ago, date, num, pct } from '../../lib/format';
|
||||||
|
import { chartSeries, effectDelta } from '../../lib/views';
|
||||||
|
import { useNav } from '../../nav';
|
||||||
|
import { useData, useRead, useWrite } from '../../store';
|
||||||
|
import { useExports } from '../../ui/Exports';
|
||||||
|
import { Icon, StoreGlyph } from '../../ui/icons';
|
||||||
|
import { Card, Chip, Empty, ErrorNotice, Kpi, Notice, Seg, Skeleton } from '../../ui/kit';
|
||||||
|
import { LineChart } from '../../ui/LineChart';
|
||||||
|
import { WriteButton } from '../../ui/WriteButton';
|
||||||
|
import { ascUrl, PLAY_CONSOLE } from '../AppView';
|
||||||
|
|
||||||
|
const DONE = ['COMPLETED', 'STOPPED'];
|
||||||
|
const started = (x: PpoTest) => !!x.startDate && !x.endDate && !DONE.includes(x.state);
|
||||||
|
const stateTone = (s: string): 'ok' | 'warn' | 'bad' | 'info' | 'neutral' | 'accent' =>
|
||||||
|
s === 'REJECTED' ? 'bad' : DONE.includes(s) ? 'neutral' : ['WAITING_FOR_REVIEW', 'IN_REVIEW'].includes(s) ? 'warn' : ['ACCEPTED', 'APPROVED'].includes(s) ? 'ok' : 'info';
|
||||||
|
|
||||||
|
function Analytics({ projectId, hasApple, hasPlay, name, playReports }: { projectId: string; hasApple: boolean; hasPlay: boolean; name: string; playReports: boolean }) {
|
||||||
|
const r = useRead<AnalyticsCompare>(projectId, 'analytics.compare', { network: false });
|
||||||
|
const w = useWrite(projectId);
|
||||||
|
const a = r.data;
|
||||||
|
const stores = ([hasApple && 'apple', hasPlay && 'play'].filter(Boolean) as ('apple' | 'play')[]).filter(s => !a || (s === 'apple' ? a.series.apple.length : a.series.play.length));
|
||||||
|
const [store, setStore] = useState<'apple' | 'play'>(hasApple ? 'apple' : 'play');
|
||||||
|
const st = stores.includes(store) ? store : stores[0] ?? store;
|
||||||
|
const s = useMemo(() => (a ? chartSeries(a, st) : null), [a, st]);
|
||||||
|
useExports('growth', [{ id: 'analytics-csv', label: t('export.analytics'), icon: 'chart', kind: 'csv', file: exportName(name, 'analytics'), disabled: a ? false : t('export.readFirst'), build: () => analyticsCsv(a!) }]);
|
||||||
|
const none = !!r.error && /no snapshots/i.test(r.error);
|
||||||
|
const actions = (
|
||||||
|
<>
|
||||||
|
{hasApple && <WriteButton run={w} icon="sliders" w={{ method: 'analytics.setup', args: {}, title: t('gr.setup'), done: t('gr.setupDone') }} hint={t('gr.setupHint')}>{t('gr.setup')}</WriteButton>}
|
||||||
|
<WriteButton run={w} primary icon="download" w={{ method: 'analytics.snapshot', args: {}, title: t('gr.snapshot'), done: t('gr.snapshotDone'), after: r.refresh }} hint={t('gr.snapshotHint')}>{t('gr.snapshot')}</WriteButton>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
const sum = (xs: number[]) => xs.reduce((n, v) => n + v, 0);
|
||||||
|
const reach = s ? sum(s.reach) : 0, inst = s ? sum(s.installs) : 0;
|
||||||
|
const effects = (a?.effects ?? []).filter(e => e.store === st).slice(-8).reverse();
|
||||||
|
return (
|
||||||
|
<Card title={t('gr.analytics')} icon="chart" sub={a ? t('gr.analyticsSub', { count: a.snapshots, since: date(a.since) }) : t('gr.analyticsSubNone')} pad={false}
|
||||||
|
actions={<>{stores.length > 1 && <Seg value={st} onChange={setStore} label={t('col.store')} options={[['apple', 'App Store'], ['play', 'Google Play']]} />}{actions}</>}>
|
||||||
|
{none ? (
|
||||||
|
<Empty illo="pulse" title={t('gr.noneTitle')}>{t('gr.noneText')}{hasPlay && !playReports ? ` ${t('gr.noBucket')}` : ''}</Empty>
|
||||||
|
) : r.error ? <div className="card-body"><ErrorNotice error={r.error} /></div> : !a || !s ? <div className="card-body"><Skeleton lines={5} block /></div> : (
|
||||||
|
<div className="card-body stack" style={{ gap: 16 }}>
|
||||||
|
<div className="kpis" style={{ gridTemplateColumns: 'repeat(3, minmax(0, 1fr))' }}>
|
||||||
|
<Kpi icon="eye" label={st === 'apple' ? t('gr.impressions') : t('gr.visitors')} value={num(reach)} sub={t('gr.days', { count: s.dates.length })} />
|
||||||
|
<Kpi icon="download" label={st === 'apple' ? t('gr.downloads') : t('gr.acquisitions')} value={num(inst)} sub={t('gr.days', { count: s.dates.length })} />
|
||||||
|
<Kpi icon="activity" label={t('gr.conversion')} value={reach ? pct(inst / reach, 1) : '–'} sub={t('gr.conversionSub')} />
|
||||||
|
</div>
|
||||||
|
{s.dates.length > 1 ? (
|
||||||
|
<LineChart dates={s.dates} label={t('gr.chartAria', { store: st === 'apple' ? 'App Store' : 'Google Play' })} eventsLabel={t('gr.changes', { count: s.events.length })} events={s.events}
|
||||||
|
lines={[
|
||||||
|
{ label: st === 'apple' ? t('gr.impressions') : t('gr.visitors'), values: s.reach, cls: 'l1', axis: 'left' },
|
||||||
|
{ label: st === 'apple' ? t('gr.downloads') : t('gr.acquisitions'), values: s.installs, cls: 'l2', axis: 'left' },
|
||||||
|
{ label: t('gr.conversion'), values: s.conversion, cls: 'l3', axis: 'right' },
|
||||||
|
]} />
|
||||||
|
) : <Notice tone="info">{t('gr.oneDay')}</Notice>}
|
||||||
|
{effects.length > 0 && (
|
||||||
|
<table className="table">
|
||||||
|
<thead><tr><th>{t('gr.change')}</th><th>{t('col.date')}</th><th className="right">{t('gr.before')}</th><th className="right">{t('gr.after')}</th><th className="right">{t('col.diff')}</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
{effects.map((e, i) => {
|
||||||
|
const dlt = effectDelta(e.before.conversion, e.after.conversion);
|
||||||
|
return (
|
||||||
|
<tr key={i}>
|
||||||
|
<td><div className="strong">{e.event.subject}</div><div className="small muted mono-id">{e.event.commit} · {e.event.files.slice(0, 3).join(', ')}</div></td>
|
||||||
|
<td className="nowrap">{date(e.event.date)}</td>
|
||||||
|
<td className="right num">{pct(e.before.conversion ?? null, 1)}<div className="small muted">{t('gr.daysN', { count: e.daysBefore })}</div></td>
|
||||||
|
<td className="right num">{pct(e.after.conversion ?? null, 1)}<div className="small muted">{t('gr.daysN', { count: e.daysAfter })}</div></td>
|
||||||
|
<td className="right">{dlt === null ? '–' : <Chip tone={dlt >= 0 ? 'ok' : 'warn'} dot={false}>{`${dlt >= 0 ? '+' : ''}${num(dlt, 1)} %`}</Chip>}</td>
|
||||||
|
</tr>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
)}
|
||||||
|
<p className="small muted">{t('gr.reading')}</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Experiments({ app }: { app: UnifiedApp }) {
|
||||||
|
const d = useData();
|
||||||
|
const target = app.project?.id ?? app.target;
|
||||||
|
const r = useRead<PpoStatus>(target, 'apple.ppo_status', { network: true, title: t('gr.ppo') });
|
||||||
|
const w = useWrite(app.project?.id ?? null);
|
||||||
|
const variants = d.statusFor(app)?.summary?.variants ?? [];
|
||||||
|
const [pickV, setPickV] = useState<string[]>([]);
|
||||||
|
const [traffic, setTraffic] = useState(30);
|
||||||
|
const [up, setUp] = useState('');
|
||||||
|
const chosen = pickV.length ? pickV : variants.slice(0, 1);
|
||||||
|
const upV = up || variants[0] || '';
|
||||||
|
const tests = r.data?.tests ?? [];
|
||||||
|
const editable = tests.find(x => !started(x) && !DONE.includes(x.state));
|
||||||
|
const asc = app.ios ? ascUrl(app.ios.app.id) : ascUrl(d.statusFor(app)?.app?.platforms.ios?.ascAppId);
|
||||||
|
return (
|
||||||
|
<Card title={t('gr.ppo')} icon="flask" sub={<span className="row" style={{ gap: 6 }}><StoreGlyph store="ios" className="ic13" />{r.data ? (r.fromCache ? t('common.cachedFrom', { when: ago(r.at) }) : t('common.readWhen', { when: ago(r.at) })) : t('gr.ppoSub')}</span>} pad={false}
|
||||||
|
actions={<>
|
||||||
|
<button className="btn btn-sm btn-ghost" onClick={() => api.openExternal(asc).catch(() => {})}><Icon name="external" />{t('gr.results')}</button>
|
||||||
|
<button className="btn btn-sm" onClick={r.refresh} disabled={r.loading}><Icon name="refresh" className={r.loading ? 'spin' : undefined} />{r.data ? t('action.refresh') : t('gr.ppoRead')}</button>
|
||||||
|
</>}>
|
||||||
|
{r.error && <div className="card-body"><ErrorNotice error={r.error} keep={!!r.data} /></div>}
|
||||||
|
{!r.data ? (r.loading && !r.error ? <div className="card-body"><Skeleton lines={4} /></div> : <Empty compact illo="cloud" title={t('gr.ppoNotRead')}>{t('gr.ppoNotReadText')}</Empty>)
|
||||||
|
: !tests.length ? <Empty compact illo="text" title={t('gr.ppoNone')}>{variants.length ? t('gr.ppoNoneText') : t('gr.ppoNoVariants')}</Empty> : (
|
||||||
|
<table className="table">
|
||||||
|
<thead><tr><th>{t('gr.test')}</th><th>{t('gr.state')}</th><th className="right">{t('gr.traffic')}</th><th>{t('gr.dates')}</th><th>{t('gr.treatments')}</th><th className="right">{t('gr.owner')}</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
{tests.map(x => (
|
||||||
|
<tr key={x.id}>
|
||||||
|
<td className="strong">{x.name}</td>
|
||||||
|
<td><Chip tone={stateTone(x.state)}>{x.state.replace(/_/g, ' ').toLowerCase()}</Chip></td>
|
||||||
|
<td className="right num">{x.trafficProportion !== undefined ? `${x.trafficProportion} %` : '–'}</td>
|
||||||
|
<td className="small nowrap">{x.startDate ? `${date(x.startDate)} → ${x.endDate ? date(x.endDate) : t('gr.running')}` : t('gr.notStarted')}</td>
|
||||||
|
<td className="small">{x.treatments.length ? x.treatments.map(tr => t('gr.treatment', { name: tr.name, count: tr.locales })).join(' · ') : '–'}</td>
|
||||||
|
<td className="right">
|
||||||
|
{app.project && !DONE.includes(x.state) && (started(x)
|
||||||
|
? <WriteButton run={w} danger icon="pause" w={{ method: 'owner.ppo_stop', args: { experiment: x.name }, title: t('gr.stop', { name: x.name }), done: t('gr.stopped'), after: r.refresh }}>{t('gr.stopBtn')}</WriteButton>
|
||||||
|
: <WriteButton run={w} icon="play" w={{ method: 'owner.ppo_start', args: { experiment: x.name }, title: t('gr.start', { name: x.name }), done: t('gr.started'), after: r.refresh }}>{t('gr.startBtn')}</WriteButton>)}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
)}
|
||||||
|
{app.project ? (
|
||||||
|
<div className="card-body" style={{ borderTop: '1px solid var(--line)' }}>
|
||||||
|
{!variants.length ? <Notice tone="info" icon="info">{t('gr.ppoNoVariants')}</Notice> : (
|
||||||
|
<div className="act-grid">
|
||||||
|
<div className="act-col">
|
||||||
|
<div className="act-head"><Icon name="plus" />{t('gr.create')}</div>
|
||||||
|
<div className="chips">{variants.map(v => (
|
||||||
|
<label key={v} className="check"><input type="checkbox" checked={chosen.includes(v)} onChange={ev => setPickV(ev.target.checked ? [...new Set([...chosen, v])].slice(0, 3) : chosen.filter(x => x !== v))} />{t('gr.variant', { id: v })}</label>
|
||||||
|
))}</div>
|
||||||
|
<label className="row small" style={{ gap: 8 }}><span className="muted">{t('gr.traffic')}</span>
|
||||||
|
<input className="input input-sm mono" type="number" min={1} max={100} value={traffic} onChange={ev => setTraffic(Math.max(1, Math.min(100, Number(ev.target.value) || 30)))} style={{ width: 70 }} />%</label>
|
||||||
|
<WriteButton run={w} icon="flask" disabled={!chosen.length} w={{ method: 'apple.ppo_create', args: { variants: chosen.join(','), traffic }, title: t('gr.createTitle'), done: t('gr.created'), after: r.refresh }}>{t('gr.createBtn')}</WriteButton>
|
||||||
|
</div>
|
||||||
|
<div className="act-col">
|
||||||
|
<div className="act-head"><Icon name="image" />{t('gr.upload')}</div>
|
||||||
|
<select className="input input-sm" value={upV} onChange={ev => setUp(ev.target.value)} aria-label={t('gr.upload')}>{variants.map(v => <option key={v} value={v}>{t('gr.variant', { id: v })}</option>)}</select>
|
||||||
|
<WriteButton run={w} icon="upload" disabled={!editable} hint={editable ? t('act.slowHint') : t('gr.uploadNoTest')} w={{ method: 'apple.ppo_upload', args: { variant: upV, ...(editable ? { experiment: editable.name } : {}) }, title: t('gr.uploadTitle', { id: upV }), done: t('act.uploaded'), after: r.refresh }}>{t('gr.uploadBtn')}</WriteButton>
|
||||||
|
<span className="small muted">{editable ? t('gr.uploadInto', { name: editable.name }) : t('gr.uploadNoTest')}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<p className="small muted act-note"><Icon name="shield" />{t('gr.ppoNote')}</p>
|
||||||
|
</div>
|
||||||
|
) : <div className="card-foot"><Icon name="info" />{t('gr.ppoStoreOnly')}</div>}
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function PlayExperiments({ app }: { app: UnifiedApp }) {
|
||||||
|
const nav = useNav();
|
||||||
|
return (
|
||||||
|
<Card title={t('gr.playExp')} icon="flask" sub={<span className="row" style={{ gap: 6 }}><StoreGlyph store="android" className="ic13" />{t('gr.playExpSub')}</span>}
|
||||||
|
actions={<button className="btn btn-sm" onClick={() => api.openExternal(PLAY_CONSOLE).catch(() => {})}><Icon name="external" />Play Console</button>}>
|
||||||
|
<div className="stack" style={{ gap: 10 }}>
|
||||||
|
<p className="small">{t('gr.playExpText')}</p>
|
||||||
|
{app.project && <div><button className="btn btn-sm" onClick={() => nav.go({ screen: 'app', appId: app.key, tab: 'art' })}><Icon name="grid" />{t('gr.seeVariants')}</button></div>}
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function GrowthTab({ app }: { app: UnifiedApp }) {
|
||||||
|
const d = useData();
|
||||||
|
const s = d.statusFor(app)?.summary;
|
||||||
|
const hasApple = !!(s?.apple ?? app.ios), hasPlay = !!(s?.play ?? app.android);
|
||||||
|
if (app.project && !s) return <Card><Skeleton lines={5} block /></Card>;
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{app.project && <Analytics projectId={app.project.id} hasApple={hasApple} hasPlay={hasPlay} name={s?.name ?? app.name} playReports={!!s?.playReports} />}
|
||||||
|
<div className={`grid ${hasApple && hasPlay ? 'g-main-side' : ''}`} style={{ alignItems: 'start' }}>
|
||||||
|
{hasApple && <Experiments app={app} />}
|
||||||
|
{hasPlay && <PlayExperiments app={app} />}
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -6,7 +6,9 @@ import { ago, date, num, pct } from '../../lib/format';
|
||||||
import { type AppleHealth, healthSeries, type HealthSnapshot, isError, PLAY_THRESHOLDS, type PlayHealth, type Series } from '../../lib/model';
|
import { type AppleHealth, healthSeries, type HealthSnapshot, isError, PLAY_THRESHOLDS, type PlayHealth, type Series } from '../../lib/model';
|
||||||
import { useRead } from '../../store';
|
import { useRead } from '../../store';
|
||||||
import { Icon } from '../../ui/icons';
|
import { Icon } from '../../ui/icons';
|
||||||
import { Bar, Card, Chip, Empty, Notice, Skeleton, Sparkline } from '../../ui/kit';
|
import { Bar, Card, Chip, Empty, ErrorFoot, Notice, Skeleton, Sparkline } from '../../ui/kit';
|
||||||
|
import { exportName, healthMd } from '../../lib/exports';
|
||||||
|
import { useExports } from '../../ui/Exports';
|
||||||
|
|
||||||
function Metric({ title, s }: { title: string; s: Series }) {
|
function Metric({ title, s }: { title: string; s: Series }) {
|
||||||
return (
|
return (
|
||||||
|
|
@ -124,13 +126,14 @@ function Apple({ h }: { h: AppleHealth }) {
|
||||||
|
|
||||||
export function HealthTab({ app }: { app: UnifiedApp }) {
|
export function HealthTab({ app }: { app: UnifiedApp }) {
|
||||||
const r = useRead<HealthSnapshot>(app.target, 'health', { network: true, title: t('tab.health'), appName: app.name });
|
const r = useRead<HealthSnapshot>(app.target, 'health', { network: true, title: t('tab.health'), appName: app.name });
|
||||||
|
useExports('health', [{ id: 'health-md', label: t('export.health'), icon: 'activity', kind: 'md', file: exportName(app.name, 'health'), disabled: r.data ? false : t('export.readFirst'), build: () => healthMd(app.name, r.data!) }]);
|
||||||
const refresh = <button className="btn btn-sm" onClick={r.refresh} disabled={r.loading}><Icon name="refresh" className={r.loading && !r.data ? 'spin' : undefined} />{r.data ? t('action.refresh') : t('health.read')}</button>;
|
const refresh = <button className="btn btn-sm" onClick={r.refresh} disabled={r.loading}><Icon name="refresh" className={r.loading && !r.data ? 'spin' : undefined} />{r.data ? t('action.refresh') : t('health.read')}</button>;
|
||||||
if (!r.data) {
|
if (!r.data) {
|
||||||
if (r.loading && !r.error) return <Card><Skeleton lines={4} block /></Card>;
|
if (r.loading && !r.error) return <Card><Skeleton lines={4} block /></Card>;
|
||||||
return (
|
return (
|
||||||
<Card pad={false}>
|
<Card pad={false}>
|
||||||
<Empty illo="pulse" title={t('health.emptyTitle')} actions={<button className="btn btn-primary" onClick={r.refresh}><Icon name="refresh" />{t('health.read')}</button>}>{t('health.emptyText')}</Empty>
|
<Empty illo="pulse" title={t('health.emptyTitle')} actions={<button className="btn btn-primary" onClick={r.refresh}><Icon name="refresh" />{t('health.read')}</button>}>{t('health.emptyText')}</Empty>
|
||||||
{r.error && <div className="card-foot"><Icon name="alertCircle" />{r.error}</div>}
|
{r.error && <ErrorFoot error={r.error} />}
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,10 @@ import { ago, num } from '../../lib/format';
|
||||||
import { useData, useRead, useWrite } from '../../store';
|
import { useData, useRead, useWrite } from '../../store';
|
||||||
import { Icon, StoreGlyph } from '../../ui/icons';
|
import { Icon, StoreGlyph } from '../../ui/icons';
|
||||||
import { WriteButton } from '../../ui/WriteButton';
|
import { WriteButton } from '../../ui/WriteButton';
|
||||||
import { Card, Chip, Empty, Kpi, Notice, Skeleton } from '../../ui/kit';
|
import { Card, Chip, Empty, ErrorNotice, Kpi, Notice, Skeleton } from '../../ui/kit';
|
||||||
|
import { reads } from '../../api';
|
||||||
|
import { exportName, listingsMd } from '../../lib/exports';
|
||||||
|
import { useExports } from '../../ui/Exports';
|
||||||
|
|
||||||
const FIELD_KEY: Record<string, Key> = {
|
const FIELD_KEY: Record<string, Key> = {
|
||||||
title: 'lst.title', short: 'lst.short', full: 'lst.full', whatsNew: 'lst.whatsNew', name: 'lst.name', subtitle: 'lst.subtitle',
|
title: 'lst.title', short: 'lst.short', full: 'lst.full', whatsNew: 'lst.whatsNew', name: 'lst.name', subtitle: 'lst.subtitle',
|
||||||
|
|
@ -111,8 +114,11 @@ function StoreActions({ project, langs }: { project: Project; langs: string[] })
|
||||||
|
|
||||||
export function ListingsTab({ project }: { project: Project }) {
|
export function ListingsTab({ project }: { project: Project }) {
|
||||||
const r = useRead<ListingsResult>(project.id, 'project.listings', { network: false });
|
const r = useRead<ListingsResult>(project.id, 'project.listings', { network: false });
|
||||||
|
useExports('listings', [{ id: 'listings-md', label: t('export.listings'), icon: 'text', kind: 'md', file: exportName(project.name, 'listings'),
|
||||||
|
disabled: r.data && (r.data.files.play || r.data.files.apple) ? false : t('export.noListings'),
|
||||||
|
build: async () => { const x = await reads.listingText(project.id); if (!x.data) throw new Error(x.output || t('export.failed')); return listingsMd(project.name, x.data); } }]);
|
||||||
if (!r.data) {
|
if (!r.data) {
|
||||||
if (r.error) return <Notice tone="bad">{r.error}</Notice>;
|
if (r.error) return <ErrorNotice error={r.error} tone="bad" />;
|
||||||
return <Card><Skeleton lines={6} block /></Card>;
|
return <Card><Skeleton lines={6} block /></Card>;
|
||||||
}
|
}
|
||||||
const L = r.data;
|
const L = r.data;
|
||||||
|
|
|
||||||
205
apps/desktop/src/screens/tabs/Prices.tsx
Normal file
205
apps/desktop/src/screens/tabs/Prices.tsx
Normal file
|
|
@ -0,0 +1,205 @@
|
||||||
|
// Prices: what every product costs in every territory on both stores (`prices export --json`, read-only), the price
|
||||||
|
// sheet as a CSV (save it anywhere, or write store/prices.csv for the terminal), and a price sheet compared with the
|
||||||
|
// stores (`prices import --dry --json`) and applied as an owner action: dry run, native dialog, then the real run.
|
||||||
|
import { useEffect, useMemo, useState } from 'react';
|
||||||
|
import { api, errorText, type PricesCurrent, type PricesDiff, type Project } from '../../api';
|
||||||
|
import { t } from '../../i18n';
|
||||||
|
import { exportName, pricesCsv } from '../../lib/exports';
|
||||||
|
import { ago, money, num } from '../../lib/format';
|
||||||
|
import { changePct, diffSummary, priceMatrix, priceStats, type RegionRow, regionRows } from '../../lib/views';
|
||||||
|
import { type ReadState, useData, useRead, useWrite } from '../../store';
|
||||||
|
import { type ExportItem, useExports, useRunExport } from '../../ui/Exports';
|
||||||
|
import { Icon, StoreGlyph } from '../../ui/icons';
|
||||||
|
import { Card, Chip, Empty, ErrorNotice, Kpi, Notice, Skeleton } from '../../ui/kit';
|
||||||
|
import { WriteButton } from '../../ui/WriteButton';
|
||||||
|
|
||||||
|
const GAP = 10;
|
||||||
|
|
||||||
|
function PriceStack({ r, apple, play }: { r: RegionRow | undefined; apple: boolean; play: boolean }) {
|
||||||
|
if (!r) return <span className="muted small">–</span>;
|
||||||
|
return (
|
||||||
|
<div className="px-stack">
|
||||||
|
{apple && <span className={`px-line${r.apple?.kind === 'auto' ? ' auto' : ''}`} title={r.apple?.kind === 'auto' ? t('prices.auto') : t('prices.manual')}><StoreGlyph store="ios" />{r.apple ? money(r.apple.price, r.apple.currency) : '–'}</span>}
|
||||||
|
{play && <span className="px-line"><StoreGlyph store="android" />{r.play ? money(r.play.price, r.play.currency) : '–'}</span>}
|
||||||
|
{r.gapPct !== null && r.gapPct >= GAP && <Chip tone={r.gapPct > 25 ? 'bad' : 'warn'} dot={false}>{`Δ ${num(r.gapPct, 0)} %`}</Chip>}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** The sheet against the stores, and the owner's Apply. */
|
||||||
|
function SheetDiff({ project, diff, sheet, onApplied }: { project: Project; diff: ReadState<PricesDiff>; sheet: { csv?: string }; onApplied: () => void }) {
|
||||||
|
const w = useWrite(project.id);
|
||||||
|
const d = diff.data;
|
||||||
|
const rows = (d?.diff ?? []).filter(r => r.change !== 'same');
|
||||||
|
const sum = d ? diffSummary(d.diff, d.changed) : null;
|
||||||
|
const name = sheet.csv ? sheet.csv.split(/[\\/]/).pop() : d?.csv.split(/[\\/]/).pop() ?? 'prices.csv';
|
||||||
|
return (
|
||||||
|
<Card title={t('prices.diffTitle', { file: name ?? '' })} icon="layers" sub={d ? (diff.fromCache ? t('common.cachedFrom', { when: ago(diff.at) }) : t('common.readWhen', { when: ago(diff.at) })) : t('prices.diffSub')} pad={false}
|
||||||
|
actions={<>
|
||||||
|
<button className="btn btn-sm" onClick={diff.refresh} disabled={diff.loading}><Icon name="refresh" className={diff.loading ? 'spin' : undefined} />{t('prices.compareAgain')}</button>
|
||||||
|
{sum && sum.pairs > 0 && <WriteButton run={w} primary icon="upload" w={{ method: 'owner.prices_import', args: sheet, title: t('prices.apply', { count: sum.pairs }), done: t('prices.applied'), after: onApplied }}>{t('prices.apply', { count: sum.pairs })}</WriteButton>}
|
||||||
|
</>}>
|
||||||
|
{diff.error && <div className="card-body"><ErrorNotice error={diff.error} /></div>}
|
||||||
|
{!d ? (diff.loading ? <div className="card-body"><Skeleton lines={4} /></div> : null) : !rows.length ? (
|
||||||
|
<Empty compact illo="catalog" title={t('prices.upToDate')}>{t('prices.upToDateText')}</Empty>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<div className="card-body row" style={{ gap: 8, flexWrap: 'wrap', paddingBottom: 0 }}>
|
||||||
|
<Chip tone="accent">{t('prices.dChanged', { count: sum!.changed })}</Chip>
|
||||||
|
<Chip tone="info">{t('prices.dNew', { count: sum!.added })}</Chip>
|
||||||
|
{sum!.up > 0 && <Chip tone="warn" icon="arrowRight">{t('prices.dUp', { count: sum!.up })}</Chip>}
|
||||||
|
{sum!.down > 0 && <Chip tone="ok" icon="arrowRight">{t('prices.dDown', { count: sum!.down })}</Chip>}
|
||||||
|
<span className="small muted">{t('prices.dProducts', { list: sum!.products.join(', ') })}</span>
|
||||||
|
</div>
|
||||||
|
<div className="table-wrap">
|
||||||
|
<table className="table">
|
||||||
|
<thead><tr><th>{t('col.item')}</th><th>{t('col.store')}</th><th>{t('col.region')}</th><th>{t('prices.colStarts')}</th><th className="right">{t('prices.colNow')}</th><th className="right">{t('prices.colNew')}</th><th className="right">{t('col.diff')}</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
{rows.slice(0, 200).map((r, i) => {
|
||||||
|
const c = changePct(r);
|
||||||
|
return (
|
||||||
|
<tr key={i}>
|
||||||
|
<td className="mono-id strong">{r.product}</td>
|
||||||
|
<td><span className="row small" style={{ gap: 6 }}><StoreGlyph store={r.store === 'apple' ? 'ios' : 'android'} className="ic13" />{r.store === 'apple' ? 'App Store' : 'Google Play'}</span></td>
|
||||||
|
<td>{r.region}</td>
|
||||||
|
<td className="small muted">{r.startDate ?? t('prices.now')}</td>
|
||||||
|
<td className="right num">{r.from === null ? '–' : money(r.from, r.currency)}</td>
|
||||||
|
<td className="right num strong">{money(r.to, r.currency)}</td>
|
||||||
|
<td className="right">{r.change === 'new' ? <Chip tone="info">{t('prices.new')}</Chip> : c === null ? '–' : <Chip tone={c > 0 ? 'warn' : 'ok'} dot={false}>{`${c > 0 ? '+' : ''}${num(c, 1)} %`}</Chip>}</td>
|
||||||
|
</tr>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{rows.length > 200 && <div className="card-foot">{t('prices.more', { count: rows.length - 200 })}</div>}
|
||||||
|
<div className="card-foot"><Icon name="shield" />{t('prices.applyNote')}</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function PricesTab({ project }: { project: Project }) {
|
||||||
|
const d = useData();
|
||||||
|
const e = d.statusOf(project);
|
||||||
|
const s = e?.summary ?? null;
|
||||||
|
const w = useWrite(project.id);
|
||||||
|
const runExport = useRunExport();
|
||||||
|
const [withAuto, setWithAuto] = useState(true);
|
||||||
|
const cur = useRead<PricesCurrent>(project.id, 'prices.current', { network: true, args: withAuto ? { with_automatic: true } : {}, title: t('prices.readTitle') });
|
||||||
|
const [sheet, setSheet] = useState<{ csv?: string } | null>(null);
|
||||||
|
const sheetKey = JSON.stringify(sheet);
|
||||||
|
const diff = useRead<PricesDiff>(project.id, 'prices.diff', { network: true, args: sheet ?? {}, title: t('prices.compareTitle'), skip: sheet === null });
|
||||||
|
useEffect(() => { if (sheet) diff.refresh(); }, [sheetKey]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
const [product, setProduct] = useState('');
|
||||||
|
const [q, setQ] = useState('');
|
||||||
|
const p = cur.data;
|
||||||
|
const name = s?.name ?? project.name;
|
||||||
|
const exportItem: ExportItem = { id: 'prices-csv', label: t('export.prices'), icon: 'coins', kind: 'csv', file: exportName(name, 'prices'), disabled: p ? false : t('export.readFirst'), build: () => pricesCsv(p!) };
|
||||||
|
useExports('prices', [exportItem]);
|
||||||
|
|
||||||
|
const stats = useMemo(() => (p ? priceStats(p, GAP) : null), [p]);
|
||||||
|
const matrix = useMemo(() => (p ? priceMatrix(p) : null), [p]);
|
||||||
|
const sel = product || p?.products[0] || '';
|
||||||
|
const regions = useMemo(() => (p && sel ? regionRows(p, sel).filter(r => !q || r.region.toLowerCase().includes(q.toLowerCase()) || (r.apple?.currency ?? r.play?.currency ?? '').toLowerCase().includes(q.toLowerCase())) : []), [p, sel, q]);
|
||||||
|
const apple = !!s?.apple, play = !!s?.play;
|
||||||
|
const rel = (abs: string) => (abs.startsWith(`${project.path}/`) ? abs.slice(project.path.length + 1) : '');
|
||||||
|
const pick = async () => {
|
||||||
|
try { const f = await api.pickPriceSheet(project.id); if (f) setSheet({ csv: f }); } catch (x) { d.toast({ kind: 'bad', title: t('prices.pickFailed'), detail: errorText(x) }); }
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!e) return <Card><Skeleton lines={5} block /></Card>;
|
||||||
|
if (!s?.products) {
|
||||||
|
return (
|
||||||
|
<Card pad={false}>
|
||||||
|
<Empty illo="catalog" title={t('prices.emptyTitle')}>{t('prices.emptyText')}</Empty>
|
||||||
|
<div className="card-foot"><Icon name="terminal" /><code className="selectable">products: [{'{'} id, type, usd {'}'}]</code><span>{t('prices.emptyHint')}</span></div>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Card title={t('prices.sheetTitle')} icon="coins" sub={t('prices.sheetSub')}
|
||||||
|
actions={<button className="btn btn-sm btn-primary" onClick={() => runExport(exportItem)} disabled={!p}><Icon name="download" />{t('prices.exportCsv')}</button>}>
|
||||||
|
<div className="act-grid">
|
||||||
|
<div className="act-col">
|
||||||
|
<div className="act-head"><Icon name="download" />{t('prices.getSheet')}</div>
|
||||||
|
<button className="btn btn-sm" onClick={() => (p ? runExport(exportItem) : cur.refresh())} disabled={cur.loading}><Icon name={p ? 'download' : 'refresh'} className={cur.loading ? 'spin' : undefined} />{p ? t('prices.exportCsv') : t('prices.readFirst')}</button>
|
||||||
|
<WriteButton run={w} icon="text" w={{ method: 'prices.export', args: {}, title: t('act.pricesExport'), done: t('act.pricesExported') }} hint={t('prices.writeHint')}>{t('prices.writeProject')}</WriteButton>
|
||||||
|
</div>
|
||||||
|
<div className="act-col">
|
||||||
|
<div className="act-head"><Icon name="layers" />{t('prices.compareHead')}</div>
|
||||||
|
<button className="btn btn-sm" onClick={pick}><Icon name="folder" />{t('prices.pickSheet')}</button>
|
||||||
|
<button className="btn btn-sm" onClick={() => setSheet({})}><Icon name="text" />{t('prices.compareProject')}</button>
|
||||||
|
{p && rel(p.csv) && <button className="btn btn-sm btn-ghost" onClick={() => api.reveal(project.id, rel(p.csv)).catch(x => d.toast({ kind: 'info', title: t('prices.noSheetYet'), detail: errorText(x) }))}><Icon name="eye" />{t('prices.showSheet')}</button>}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p className="small muted act-note"><Icon name="shield" />{t('prices.sheetNote')}</p>
|
||||||
|
</Card>
|
||||||
|
|
||||||
|
{sheet && <SheetDiff project={project} diff={diff} sheet={sheet} onApplied={() => { cur.refresh(); diff.refresh(); }} />}
|
||||||
|
|
||||||
|
{cur.error && <ErrorNotice error={cur.error} keep={!!p} />}
|
||||||
|
{!p ? (
|
||||||
|
cur.loading && !cur.error ? <Card><Skeleton lines={6} block /></Card> : (
|
||||||
|
<Card pad={false}>
|
||||||
|
<Empty illo="cloud" title={t('prices.notReadTitle')} actions={<button className="btn btn-primary" onClick={cur.refresh} disabled={cur.loading}><Icon name="refresh" />{t('prices.readNow')}</button>}>{t('prices.notReadText')}</Empty>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<div className="kpis" style={{ gridTemplateColumns: 'repeat(4, minmax(0, 1fr))' }}>
|
||||||
|
<Kpi icon="tag" label={t('prices.kProducts')} value={stats!.products} sub={t('prices.kProductsSub', { count: stats!.rows })} />
|
||||||
|
<Kpi icon="globe" label={t('prices.kRegions')} value={stats!.regions} sub={withAuto ? t('prices.kRegionsAuto') : t('prices.kRegionsManual')} />
|
||||||
|
<Kpi icon="alert" label={t('prices.kGaps')} value={stats!.gaps} sub={t('prices.kGapsSub', { pct: GAP })} tone={stats!.gaps ? 'warn' : undefined} />
|
||||||
|
<Kpi icon="x" label={t('prices.kMissing')} value={stats!.missing} sub={stats!.missing ? p.missing.map(m => `${m.product} (${m.store === 'apple' ? 'App Store' : 'Play'})`).join(', ') : t('prices.kMissingNone')} tone={stats!.missing ? 'bad' : undefined} />
|
||||||
|
</div>
|
||||||
|
<Card title={t('prices.overview')} icon="grid" sub={cur.fromCache ? t('common.cachedFrom', { when: ago(cur.at) }) : t('common.readWhen', { when: ago(cur.at) })} pad={false}
|
||||||
|
actions={<>
|
||||||
|
<label className="check"><input type="checkbox" checked={withAuto} onChange={ev => setWithAuto(ev.target.checked)} />{t('prices.withAuto')}</label>
|
||||||
|
<button className="btn btn-sm" onClick={cur.refresh} disabled={cur.loading}><Icon name="refresh" className={cur.loading ? 'spin' : undefined} />{t('action.refresh')}</button>
|
||||||
|
</>}>
|
||||||
|
<div className="table-wrap">
|
||||||
|
<table className="table px-matrix">
|
||||||
|
<thead><tr><th>{t('col.item')}</th>{matrix!.regions.map(r => <th key={r}>{r}</th>)}</tr></thead>
|
||||||
|
<tbody>
|
||||||
|
{matrix!.rows.map(row => (
|
||||||
|
<tr key={row.product} className={`clickable${row.product === sel ? ' sel' : ''}`} onClick={() => setProduct(row.product)}>
|
||||||
|
<td><span className="mono-id strong">{row.product}</span></td>
|
||||||
|
{matrix!.regions.map(r => <td key={r}><PriceStack r={row.cells[r]} apple={apple} play={play} /></td>)}
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div className="card-foot legend-row"><span><StoreGlyph store="ios" className="ic13" />App Store</span><span><StoreGlyph store="android" className="ic13" />Google Play</span><span className="px-line auto">{t('prices.autoLegend')}</span><span>{t('prices.gapLegend', { pct: GAP })}</span></div>
|
||||||
|
</Card>
|
||||||
|
<Card title={t('prices.perRegion', { product: sel })} icon="globe" sub={t('prices.perRegionSub', { count: regions.length })} pad={false}
|
||||||
|
actions={<>
|
||||||
|
<select className="input input-sm" value={sel} onChange={ev => setProduct(ev.target.value)} aria-label={t('col.item')}>{p.products.map(x => <option key={x} value={x}>{x}</option>)}</select>
|
||||||
|
<div className="search-input"><Icon name="search" /><input className="input input-sm" style={{ paddingLeft: 28 }} value={q} onChange={ev => setQ(ev.target.value)} placeholder={t('prices.searchRegion')} aria-label={t('prices.searchRegion')} /></div>
|
||||||
|
</>}>
|
||||||
|
<div className="table-wrap" style={{ maxHeight: 520, overflowY: 'auto' }}>
|
||||||
|
<table className="table">
|
||||||
|
<thead><tr><th>{t('col.region')}</th>{apple && <th className="right">App Store</th>}{apple && <th>{t('prices.colKind')}</th>}{play && <th className="right">Google Play</th>}<th className="right">{t('col.priceGap')}</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
{regions.map(r => (
|
||||||
|
<tr key={r.region}>
|
||||||
|
<td className="strong">{r.region}</td>
|
||||||
|
{apple && <td className="right num">{r.apple ? money(r.apple.price, r.apple.currency) : <span className="muted">–</span>}{r.scheduled && <div className="small muted">{t('prices.scheduled', { price: money(r.scheduled.price, r.scheduled.currency), date: r.scheduled.startDate ?? '' })}</div>}</td>}
|
||||||
|
{apple && <td>{r.apple ? <Chip tone={r.apple.kind === 'auto' ? 'neutral' : 'accent'}>{r.apple.kind === 'auto' ? t('prices.auto') : t('prices.manual')}</Chip> : null}</td>}
|
||||||
|
{play && <td className="right num">{r.play ? money(r.play.price, r.play.currency) : <span className="muted">–</span>}</td>}
|
||||||
|
<td className="right">{r.gapPct === null ? <span className="muted small">{r.apple && r.play ? t('prices.otherCurrency') : '–'}</span> : <Chip tone={r.gapPct > 25 ? 'bad' : r.gapPct >= GAP ? 'warn' : 'ok'} dot={false}>{`${num(r.gapPct, 1)} %`}</Chip>}</td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
{p.missing.length > 0 && <Notice tone="warn">{t('prices.missingNote', { list: p.missing.map(m => `${m.product} (${m.store === 'apple' ? 'App Store' : 'Google Play'})`).join(', ') })}</Notice>}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -10,7 +10,9 @@ import { draftName, filterReviews, type Review, type ReviewFilter, starStats } f
|
||||||
import { useRead, useWrite } from '../../store';
|
import { useRead, useWrite } from '../../store';
|
||||||
import { WriteButton } from '../../ui/WriteButton';
|
import { WriteButton } from '../../ui/WriteButton';
|
||||||
import { Icon, StoreGlyph } from '../../ui/icons';
|
import { Icon, StoreGlyph } from '../../ui/icons';
|
||||||
import { Bar, Card, Chip, Empty, Notice, Seg, Skeleton, Stars } from '../../ui/kit';
|
import { Bar, Card, Chip, Empty, ErrorFoot, Notice, Seg, Skeleton, Stars } from '../../ui/kit';
|
||||||
|
import { exportName, reviewsCsv } from '../../lib/exports';
|
||||||
|
import { useExports } from '../../ui/Exports';
|
||||||
|
|
||||||
const base = (f: string) => f.split(/[\\/]/).pop() ?? f;
|
const base = (f: string) => f.split(/[\\/]/).pop() ?? f;
|
||||||
|
|
||||||
|
|
@ -92,13 +94,15 @@ export function ReviewsTab({ app }: { app: UnifiedApp }) {
|
||||||
const cur = shown.find(r => `${r.store}:${r.id}` === sel) ?? shown.find(r => !r.reply && byFile.has(draftName(r))) ?? shown[0];
|
const cur = shown.find(r => `${r.store}:${r.id}` === sel) ?? shown.find(r => !r.reply && byFile.has(draftName(r))) ?? shown[0];
|
||||||
|
|
||||||
const changed = () => { drafts.refresh(); };
|
const changed = () => { drafts.refresh(); };
|
||||||
|
useExports('reviews', [{ id: 'reviews-csv', label: t('export.reviews'), icon: 'message', kind: 'csv', personal: true, file: exportName(app.name, 'reviews'),
|
||||||
|
disabled: list.data ? false : t('export.readFirst'), build: () => reviewsCsv(shown.length ? shown : all) }]);
|
||||||
|
|
||||||
if (!list.data) {
|
if (!list.data) {
|
||||||
if (list.loading && !list.error) return <Card><Skeleton lines={5} block /></Card>;
|
if (list.loading && !list.error) return <Card><Skeleton lines={5} block /></Card>;
|
||||||
return (
|
return (
|
||||||
<Card pad={false}>
|
<Card pad={false}>
|
||||||
<Empty illo="reviews" title={t('reviews.emptyTitle')} actions={<button className="btn btn-primary" onClick={list.refresh}><Icon name="refresh" />{t('reviews.read')}</button>}>{t('reviews.emptyText')}</Empty>
|
<Empty illo="reviews" title={t('reviews.emptyTitle')} actions={<button className="btn btn-primary" onClick={list.refresh}><Icon name="refresh" />{t('reviews.read')}</button>}>{t('reviews.emptyText')}</Empty>
|
||||||
{list.error && <div className="card-foot"><Icon name="alertCircle" />{list.error}</div>}
|
{list.error && <ErrorFoot error={list.error} />}
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import { t } from './i18n';
|
||||||
import { buildApps, NO_OVERRIDES, type Overrides, type UnifiedApp } from './lib/identity';
|
import { buildApps, NO_OVERRIDES, type Overrides, type UnifiedApp } from './lib/identity';
|
||||||
import { isError, type HealthSnapshot, type Review } from './lib/model';
|
import { isError, type HealthSnapshot, type Review } from './lib/model';
|
||||||
import { crashCrossed, newLowReviews, releaseChanges } from './lib/notify';
|
import { crashCrossed, newLowReviews, releaseChanges } from './lib/notify';
|
||||||
|
import { fixHint } from './lib/views';
|
||||||
|
|
||||||
export type ToastKind = 'job' | 'ok' | 'bad' | 'info';
|
export type ToastKind = 'job' | 'ok' | 'bad' | 'info';
|
||||||
export interface Toast {
|
export interface Toast {
|
||||||
|
|
@ -77,6 +78,8 @@ export const useData = (): Data => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const lastLine = (s: string): string => s.trim().split('\n').filter(Boolean).at(-1)?.replace(/^\S+ \[[^\]]+\] /, '') ?? '';
|
const lastLine = (s: string): string => s.trim().split('\n').filter(Boolean).at(-1)?.replace(/^\S+ \[[^\]]+\] /, '') ?? '';
|
||||||
|
/** A failure line with how to fix it, when the error is a known one. */
|
||||||
|
const withHint = (msg: string | undefined): string | undefined => { const h = fixHint(msg); return h && msg ? `${msg} · ${t(h)}` : msg; };
|
||||||
|
|
||||||
export function DataProvider({ children }: { children: ReactNode }) {
|
export function DataProvider({ children }: { children: ReactNode }) {
|
||||||
const [ready, setReady] = useState(false);
|
const [ready, setReady] = useState(false);
|
||||||
|
|
@ -322,10 +325,10 @@ export function useWrite(projectId: string | null) {
|
||||||
const tid = d.toast({ id: job, kind: 'job', title: w.title, detail: t('write.dryRunning'), progress: null, job });
|
const tid = d.toast({ id: job, kind: 'job', title: w.title, detail: t('write.dryRunning'), progress: null, job });
|
||||||
try {
|
try {
|
||||||
const o = await api.writeWithConfirm(w.method, projectId, w.args, job);
|
const o = await api.writeWithConfirm(w.method, projectId, w.args, job);
|
||||||
if (o.stage === 'dry-run') d.updateToast(tid, { kind: 'bad', title: t('write.dryFailed'), detail: lastLine(o.dryRun.output) || undefined, progress: undefined, job: undefined });
|
if (o.stage === 'dry-run') d.updateToast(tid, { kind: 'bad', title: t('write.dryFailed'), detail: withHint(lastLine(o.dryRun.output) || undefined), progress: undefined, job: undefined });
|
||||||
else if (o.stage === 'dialog') d.updateToast(tid, { kind: 'info', title: t('write.notApplied'), detail: t('write.notAppliedDetail'), progress: undefined, job: undefined });
|
else if (o.stage === 'dialog') d.updateToast(tid, { kind: 'info', title: t('write.notApplied'), detail: t('write.notAppliedDetail'), progress: undefined, job: undefined });
|
||||||
else if (o.result?.ok) { d.updateToast(tid, { kind: 'ok', title: w.done, detail: lastLine(o.result.output) || undefined, progress: undefined, job: undefined }); w.after?.(); }
|
else if (o.result?.ok) { d.updateToast(tid, { kind: 'ok', title: w.done, detail: lastLine(o.result.output) || undefined, progress: undefined, job: undefined }); w.after?.(); }
|
||||||
else d.updateToast(tid, { kind: 'bad', title: t('write.failed'), detail: lastLine(o.result?.output ?? '') || undefined, progress: undefined, job: undefined });
|
else d.updateToast(tid, { kind: 'bad', title: t('write.failed'), detail: withHint(lastLine(o.result?.output ?? '') || undefined), progress: undefined, job: undefined });
|
||||||
return o;
|
return o;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
const msg = errorText(e);
|
const msg = errorText(e);
|
||||||
|
|
@ -377,7 +380,7 @@ export function useRead<T>(target: string, method: string, o: { network: boolean
|
||||||
} else {
|
} else {
|
||||||
const msg = lastLine(r.output) || t('common.exit', { code: r.exitCode });
|
const msg = lastLine(r.output) || t('common.exit', { code: r.exitCode });
|
||||||
set(x => ({ ...x, loading: false, error: msg, command: r.command }));
|
set(x => ({ ...x, loading: false, error: msg, command: r.command }));
|
||||||
if (tid) d.updateToast(tid, { kind: 'bad', title: t('toast.readFailedWhat', { what: o.title ?? method }), detail: msg, progress: undefined, job: undefined });
|
if (tid) d.updateToast(tid, { kind: 'bad', title: t('toast.readFailedWhat', { what: o.title ?? method }), detail: withHint(msg), progress: undefined, job: undefined });
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (my !== seq.current) return;
|
if (my !== seq.current) return;
|
||||||
|
|
|
||||||
|
|
@ -771,3 +771,114 @@ textarea.input { height: auto; padding: 8px 10px; line-height: 1.45; resize: ver
|
||||||
.table.pf th:last-child, .table.pf td:last-child { padding-right: 18px; }
|
.table.pf th:last-child, .table.pf td:last-child { padding-right: 18px; }
|
||||||
.table.pf .cell-app .s { max-width: 200px; }
|
.table.pf .cell-app .s { max-width: 200px; }
|
||||||
.table.pf .mini-health .spark { width: 56px; }
|
.table.pf .mini-health .spark { width: 56px; }
|
||||||
|
|
||||||
|
|
||||||
|
/* ---- full CLI coverage: export menu, prices, store art, growth chart, app info, onboarding studio ---- */
|
||||||
|
.tabs { overflow-x: auto; scrollbar-width: none; }
|
||||||
|
.tabs::-webkit-scrollbar { display: none; }
|
||||||
|
.tab { flex: none; }
|
||||||
|
.menu-wrap { position: relative; }
|
||||||
|
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 280px; max-width: 360px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); display: grid; gap: 1px; animation: rise var(--speed) var(--ease); }
|
||||||
|
.menu-item { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--ink-2); }
|
||||||
|
.menu-item > svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
|
||||||
|
.menu-item .grow { flex: 1; min-width: 0; display: grid; gap: 1px; }
|
||||||
|
.menu-item .mi-t { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||||
|
.menu-item .mi-s { font-size: var(--t-micro); color: var(--muted); }
|
||||||
|
.menu-item:hover, .menu-item:focus-visible { background: var(--accent-soft); outline: none; }
|
||||||
|
.menu-item:hover > svg, .menu-item:focus-visible > svg { color: var(--accent-solid); }
|
||||||
|
.menu-item[aria-disabled="true"] .mi-t { color: var(--muted); }
|
||||||
|
.fix-hint { display: inline-flex; align-items: flex-start; gap: 6px; font-weight: 560; color: var(--ink-2); }
|
||||||
|
.fix-hint svg { width: 13px; height: 13px; margin-top: 2px; flex: none; color: var(--accent-solid); }
|
||||||
|
.notice .fix-hint { color: inherit; }
|
||||||
|
.err-foot { align-items: flex-start; color: var(--bad-ink); }
|
||||||
|
.err-foot .grow { display: grid; gap: 4px; }
|
||||||
|
.err-foot .fix-hint { color: var(--ink-2); }
|
||||||
|
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
|
||||||
|
.bad-ink { color: var(--bad-ink); } .warn-ink { color: var(--warn-ink); }
|
||||||
|
|
||||||
|
/* prices */
|
||||||
|
.px-matrix td { vertical-align: top; }
|
||||||
|
.px-matrix tbody tr.sel td { background: var(--accent-soft); }
|
||||||
|
.px-matrix tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent-solid); }
|
||||||
|
.px-stack { display: grid; gap: 3px; justify-items: start; }
|
||||||
|
.px-line { display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-meta); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
||||||
|
.px-line svg { width: 12px; height: 12px; color: var(--muted); }
|
||||||
|
.px-line.auto { color: var(--muted); font-weight: 500; }
|
||||||
|
|
||||||
|
/* app info */
|
||||||
|
.ask-card { border-color: color-mix(in srgb, var(--warn-solid) 45%, var(--line)); box-shadow: var(--shadow-1), inset 3px 0 0 var(--warn-solid); }
|
||||||
|
.ask-card .card-head h2 > svg { color: var(--warn-solid); }
|
||||||
|
.ask-card .fix { margin-top: 4px; }
|
||||||
|
.notes-preview { max-height: 120px; overflow: auto; font-size: var(--t-meta); }
|
||||||
|
.ds-changes { max-height: 180px; overflow: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
|
||||||
|
.ds-changes code { font-size: 10.5px; }
|
||||||
|
|
||||||
|
/* store art */
|
||||||
|
.art-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; border-bottom: 1px solid var(--line); }
|
||||||
|
.art-bar .grow { flex: 1; }
|
||||||
|
.art-rows { display: grid; }
|
||||||
|
.art-row { padding: 14px 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
|
||||||
|
.art-row:first-child { border-top: 0; }
|
||||||
|
.art-row.bad { box-shadow: inset 3px 0 0 var(--bad-solid); }
|
||||||
|
.art-row h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--t-body); font-weight: 650; }
|
||||||
|
.art-row h3 code { font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 450; }
|
||||||
|
.art-tiles { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
|
||||||
|
.art-tile { margin: 0; flex: none; width: var(--tw, 150px); display: grid; gap: 5px; align-content: start; }
|
||||||
|
.art-pic { all: unset; box-sizing: border-box; display: block; width: 100%; aspect-ratio: var(--ar); background: var(--bg-sunken); border-radius: 10px; overflow: hidden; cursor: zoom-in; position: relative; border: 2px solid transparent; box-shadow: var(--shadow-1); transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease); }
|
||||||
|
.art-pic:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
|
||||||
|
.art-pic:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
|
||||||
|
.art-pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
|
||||||
|
.art-tile.err .art-pic { border-color: var(--bad-solid); }
|
||||||
|
.art-tile.warn .art-pic { border-color: var(--warn-solid); }
|
||||||
|
.art-ph { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--faint); font-size: var(--t-micro); padding: 10px; text-align: center; }
|
||||||
|
.art-ph svg { width: 20px; height: 20px; }
|
||||||
|
.art-ph .sk-block { width: 100%; height: 100%; border-radius: 0; position: absolute; inset: 0; }
|
||||||
|
.art-play { position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; display: grid; place-items: center; background: rgba(10, 15, 26, .62); color: #fff; }
|
||||||
|
.art-play svg { width: 16px; height: 16px; margin-left: 2px; }
|
||||||
|
.art-tile figcaption { display: flex; justify-content: space-between; gap: 6px; font-size: 10.5px; }
|
||||||
|
.art-tile figcaption .muted { font-variant-numeric: tabular-nums; white-space: nowrap; }
|
||||||
|
.art-issues li { padding-left: 12px; position: relative; overflow-wrap: anywhere; }
|
||||||
|
.art-issues li::before { content: ""; position: absolute; left: 1px; top: .45em; width: 6px; height: 6px; border-radius: 50%; background: var(--warn-solid); }
|
||||||
|
.art-issues li.error { color: var(--bad-ink); }
|
||||||
|
.art-issues li.error::before { background: var(--bad-solid); }
|
||||||
|
.fchip .tag-count { margin-left: -2px; }
|
||||||
|
.lightbox { place-items: center; padding: 28px; }
|
||||||
|
.lb { width: min(1100px, 100%); max-height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-3); overflow: hidden; outline: none; animation: rise var(--speed) var(--ease); }
|
||||||
|
.lb-img { min-height: 0; display: grid; place-items: center; background: var(--bg-sunken); padding: 16px; }
|
||||||
|
.lb-img img { max-width: 100%; max-height: calc(100vh - 190px); object-fit: contain; border-radius: 8px; box-shadow: var(--shadow-2); }
|
||||||
|
.lb-img .stack { width: 320px; }
|
||||||
|
.lb-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
|
||||||
|
.lb-foot .grow { flex: 1; min-width: 0; display: grid; gap: 2px; }
|
||||||
|
|
||||||
|
/* growth chart */
|
||||||
|
.lchart { display: grid; gap: 8px; }
|
||||||
|
.lchart svg { width: 100%; height: auto; display: block; overflow: visible; outline: none; border-radius: 8px; }
|
||||||
|
.lchart svg:focus-visible { box-shadow: 0 0 0 2px var(--focus); }
|
||||||
|
.lchart .grid-l line { stroke: var(--line); stroke-width: 1; }
|
||||||
|
.lchart text { font-size: 10.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
|
||||||
|
.lchart .stop-a { stop-color: var(--accent-solid); stop-opacity: .18; }
|
||||||
|
.lchart .stop-b { stop-color: var(--accent-solid); stop-opacity: 0; }
|
||||||
|
.lchart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
|
||||||
|
.lchart .ln.l1 { stroke: var(--accent-solid); }
|
||||||
|
.lchart .ln.l2 { stroke: var(--ok-solid); }
|
||||||
|
.lchart .ln.l3 { stroke: var(--warn-solid); stroke-dasharray: 5 4; }
|
||||||
|
.lchart circle.l1 { fill: var(--accent-solid); } .lchart circle.l2 { fill: var(--ok-solid); } .lchart circle.l3 { fill: var(--warn-solid); }
|
||||||
|
.lchart .ev line { stroke: var(--info-solid); stroke-width: 1.25; stroke-dasharray: 3 4; }
|
||||||
|
.lchart .ev circle { fill: var(--info-solid); stroke: var(--surface); stroke-width: 2; cursor: help; }
|
||||||
|
.lchart .hov line { stroke: var(--line-2); stroke-width: 1; }
|
||||||
|
.lchart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--t-meta); color: var(--muted); align-items: center; }
|
||||||
|
.lchart-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
|
||||||
|
.lchart-legend b { color: var(--ink); font-weight: 650; }
|
||||||
|
.lchart-legend .sw { width: 14px; height: 3px; border-radius: 2px; background: var(--accent-solid); }
|
||||||
|
.lchart-legend .sw.l2 { background: var(--ok-solid); }
|
||||||
|
.lchart-legend .sw.l3 { background: repeating-linear-gradient(90deg, var(--warn-solid) 0 5px, transparent 5px 8px); }
|
||||||
|
.lchart-legend .sw.ev { width: 8px; height: 8px; border-radius: 50%; background: var(--info-solid); }
|
||||||
|
|
||||||
|
/* onboarding: three choices, studio pick */
|
||||||
|
.choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
||||||
|
button.ck.ck-pick { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; }
|
||||||
|
button.ck.ck-pick:hover { border-color: var(--accent-line); }
|
||||||
|
button.ck.ck-pick:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
|
||||||
|
button.ck.ck-pick[aria-checked="true"] { border-color: var(--accent-solid); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-solid) 16%, transparent); }
|
||||||
|
.studio-new { cursor: default; }
|
||||||
|
.studio-new:hover { border-color: var(--line); box-shadow: none; }
|
||||||
|
|
|
||||||
106
apps/desktop/src/ui/Exports.tsx
Normal file
106
apps/desktop/src/ui/Exports.tsx
Normal file
|
|
@ -0,0 +1,106 @@
|
||||||
|
// Exports of the current screen: each screen registers what it can save (useExports); the top bar shows them in one
|
||||||
|
// "Export" menu at the top right of every screen, and the command palette lists them under "Export". Saving goes
|
||||||
|
// through the host's native save dialog (Downloads first); exports with personal data get the host's note first.
|
||||||
|
import { createContext, type ReactNode, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
|
import { api, errorText, type ExportKind } from '../api';
|
||||||
|
import { t } from '../i18n';
|
||||||
|
import { useData } from '../store';
|
||||||
|
import { Icon, type IconName } from './icons';
|
||||||
|
|
||||||
|
export interface ExportItem {
|
||||||
|
id: string;
|
||||||
|
label: string;
|
||||||
|
icon?: IconName;
|
||||||
|
kind: ExportKind;
|
||||||
|
/** File name without the extension ("Prism Puddle prices 2026-10-11"). */
|
||||||
|
file: string;
|
||||||
|
/** Reviewer names, texts: the host shows the personal-data note before the save dialog. */
|
||||||
|
personal?: boolean;
|
||||||
|
/** Not available yet (nothing read): the menu says why. */
|
||||||
|
disabled?: string | false;
|
||||||
|
build: () => string | Promise<string>;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Ctx { items: ExportItem[]; set: (owner: string, items: ExportItem[] | null) => void }
|
||||||
|
const ExportCtx = createContext<Ctx | null>(null);
|
||||||
|
|
||||||
|
export function ExportProvider({ children }: { children: ReactNode }) {
|
||||||
|
const [map, setMap] = useState<Record<string, ExportItem[]>>({});
|
||||||
|
const set = useCallback((owner: string, items: ExportItem[] | null) => setMap(m => {
|
||||||
|
const next = { ...m };
|
||||||
|
if (items) next[owner] = items; else delete next[owner];
|
||||||
|
return next;
|
||||||
|
}), []);
|
||||||
|
const items = useMemo(() => Object.values(map).flat(), [map]);
|
||||||
|
return <ExportCtx.Provider value={useMemo(() => ({ items, set }), [items, set])}>{children}</ExportCtx.Provider>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useExportItems = (): ExportItem[] => useContext(ExportCtx)?.items ?? [];
|
||||||
|
|
||||||
|
/** Registers this screen's exports while it is shown. `build` closures always see the latest data. */
|
||||||
|
export function useExports(owner: string, items: ExportItem[]) {
|
||||||
|
const ctx = useContext(ExportCtx);
|
||||||
|
const ref = useRef(items);
|
||||||
|
ref.current = items;
|
||||||
|
const key = items.map(i => `${i.id}:${i.label}:${i.disabled || ''}:${i.file}`).join('|');
|
||||||
|
useEffect(() => {
|
||||||
|
if (!ctx) return;
|
||||||
|
ctx.set(owner, ref.current.map((it, n) => ({ ...it, build: () => ref.current[n]!.build() })));
|
||||||
|
return () => ctx.set(owner, null);
|
||||||
|
}, [owner, key]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Runs one export: build, native save dialog, a toast with where it went. */
|
||||||
|
export function useRunExport() {
|
||||||
|
const d = useData();
|
||||||
|
return useCallback(async (it: ExportItem) => {
|
||||||
|
if (it.disabled) { d.toast({ kind: 'info', title: it.label, detail: it.disabled }); return; }
|
||||||
|
try {
|
||||||
|
const content = await it.build();
|
||||||
|
const path = await api.exportSave(it.file, it.kind, content, !!it.personal);
|
||||||
|
if (path) d.toast({ kind: 'ok', title: t('export.saved'), detail: path });
|
||||||
|
} catch (e) { d.toast({ kind: 'bad', title: t('export.failed'), detail: errorText(e) }); }
|
||||||
|
}, [d]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** The top-right "Export" button and its menu (hidden when the screen has nothing to export). */
|
||||||
|
export function ExportMenu() {
|
||||||
|
const items = useExportItems();
|
||||||
|
const run = useRunExport();
|
||||||
|
const [open, setOpen] = useState(false);
|
||||||
|
const root = useRef<HTMLDivElement>(null);
|
||||||
|
useEffect(() => {
|
||||||
|
if (!open) return;
|
||||||
|
const close = (e: MouseEvent) => { if (!root.current?.contains(e.target as Node)) setOpen(false); };
|
||||||
|
const key = (e: KeyboardEvent) => { if (e.key === 'Escape') { setOpen(false); root.current?.querySelector<HTMLElement>('button')?.focus(); } };
|
||||||
|
window.addEventListener('mousedown', close);
|
||||||
|
window.addEventListener('keydown', key);
|
||||||
|
root.current?.querySelector<HTMLElement>('[role="menuitem"]')?.focus();
|
||||||
|
return () => { window.removeEventListener('mousedown', close); window.removeEventListener('keydown', key); };
|
||||||
|
}, [open]);
|
||||||
|
if (!items.length) return null;
|
||||||
|
const onMenuKey = (e: React.KeyboardEvent) => {
|
||||||
|
const els = [...(root.current?.querySelectorAll<HTMLElement>('[role="menuitem"]') ?? [])];
|
||||||
|
const i = els.indexOf(document.activeElement as HTMLElement);
|
||||||
|
if (e.key === 'ArrowDown') { e.preventDefault(); els[(i + 1) % els.length]?.focus(); }
|
||||||
|
if (e.key === 'ArrowUp') { e.preventDefault(); els[(i - 1 + els.length) % els.length]?.focus(); }
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<div className="menu-wrap" ref={root}>
|
||||||
|
<button className="btn btn-sm" aria-haspopup="menu" aria-expanded={open} onClick={() => setOpen(o => !o)} title={t('export.hint')}>
|
||||||
|
<Icon name="share" />{t('export.button')}<Icon name="chevronDown" />
|
||||||
|
</button>
|
||||||
|
{open && (
|
||||||
|
<div className="menu" role="menu" aria-label={t('export.button')} onKeyDown={onMenuKey}>
|
||||||
|
{items.map(it => (
|
||||||
|
<button key={it.id} role="menuitem" className="menu-item" aria-disabled={it.disabled ? true : undefined} onClick={() => { setOpen(false); run(it); }}>
|
||||||
|
<Icon name={it.icon ?? 'download'} />
|
||||||
|
<span className="grow"><span className="mi-t">{it.label}</span>{it.disabled ? <span className="mi-s">{it.disabled}</span> : <span className="mi-s">.{it.kind}{it.personal ? ` · ${t('export.personal')}` : ''}</span>}</span>
|
||||||
|
{it.personal && <Icon name="lock" className="ic13 muted" />}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
59
apps/desktop/src/ui/LineChart.tsx
Normal file
59
apps/desktop/src/ui/LineChart.tsx
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
// A small two-axis line chart for daily store analytics: counts on the left axis (reach, installs), a rate on the
|
||||||
|
// right (conversion), store changes from git as dashed markers. Hover (or arrow keys when focused) shows one day.
|
||||||
|
import { type KeyboardEvent, useId, useState } from 'react';
|
||||||
|
import { date, num, pct } from '../lib/format';
|
||||||
|
|
||||||
|
export interface ChartLine { label: string; values: (number | null)[]; cls: 'l1' | 'l2' | 'l3'; axis: 'left' | 'right' }
|
||||||
|
|
||||||
|
export function LineChart({ dates, lines, events, label, eventsLabel }: { dates: string[]; lines: ChartLine[]; events: { date: string; subject: string }[]; label: string; eventsLabel: string }) {
|
||||||
|
const W = 800, H = 230, L = 46, R = 46, T = 12, B = 26;
|
||||||
|
const gid = useId().replace(/:/g, '');
|
||||||
|
const [hover, setHover] = useState<number | null>(null);
|
||||||
|
const n = dates.length;
|
||||||
|
if (n < 2) return null;
|
||||||
|
const x = (i: number) => L + (i / (n - 1)) * (W - L - R);
|
||||||
|
const max = (axis: 'left' | 'right') => Math.max(...lines.filter(l => l.axis === axis).flatMap(l => l.values.filter((v): v is number => v !== null)), axis === 'right' ? 0.001 : 1) * 1.1;
|
||||||
|
const mL = max('left'), mR = max('right');
|
||||||
|
const y = (v: number, axis: 'left' | 'right') => H - B - (v / (axis === 'left' ? mL : mR)) * (H - T - B);
|
||||||
|
const path = (l: ChartLine) => l.values.map((v, i) => (v === null ? '' : `${i && l.values[i - 1] !== null ? 'L' : 'M'}${x(i).toFixed(1)} ${y(v, l.axis).toFixed(1)}`)).join(' ');
|
||||||
|
const ticks = [0, 0.5, 1];
|
||||||
|
const onMove = (ev: React.MouseEvent<SVGSVGElement>) => {
|
||||||
|
const r = ev.currentTarget.getBoundingClientRect();
|
||||||
|
const px = ((ev.clientX - r.left) / r.width) * W;
|
||||||
|
setHover(Math.max(0, Math.min(n - 1, Math.round(((px - L) / (W - L - R)) * (n - 1)))));
|
||||||
|
};
|
||||||
|
const onKey = (ev: KeyboardEvent) => {
|
||||||
|
if (ev.key === 'ArrowRight') { ev.preventDefault(); setHover(h => Math.min(n - 1, (h ?? -1) + 1)); }
|
||||||
|
if (ev.key === 'ArrowLeft') { ev.preventDefault(); setHover(h => Math.max(0, (h ?? n) - 1)); }
|
||||||
|
};
|
||||||
|
const fmt = (l: ChartLine, v: number | null) => (v === null ? '–' : l.axis === 'right' ? pct(v, 1) : num(v));
|
||||||
|
return (
|
||||||
|
<div className="lchart">
|
||||||
|
<svg viewBox={`0 0 ${W} ${H}`} role="img" aria-label={label} tabIndex={0} onMouseMove={onMove} onMouseLeave={() => setHover(null)} onKeyDown={onKey} onBlur={() => setHover(null)}>
|
||||||
|
<defs><linearGradient id={`lg${gid}`} x1="0" y1="0" x2="0" y2="1"><stop offset="0" className="stop-a" /><stop offset="1" className="stop-b" /></linearGradient></defs>
|
||||||
|
{ticks.map(f => (
|
||||||
|
<g key={f} className="grid-l">
|
||||||
|
<line x1={L} x2={W - R} y1={H - B - f * (H - T - B)} y2={H - B - f * (H - T - B)} />
|
||||||
|
<text x={L - 6} y={H - B - f * (H - T - B) + 4} textAnchor="end">{num(f * mL / 1.1)}</text>
|
||||||
|
<text x={W - R + 6} y={H - B - f * (H - T - B) + 4}>{pct(f * mR / 1.1, 1)}</text>
|
||||||
|
</g>
|
||||||
|
))}
|
||||||
|
{events.map((e, i) => {
|
||||||
|
const k = dates.indexOf(e.date);
|
||||||
|
if (k < 0) return null;
|
||||||
|
return <g key={i} className="ev"><line x1={x(k)} x2={x(k)} y1={T} y2={H - B} /><circle cx={x(k)} cy={T + 4} r={4}><title>{`${date(e.date)} · ${e.subject}`}</title></circle></g>;
|
||||||
|
})}
|
||||||
|
{lines[0] && <path className="area" d={`${path(lines[0])} L${x(n - 1)} ${H - B} L${x(0)} ${H - B} Z`} fill={`url(#lg${gid})`} />}
|
||||||
|
{lines.map(l => <path key={l.label} className={`ln ${l.cls}`} d={path(l)} />)}
|
||||||
|
{hover !== null && <g className="hov"><line x1={x(hover)} x2={x(hover)} y1={T} y2={H - B} />{lines.map(l => (l.values[hover] === null ? null : <circle key={l.label} className={l.cls} cx={x(hover)} cy={y(l.values[hover]!, l.axis)} r={3.5} />))}</g>}
|
||||||
|
<text className="ax" x={L} y={H - 6}>{date(dates[0])}</text>
|
||||||
|
<text className="ax" x={W - R} y={H - 6} textAnchor="end">{date(dates[n - 1])}</text>
|
||||||
|
</svg>
|
||||||
|
<div className="lchart-legend" aria-live="polite">
|
||||||
|
{hover !== null && <b className="num">{date(dates[hover])}</b>}
|
||||||
|
{lines.map(l => <span key={l.label} className="lg"><span className={`sw ${l.cls}`} />{l.label}{hover !== null && <b className="num">{fmt(l, l.values[hover] ?? null)}</b>}</span>)}
|
||||||
|
{events.length > 0 && <span className="lg"><span className="sw ev" />{eventsLabel}</span>}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -61,6 +61,14 @@ const P = {
|
||||||
sliders: 'M4 6.5h9M17 6.5h3M4 12h3M11 12h9M4 17.5h11M19 17.5h1M15 4.5v4M9 10v4M17 15.5v4',
|
sliders: 'M4 6.5h9M17 6.5h3M4 12h3M11 12h9M4 17.5h11M19 17.5h1M15 4.5v4M9 10v4M17 15.5v4',
|
||||||
rotate: 'M4 12a8 8 0 1 0 2.4-5.7L4 8.5M4 4v4.5h4.5',
|
rotate: 'M4 12a8 8 0 1 0 2.4-5.7L4 8.5M4 4v4.5h4.5',
|
||||||
cloud: 'M7 18.5h10.5a4 4 0 0 0 .6-8 6 6 0 0 0-11.6 1.6A3.3 3.3 0 0 0 7 18.5z',
|
cloud: 'M7 18.5h10.5a4 4 0 0 0 .6-8 6 6 0 0 0-11.6 1.6A3.3 3.3 0 0 0 7 18.5z',
|
||||||
|
coins: 'M9 10c3.3 0 6-1.1 6-2.5S12.3 5 9 5 3 6.1 3 7.5 5.7 10 9 10zM3 7.5v4C3 12.9 5.7 14 9 14s6-1.1 6-2.5v-4M9 18c3.3 0 6-1.1 6-2.5v-4M3 11.5v4C3 16.9 5.7 18 9 18M15.5 10.2c3 .2 5.5 1.2 5.5 2.3v4c0 1.4-2.7 2.5-6 2.5-1.3 0-2.5-.2-3.5-.5',
|
||||||
|
chart: 'M4 19.5h16M6.5 16l4-5 3 3 5-7M15.5 7h3v3',
|
||||||
|
flask: 'M9.5 3.5h5M10.5 3.5v5.2L5 18.2a1.5 1.5 0 0 0 1.3 2.3h11.4a1.5 1.5 0 0 0 1.3-2.3l-5.5-9.5V3.5M7.5 14.5h9',
|
||||||
|
grid: 'M4 4h4.5v6H4zM9.75 4h4.5v6h-4.5zM15.5 4H20v6h-4.5zM4 14h4.5v6H4zM9.75 14h4.5v6h-4.5zM15.5 14H20v6h-4.5z',
|
||||||
|
clipboard: 'M9 4.5H6.5A1.5 1.5 0 0 0 5 6v13.5A1.5 1.5 0 0 0 6.5 21h11a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H15M9 3h6v3H9zM8.5 11.5l2 2 4-4M8.5 17h7',
|
||||||
|
share: 'M12 15V3.5M7.5 8 12 3.5 16.5 8M5 12.5v6A1.5 1.5 0 0 0 6.5 20h11a1.5 1.5 0 0 0 1.5-1.5v-6',
|
||||||
|
lock: 'M6.5 10.5h11A1.5 1.5 0 0 1 19 12v7a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 5 19v-7a1.5 1.5 0 0 1 1.5-1.5zM8.5 10.5V7.5a3.5 3.5 0 0 1 7 0v3',
|
||||||
|
question: 'M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM9.6 9.3a2.5 2.5 0 0 1 4.8.9c0 1.7-2.4 2.2-2.4 3.8M12 17v.1',
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type IconName = keyof typeof P;
|
export type IconName = keyof typeof P;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import type { ReleasePhase, StoreRelease } from '../api';
|
||||||
import { t } from '../i18n';
|
import { t } from '../i18n';
|
||||||
import { share } from '../lib/format';
|
import { share } from '../lib/format';
|
||||||
import { hueOf, monogram, type Tone } from '../lib/model';
|
import { hueOf, monogram, type Tone } from '../lib/model';
|
||||||
|
import { fixHint } from '../lib/views';
|
||||||
import { Icon, type IconName, StoreGlyph } from './icons';
|
import { Icon, type IconName, StoreGlyph } from './icons';
|
||||||
import { Illo, type IlloName } from './illustrations';
|
import { Illo, type IlloName } from './illustrations';
|
||||||
|
|
||||||
|
|
@ -109,6 +110,25 @@ export function Notice({ tone, children, icon, action }: { tone: 'bad' | 'warn'
|
||||||
return <div className={`notice ${tone}`} role={tone === 'bad' ? 'alert' : 'status'}><Icon name={ic} /><div className="grow">{children}</div>{action}</div>;
|
return <div className={`notice ${tone}`} role={tone === 'bad' ? 'alert' : 'status'}><Icon name={ic} /><div className="grow">{children}</div>{action}</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** A failed read or write in words, with how to fix it when the error is a known one ("errors that say how to fix"). */
|
||||||
|
export function ErrorNotice({ error, tone = 'warn', keep, action }: { error: string; tone?: 'bad' | 'warn'; keep?: boolean; action?: ReactNode }) {
|
||||||
|
const hint = fixHint(error);
|
||||||
|
return (
|
||||||
|
<Notice tone={tone} action={action}>
|
||||||
|
<div className="stack" style={{ gap: 4 }}>
|
||||||
|
<span>{keep ? t('common.readFailedKeep', { error }) : error}</span>
|
||||||
|
{hint && <span className="fix-hint"><Icon name="wand" />{t(hint)}</span>}
|
||||||
|
</div>
|
||||||
|
</Notice>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** A card footer with a failed read and, when known, how to fix it. */
|
||||||
|
export function ErrorFoot({ error }: { error: string }) {
|
||||||
|
const hint = fixHint(error);
|
||||||
|
return <div className="card-foot err-foot"><Icon name="alertCircle" /><span className="grow">{error}{hint && <span className="fix-hint"><Icon name="wand" />{t(hint)}</span>}</span></div>;
|
||||||
|
}
|
||||||
|
|
||||||
export function Skeleton({ lines = 3, block }: { lines?: number; block?: boolean }) {
|
export function Skeleton({ lines = 3, block }: { lines?: number; block?: boolean }) {
|
||||||
return (
|
return (
|
||||||
<div className="stack" aria-busy="true" aria-label={t('common.loading')}>
|
<div className="stack" aria-busy="true" aria-label={t('common.loading')}>
|
||||||
|
|
|
||||||
65
apps/desktop/tests/complete.test.ts
Normal file
65
apps/desktop/tests/complete.test.ts
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
// Full CLI coverage, window side: export formats (the prices CSV re-imports), price matrix, diff summary, chart
|
||||||
|
// series, store art filters and the "how to fix it" hints.
|
||||||
|
import { describe, expect, test } from 'bun:test';
|
||||||
|
import type { PricesCurrent } from '../src/api';
|
||||||
|
import { csv, mdTable, pricesCsv, reviewsCsv } from '../src/lib/exports';
|
||||||
|
import { chartSeries, diffSummary, fixHint, priceMatrix, priceStats, regionRows } from '../src/lib/views';
|
||||||
|
import { parsePriceCsv } from '../../../cli/lib/prices';
|
||||||
|
|
||||||
|
const P: PricesCurrent = {
|
||||||
|
csv: '/x/store/prices.csv', products: ['a', 'b'], stores: ['apple', 'play'], missing: [{ product: 'b', store: 'play' }],
|
||||||
|
rows: [
|
||||||
|
{ product: 'a', store: 'apple', region: 'US', currency: 'USD', price: 0.99, kind: 'manual' },
|
||||||
|
{ product: 'a', store: 'apple', region: 'TR', currency: 'TRY', price: 39.99, kind: 'auto' },
|
||||||
|
{ product: 'a', store: 'apple', region: 'TR', currency: 'TRY', price: 29.99, kind: 'manual' },
|
||||||
|
{ product: 'a', store: 'play', region: 'US', currency: 'USD', price: 0.99 },
|
||||||
|
{ product: 'a', store: 'play', region: 'TR', currency: 'TRY', price: 19.99 },
|
||||||
|
{ product: 'a', store: 'apple', region: 'BR', currency: 'BRL', price: 6.9, startDate: '2030-01-01', kind: 'manual' },
|
||||||
|
{ product: 'b', store: 'apple', region: 'US', currency: 'USD', price: 4.99, kind: 'manual' },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
describe('exports', () => {
|
||||||
|
test('CSV quoting and formula guard', () => {
|
||||||
|
expect(csv(['a', 'b'], [['x,y', '=SUM(A1)'], [-1, null]])).toBe('a,b\n"x,y",\'=SUM(A1)\n-1,\n');
|
||||||
|
expect(mdTable(['a'], [['x|y']])).toBe('| a |\n| --- |\n| x\\|y |\n');
|
||||||
|
});
|
||||||
|
test('the prices CSV is the `prices import` sheet', () => {
|
||||||
|
const rows = parsePriceCsv(pricesCsv(P), { products: ['a', 'b'], today: '2026-01-01' });
|
||||||
|
expect(rows.filter(r => r.kind !== 'auto').length).toBe(6);
|
||||||
|
expect(rows.filter(r => r.region === 'TR' && r.store === 'apple').map(r => r.price)).toEqual([29.99]);
|
||||||
|
expect(rows.find(r => r.region === 'BR')?.startDate).toBe('2030-01-01');
|
||||||
|
});
|
||||||
|
test('reviews CSV', () => {
|
||||||
|
expect(reviewsCsv([{ store: 'play', id: '1', rating: 2, body: 'Crash, again', date: '2026-10-01T10:00:00Z', where: 'en' }]).split('\n')[1]).toBe('Google Play,2026-10-01,2,en,,,"Crash, again",no,');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('views', () => {
|
||||||
|
test('region rows: manual wins over equalized, scheduled apart, gap in one currency', () => {
|
||||||
|
const r = regionRows(P, 'a');
|
||||||
|
expect(r.map(x => x.region)).toEqual(['US', 'BR', 'TR']);
|
||||||
|
const tr = r.find(x => x.region === 'TR')!;
|
||||||
|
expect(tr.apple).toEqual({ price: 29.99, currency: 'TRY', kind: 'manual' });
|
||||||
|
expect(Math.round(tr.gapPct!)).toBe(33);
|
||||||
|
expect(r.find(x => x.region === 'BR')!.scheduled?.startDate).toBe('2030-01-01');
|
||||||
|
expect(priceMatrix(P).regions).toEqual(['US', 'BR', 'TR']);
|
||||||
|
expect(priceStats(P).gaps).toBe(1);
|
||||||
|
});
|
||||||
|
test('diff summary', () => {
|
||||||
|
expect(diffSummary([{ product: 'a', store: 'play', region: 'TR', currency: 'TRY', from: 10, to: 12, change: 'change' }, { product: 'b', store: 'play', region: 'KR', currency: 'KRW', from: null, to: 1, change: 'new' },
|
||||||
|
{ product: 'a', store: 'apple', region: 'US', currency: 'USD', from: 1, to: 1, change: 'same' }], ['a|play', 'b|play'])).toEqual({ changed: 1, added: 1, same: 1, up: 1, down: 0, products: ['a', 'b'], pairs: 2 });
|
||||||
|
});
|
||||||
|
test('chart series and events', () => {
|
||||||
|
const s = chartSeries({ snapshots: 1, since: '2026-01-01', series: { apple: [{ date: '2026-01-01', impressions: 100, uniqueImpressions: 0, pageViews: 0, uniquePageViews: 0, downloads: 5, firstTimeDownloads: 0 }, { date: '2026-01-02', impressions: 0, uniqueImpressions: 0, pageViews: 0, uniquePageViews: 0, downloads: 0, firstTimeDownloads: 0 }], play: [] },
|
||||||
|
effects: [{ event: { date: '2026-01-02', commit: 'abc', subject: 'x', files: [] }, store: 'apple', before: {}, after: {}, daysBefore: 1, daysAfter: 1 }] }, 'apple');
|
||||||
|
expect(s.conversion).toEqual([0.05, null]);
|
||||||
|
expect(s.events).toEqual([{ date: '2026-01-02', subject: 'x', commit: 'abc' }]);
|
||||||
|
});
|
||||||
|
test('errors that say how to fix them', () => {
|
||||||
|
expect(fixHint('PLAY_SERVICE_ACCOUNT is not set (env ...)')).toBe('hint.keys');
|
||||||
|
expect(fixHint('no snapshots in /x/.storebound/analytics (storebound analytics snapshot)')).toBe('hint.snapshot');
|
||||||
|
expect(fixHint('ffmpeg not found')).toBe('hint.ffmpeg');
|
||||||
|
expect(fixHint('something else')).toBeNull();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -1,12 +1,20 @@
|
||||||
// Offline summary of the project config: app name, store ids, languages, products, shots. No network, no credentials.
|
// Offline summary of the project config: app name, store ids, languages, products, shots. No network, no credentials.
|
||||||
// storebound inspect [--json]
|
// storebound inspect [--json]
|
||||||
// storebound inspect --icon --json the app icon as a data: URL (for the desktop app)
|
// storebound inspect --icon --json the app icon as a data: URL (for the desktop app)
|
||||||
// storebound inspect --listings [--json] listing completeness per language on both stores (+ rendered screenshots)
|
// storebound inspect --listings [--json] listing completeness per language on both stores (+ rendered screenshots)
|
||||||
|
// storebound inspect --listing-text --json the listing files as they are (desktop export)
|
||||||
|
// storebound inspect --declarations [--json] Data safety, App Privacy, app info, export compliance and App Review
|
||||||
|
// details from the config, with what only the owner can answer
|
||||||
|
// storebound inspect --render <file> --json one render (relative to the renders folder) as a data: URL
|
||||||
|
import { existsSync, readFileSync, statSync } from 'node:fs';
|
||||||
|
import { join } from 'node:path';
|
||||||
import { platformsOf, profileOf, sellsOn } from './lib/config';
|
import { platformsOf, profileOf, sellsOn } from './lib/config';
|
||||||
import type { Ctx } from './lib/ctx';
|
import type { Ctx } from './lib/ctx';
|
||||||
|
import { maskUser, reviewContact, reviewDemoAccount } from './lib/credentials';
|
||||||
|
import { DATA_SAFETY_UPLOADED, declarations } from './lib/declarations';
|
||||||
import type { ProjectSummary } from './lib/desktop-protocol';
|
import type { ProjectSummary } from './lib/desktop-protocol';
|
||||||
import { log, printJson } from './lib/log';
|
import { log, printJson } from './lib/log';
|
||||||
import { findIcon, iconDataUrl, listingCompleteness } from './lib/project-files';
|
import { findIcon, iconDataUrl, listingCompleteness, listingText, renderImage } from './lib/project-files';
|
||||||
|
|
||||||
export function summarize(ctx: Ctx): ProjectSummary {
|
export function summarize(ctx: Ctx): ProjectSummary {
|
||||||
const { config, root, path } = ctx.loaded;
|
const { config, root, path } = ctx.loaded;
|
||||||
|
|
@ -32,21 +40,40 @@ export function summarize(ctx: Ctx): ProjectSummary {
|
||||||
testflightGroups: config.apple?.testflight?.groups?.length ?? 0,
|
testflightGroups: config.apple?.testflight?.groups?.length ?? 0,
|
||||||
profile: profileOf(config),
|
profile: profileOf(config),
|
||||||
icon: findIcon(config, root),
|
icon: findIcon(config, root),
|
||||||
|
variants: Object.keys(config.shots?.variants ?? {}),
|
||||||
|
playReports: !!config.play?.reportsBucket,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function run(ctx: Ctx): Promise<void> {
|
export async function run(ctx: Ctx): Promise<void> {
|
||||||
const { config, root } = ctx.loaded;
|
const { config, root, resolve } = ctx.loaded;
|
||||||
if (ctx.args.has('icon')) { printJson(iconDataUrl(findIcon(config, root))); return; }
|
const a = ctx.args;
|
||||||
if (ctx.args.has('listings')) {
|
if (a.has('icon')) { printJson(iconDataUrl(findIcon(config, root))); return; }
|
||||||
|
if (a.has('listing-text')) { printJson(listingText(config, root)); return; }
|
||||||
|
if (a.get('render') !== undefined) {
|
||||||
|
printJson(renderImage(resolve(config.renders ?? config.shots?.out ?? 'store/renders'), a.get('render') ?? ''));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (a.has('declarations')) {
|
||||||
|
const up = join(root, DATA_SAFETY_UPLOADED);
|
||||||
|
let uploaded: { csv: string; at: string } | null = null;
|
||||||
|
try { if (existsSync(up)) uploaded = { csv: readFileSync(up, 'utf8'), at: statSync(up).mtime.toISOString() }; } catch { /* unreadable: never uploaded */ }
|
||||||
|
const demo = reviewDemoAccount(root), contact = reviewContact(root);
|
||||||
|
const d = declarations(config, { demoUser: demo ? maskUser(demo.username) : null, contactEmail: contact ? maskUser(contact.email) : null, uploaded });
|
||||||
|
if (a.has('json')) { printJson(d); return; }
|
||||||
|
for (const x of d.ask) log('inspect', `ask the owner (${x.area}): ${x.text} -> ${x.fix}`);
|
||||||
|
if (!d.ask.length) log('inspect', 'declarations: every answer comes from the config');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (a.has('listings')) {
|
||||||
const l = listingCompleteness(config, root);
|
const l = listingCompleteness(config, root);
|
||||||
if (ctx.args.has('json')) { printJson(l); return; }
|
if (a.has('json')) { printJson(l); return; }
|
||||||
for (const p of l.problems) log('inspect', p);
|
for (const p of l.problems) log('inspect', p);
|
||||||
for (const x of l.locales) log('inspect', `${x.lang.padEnd(6)} ${Math.round(x.complete * 100)} % complete${x.screenshots === null ? '' : ` · ${x.screenshots} screenshots`}`);
|
for (const x of l.locales) log('inspect', `${x.lang.padEnd(6)} ${Math.round(x.complete * 100)} % complete${x.screenshots === null ? '' : ` · ${x.screenshots} screenshots`}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const s = summarize(ctx);
|
const s = summarize(ctx);
|
||||||
if (ctx.args.has('json')) { printJson(s); return; }
|
if (a.has('json')) { printJson(s); return; }
|
||||||
log('inspect', `${s.name} · ${s.platforms.join(' + ')} · ${s.languages.length} languages · ${s.products} products · ${s.subscriptions} subscriptions`);
|
log('inspect', `${s.name} · ${s.platforms.join(' + ')} · ${s.languages.length} languages · ${s.products} products · ${s.subscriptions} subscriptions`);
|
||||||
log('inspect', `play ${s.play?.packageName ?? '-'} · apple ${s.apple?.bundleId ?? '-'}${s.apple?.appId ? ` (${s.apple.appId})` : ''}`);
|
log('inspect', `play ${s.play?.packageName ?? '-'} · apple ${s.apple?.bundleId ?? '-'}${s.apple?.appId ? ` (${s.apple.appId})` : ''}`);
|
||||||
log('inspect', `config ${s.config}`);
|
log('inspect', `config ${s.config}`);
|
||||||
|
|
|
||||||
144
cli/lib/declarations.ts
Normal file
144
cli/lib/declarations.ts
Normal file
|
|
@ -0,0 +1,144 @@
|
||||||
|
// The store declarations of one app as data, from the config and the local files only (the desktop "App info &
|
||||||
|
// privacy" tab, `storebound inspect --declarations --json`): Play Data safety answers (and what changed since the
|
||||||
|
// last upload, because Play has no API that reads the form back), the App Store App Privacy answers they suggest
|
||||||
|
// (App Privacy has no API at all: the owner enters it in App Store Connect), app info (categories, age rating,
|
||||||
|
// content rights), the export compliance answer and the App Review details (presence only, masked). Every answer the
|
||||||
|
// config does not prove is an "ask the owner" item, never a guess (AGENTS.md rule 5). Pure.
|
||||||
|
import { parseCsv } from './csv';
|
||||||
|
import { type DataSafety, type PlayPurpose, profileOf, type ShipConfig } from './config';
|
||||||
|
import { CATEGORIES, dataSafetyCsv } from './data-safety';
|
||||||
|
import type { DeclarationsResult, DeclAsk } from './desktop-protocol';
|
||||||
|
import { NOTES_MAX_BYTES, reviewNotes } from './review-details';
|
||||||
|
|
||||||
|
/** Where `storebound play data-safety` keeps the CSV it uploaded last (gitignored). */
|
||||||
|
export const DATA_SAFETY_UPLOADED = '.storebound/data-safety.uploaded.csv';
|
||||||
|
|
||||||
|
/** Play data type -> the App Store App Privacy data type it usually is (Apple's own names). */
|
||||||
|
export const APPLE_PRIVACY: Record<string, [string, string]> = {
|
||||||
|
PSL_NAME: ['Contact Info', 'Name'], PSL_EMAIL: ['Contact Info', 'Email Address'], PSL_PHONE: ['Contact Info', 'Phone Number'],
|
||||||
|
PSL_ADDRESS: ['Contact Info', 'Physical Address'], PSL_OTHER_PERSONAL: ['Contact Info', 'Other User Contact Info'], PSL_USER_ACCOUNT: ['Identifiers', 'User ID'],
|
||||||
|
PSL_RACE_ETHNICITY: ['Sensitive Info', 'Sensitive Info'], PSL_POLITICAL_RELIGIOUS: ['Sensitive Info', 'Sensitive Info'], PSL_SEXUAL_ORIENTATION_GENDER_IDENTITY: ['Sensitive Info', 'Sensitive Info'],
|
||||||
|
PSL_PURCHASE_HISTORY: ['Purchases', 'Purchase History'], PSL_CREDIT_SCORE: ['Financial Info', 'Credit Info'], PSL_CREDIT_DEBIT_BANK_ACCOUNT_NUMBER: ['Financial Info', 'Payment Info'],
|
||||||
|
PSL_OTHER: ['Financial Info', 'Other Financial Info'], PSL_APPROX_LOCATION: ['Location', 'Coarse Location'], PSL_PRECISE_LOCATION: ['Location', 'Precise Location'],
|
||||||
|
PSL_WEB_BROWSING_HISTORY: ['Browsing History', 'Browsing History'], PSL_EMAILS: ['User Content', 'Emails or Text Messages'], PSL_SMS_CALL_LOG: ['User Content', 'Emails or Text Messages'],
|
||||||
|
PSL_OTHER_MESSAGES: ['User Content', 'Emails or Text Messages'], PSL_PHOTOS: ['User Content', 'Photos or Videos'], PSL_VIDEOS: ['User Content', 'Photos or Videos'],
|
||||||
|
PSL_AUDIO: ['User Content', 'Audio Data'], PSL_MUSIC: ['User Content', 'Audio Data'], PSL_OTHER_AUDIO: ['User Content', 'Audio Data'], PSL_HEALTH: ['Health & Fitness', 'Health'],
|
||||||
|
PSL_FITNESS: ['Health & Fitness', 'Fitness'], PSL_CONTACTS: ['Contacts', 'Contacts'], PSL_CALENDAR: ['Other Data', 'Other Data Types'],
|
||||||
|
PSL_CRASH_LOGS: ['Diagnostics', 'Crash Data'], PSL_PERFORMANCE_DIAGNOSTICS: ['Diagnostics', 'Performance Data'], PSL_OTHER_PERFORMANCE: ['Diagnostics', 'Other Diagnostic Data'],
|
||||||
|
PSL_FILES_AND_DOCS: ['User Content', 'Other User Content'], PSL_USER_INTERACTION: ['Usage Data', 'Product Interaction'], PSL_IN_APP_SEARCH_HISTORY: ['Search History', 'Search History'],
|
||||||
|
PSL_APPS_ON_DEVICE: ['Other Data', 'Other Data Types'], PSL_USER_GENERATED_CONTENT: ['User Content', 'Other User Content'], PSL_OTHER_APP_ACTIVITY: ['Usage Data', 'Other Usage Data'],
|
||||||
|
PSL_DEVICE_ID: ['Identifiers', 'Device ID'],
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Play purpose -> App Privacy purpose. Advertising depends on who shows the ads (shared = third-party advertising). */
|
||||||
|
export function applePurpose(p: PlayPurpose, shared: boolean): string {
|
||||||
|
switch (p) {
|
||||||
|
case 'analytics': return 'Analytics';
|
||||||
|
case 'advertising': return shared ? 'Third-Party Advertising' : 'Developer\'s Advertising or Marketing';
|
||||||
|
case 'communications': return 'Developer\'s Advertising or Marketing';
|
||||||
|
case 'personalization': return 'Product Personalization';
|
||||||
|
default: return 'App Functionality';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const categoryOf = (type: string): string => CATEGORIES.find(([, ts]) => ts.includes(type))?.[0].replace('PSL_DATA_TYPES_', '').toLowerCase().replace(/_/g, ' ') ?? 'other';
|
||||||
|
|
||||||
|
/** Rows of a Data safety CSV keyed by question + response -> value (header dropped). */
|
||||||
|
export function dataSafetyAnswers(csv: string): Map<string, string> {
|
||||||
|
const m = new Map<string, string>();
|
||||||
|
for (const r of parseCsv(csv).slice(1)) m.set(`${r[0] ?? ''}|${r[1] ?? ''}`, (r[2] ?? '').trim());
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** What differs between the CSV uploaded last and the one the config makes now (answers only, labels ignored). */
|
||||||
|
export function dataSafetyChanges(uploaded: string, now: string): { question: string; response: string; from: string; to: string }[] {
|
||||||
|
const a = dataSafetyAnswers(uploaded), b = dataSafetyAnswers(now);
|
||||||
|
const out: { question: string; response: string; from: string; to: string }[] = [];
|
||||||
|
for (const k of new Set([...a.keys(), ...b.keys()])) {
|
||||||
|
const from = a.get(k) ?? '', to = b.get(k) ?? '';
|
||||||
|
if (from !== to) { const [question, response] = k.split('|') as [string, string]; out.push({ question, response, from, to }); }
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DeclarationInputs {
|
||||||
|
/** The demo account and review contact, masked (credentials.json / env): presence only, never the secrets. */
|
||||||
|
demoUser: string | null;
|
||||||
|
contactEmail: string | null;
|
||||||
|
/** The last uploaded Data safety CSV and its time, when there is one. */
|
||||||
|
uploaded: { csv: string; at: string } | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function declarations(config: ShipConfig, inp: DeclarationInputs): DeclarationsResult {
|
||||||
|
const ask: DeclAsk[] = [];
|
||||||
|
const play = !!config.play, apple = !!config.apple;
|
||||||
|
const profile = profileOf(config);
|
||||||
|
const ds: DataSafety | undefined = config.dataSafety;
|
||||||
|
let dataSafety: DeclarationsResult['dataSafety'] = null;
|
||||||
|
if (play && !ds) ask.push({ area: 'dataSafety', id: 'ds-missing', text: 'The config has no dataSafety answers, so storebound cannot fill the Play Data safety form.', fix: 'Answer what the app and its SDKs collect (store-declarations skill), then add dataSafety to storebound.config.ts.' });
|
||||||
|
if (ds) {
|
||||||
|
let csv = '';
|
||||||
|
try { csv = dataSafetyCsv(ds); } catch (e) { ask.push({ area: 'dataSafety', id: 'ds-invalid', text: (e as Error).message, fix: 'Use the Play data type ids (PSL_...) in dataSafety.data.' }); }
|
||||||
|
const types = Object.entries(ds.data).map(([id, u]) => ({ id, category: categoryOf(id), shared: !!u.shared, ephemeral: !!u.ephemeral, optional: !!u.optional, collect: [...u.collect], share: [...(u.shared ? u.share ?? [] : [])] }));
|
||||||
|
dataSafety = {
|
||||||
|
collectsData: ds.collectsData, encryptedInTransit: ds.encryptedInTransit, deletionRequest: ds.deletionRequest, accountCreation: ds.accountCreation ?? ['PSL_ACM_NONE'],
|
||||||
|
types, extra: ds.extra?.length ?? 0, csv, rows: csv ? csv.trim().split('\n').length - 1 : 0,
|
||||||
|
uploaded: inp.uploaded && csv ? { at: inp.uploaded.at, changes: dataSafetyChanges(inp.uploaded.csv, csv) } : null,
|
||||||
|
};
|
||||||
|
if (ds.collectsData && !types.length) ask.push({ area: 'dataSafety', id: 'ds-no-types', text: 'collectsData is true but no data type is listed.', fix: 'List each data type the app or its SDKs collect in dataSafety.data, or set collectsData: false if nothing is.' });
|
||||||
|
if (!ds.collectsData && types.length) ask.push({ area: 'dataSafety', id: 'ds-contradiction', text: 'collectsData is false but data types are listed.', fix: 'Decide which is true; Play rejects a form that says both.' });
|
||||||
|
if (profile === 'game' && !ds.data.PSL_DEVICE_ID) ask.push({ area: 'dataSafety', id: 'ds-ads-id', text: 'A game profile usually ships an ads or analytics SDK that reads the advertising id, but PSL_DEVICE_ID is not declared.', fix: 'Check every SDK\'s data disclosure; declare PSL_DEVICE_ID (advertising, analytics) if any reads it.' });
|
||||||
|
if (config.accounts?.enabled && (ds.accountCreation ?? ['PSL_ACM_NONE']).includes('PSL_ACM_NONE')) ask.push({ area: 'dataSafety', id: 'ds-accounts', text: 'The app has accounts, but the form says no account creation.', fix: 'Set dataSafety.accountCreation to the methods the app offers, and the delete-account URL in dataSafety.extra.' });
|
||||||
|
if (!ds.deletionRequest && config.accounts?.enabled) ask.push({ area: 'dataSafety', id: 'ds-deletion', text: 'Users can create accounts but deletionRequest is false.', fix: 'Both stores want account deletion (account-deletion skill); then set deletionRequest: true.' });
|
||||||
|
}
|
||||||
|
|
||||||
|
// App Privacy: suggested from the Data safety answers; linked / tracking are questions only the owner can answer
|
||||||
|
const byType = new Map<string, { apple: string; category: string; from: string[]; purposes: Set<string>; thirdParty: boolean }>();
|
||||||
|
for (const [id, u] of Object.entries(ds?.data ?? {})) {
|
||||||
|
const [category, name] = APPLE_PRIVACY[id] ?? ['Other Data', 'Other Data Types'];
|
||||||
|
const e = byType.get(name) ?? { apple: name, category, from: [], purposes: new Set<string>(), thirdParty: false };
|
||||||
|
e.from.push(id);
|
||||||
|
for (const p of u.collect) e.purposes.add(applePurpose(p, false));
|
||||||
|
for (const p of u.shared ? u.share ?? [] : []) e.purposes.add(applePurpose(p, true));
|
||||||
|
e.thirdParty ||= !!u.shared;
|
||||||
|
byType.set(name, e);
|
||||||
|
}
|
||||||
|
const appPrivacy: DeclarationsResult['appPrivacy'] = apple ? {
|
||||||
|
items: [...byType.values()].map(e => ({ apple: e.apple, category: e.category, from: e.from, purposes: [...e.purposes].sort(), thirdParty: e.thirdParty })),
|
||||||
|
fromDataSafety: !!ds,
|
||||||
|
} : null;
|
||||||
|
if (apple) {
|
||||||
|
if (!ds) ask.push({ area: 'appPrivacy', id: 'ap-unknown', text: 'App Privacy (App Store Connect > App Privacy) cannot be suggested without dataSafety answers in the config.', fix: 'Answer the data collection once in dataSafety; storebound then lists the matching App Privacy answers to enter.' });
|
||||||
|
else ask.push({ area: 'appPrivacy', id: 'ap-linked', text: 'App Privacy asks per data type whether it is linked to the user\'s identity and whether it is used for tracking; the config cannot prove either.', fix: 'Answer both in App Store Connect > App Privacy for each type below (tracking also needs App Tracking Transparency in the app).' });
|
||||||
|
}
|
||||||
|
|
||||||
|
const info = config.apple?.info;
|
||||||
|
const appInfo: DeclarationsResult['appInfo'] = apple ? {
|
||||||
|
categories: info?.categories ?? null,
|
||||||
|
ageRating: Object.entries(info?.ageRating ?? {}).map(([q, v]) => ({ question: q, value: v === null ? 'none' : String(v) })),
|
||||||
|
contentRights: info?.contentRights ?? null,
|
||||||
|
free: info?.free !== false,
|
||||||
|
} : null;
|
||||||
|
if (apple) {
|
||||||
|
if (!info?.categories) ask.push({ area: 'appInfo', id: 'ai-categories', text: 'No App Store category in the config.', fix: 'Set apple.info.categories.primary (for example GAMES with primarySubOne GAMES_PUZZLE).' });
|
||||||
|
if (!info?.ageRating) ask.push({ area: 'appInfo', id: 'ai-age', text: 'No age rating answers: storebound would answer every content question "none".', fix: 'Confirm that is true (ads, user-generated content, chat, loot boxes, web access count), or set apple.info.ageRating overrides.' });
|
||||||
|
if (!info?.contentRights) ask.push({ area: 'appInfo', id: 'ai-rights', text: 'Content rights are not declared.', fix: 'Set apple.info.contentRights: DOES_NOT_USE_THIRD_PARTY_CONTENT or USES_THIRD_PARTY_CONTENT (you hold the rights).' });
|
||||||
|
}
|
||||||
|
const encryption = apple ? config.apple?.usesNonExemptEncryption ?? null : null;
|
||||||
|
if (apple && encryption === null) ask.push({ area: 'encryption', id: 'enc-unset', text: 'Export compliance is not answered (apple.usesNonExemptEncryption).', fix: 'Decide it with the export-compliance skill; false only when the app uses no encryption beyond the OS. storebound never guesses it.' });
|
||||||
|
|
||||||
|
const notes = reviewNotes(config);
|
||||||
|
const signIn = config.reviewAccess ? config.reviewAccess.signInRequired : null;
|
||||||
|
const review: DeclarationsResult['review'] = {
|
||||||
|
signInRequired: signIn, accounts: !!config.accounts?.enabled,
|
||||||
|
contact: inp.contactEmail, demoAccount: inp.demoUser,
|
||||||
|
notes, notesBytes: new TextEncoder().encode(notes).length, notesMax: NOTES_MAX_BYTES,
|
||||||
|
};
|
||||||
|
if (apple) {
|
||||||
|
if (signIn === null) ask.push({ area: 'review', id: 'rv-signin', text: 'The config does not say whether reviewers need to sign in.', fix: 'Set reviewAccess.signInRequired (true needs a demo account; review-access skill).' });
|
||||||
|
if (signIn && !inp.demoUser) ask.push({ area: 'review', id: 'rv-demo', text: 'Sign-in is required but there is no demo account.', fix: 'Add "reviewDemoAccount": { "username", "password" } to .storebound/credentials.json (it stays on this machine).' });
|
||||||
|
if (!inp.contactEmail) ask.push({ area: 'review', id: 'rv-contact', text: 'No App Review contact.', fix: 'Add "reviewContact": { firstName, lastName, phone, email } to .storebound/credentials.json (personal data stays there).' });
|
||||||
|
if (review.notesBytes > NOTES_MAX_BYTES) ask.push({ area: 'review', id: 'rv-notes', text: `Review notes are ${review.notesBytes} bytes; App Store Connect takes ${NOTES_MAX_BYTES}.`, fix: 'Shorten apple.info.reviewNotes or reviewAccess.instructions.' });
|
||||||
|
}
|
||||||
|
return { profile, stores: { apple, play }, dataSafety, appPrivacy, appInfo, encryption, review, ask };
|
||||||
|
}
|
||||||
|
|
@ -96,6 +96,10 @@ export interface ProjectSummary {
|
||||||
profile?: string;
|
profile?: string;
|
||||||
/** Absolute path of the app icon the config or the usual places point at (project.icon reads it), or null. */
|
/** Absolute path of the app icon the config or the usual places point at (project.icon reads it), or null. */
|
||||||
icon?: string | null;
|
icon?: string | null;
|
||||||
|
/** A/B screenshot variant ids (shots.variants: store listing experiments, Product Page Optimization treatments). */
|
||||||
|
variants?: string[];
|
||||||
|
/** play.reportsBucket is set (Play statistics for analytics snapshots). */
|
||||||
|
playReports?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---- App-centric model (one app = one product on up to two platforms; a workspace holds many apps) ----
|
// ---- App-centric model (one app = one product on up to two platforms; a workspace holds many apps) ----
|
||||||
|
|
@ -249,3 +253,70 @@ export interface AccountCheck {
|
||||||
* its temp folder. Read methods only.
|
* its temp folder. Read methods only.
|
||||||
*/
|
*/
|
||||||
export interface VirtualProject { name: string; apple?: { bundleId: string; appId?: string | null } | null; play?: { packageName: string } | null }
|
export interface VirtualProject { name: string; apple?: { bundleId: string; appId?: string | null } | null; play?: { packageName: string } | null }
|
||||||
|
|
||||||
|
// ---- Desktop: every CLI area in the window (prices, declarations, renders, experiments, analytics) ----
|
||||||
|
/** prices.current (`prices export --json`): the current prices on both stores, one row per product x store x region. */
|
||||||
|
export interface PriceRowData { product: string; store: 'apple' | 'play'; region: string; territory?: string; currency: string; price: number; startDate?: string; kind?: 'manual' | 'auto' }
|
||||||
|
export interface PricesCurrent { csv: string; products: string[]; stores: ('apple' | 'play')[]; missing: { product: string; store: 'apple' | 'play' }[]; rows: PriceRowData[] }
|
||||||
|
/** prices.diff (`prices import --dry --json`): the sheet against the stores. */
|
||||||
|
export interface PriceDiffRow { product: string; store: 'apple' | 'play'; region: string; startDate?: string; currency: string; from: number | null; to: number; change: 'new' | 'change' | 'same' }
|
||||||
|
export interface PricesDiff { csv: string; diff: PriceDiffRow[]; changed: string[] }
|
||||||
|
/** One "ask the owner" item: the config does not prove the answer (AGENTS.md rule 5). */
|
||||||
|
export interface DeclAsk { area: 'dataSafety' | 'appPrivacy' | 'appInfo' | 'encryption' | 'review'; id: string; text: string; fix: string }
|
||||||
|
/** project.declarations (`inspect --declarations --json`): store declarations from the config and local files. */
|
||||||
|
export interface DeclarationsResult {
|
||||||
|
profile: string;
|
||||||
|
stores: { apple: boolean; play: boolean };
|
||||||
|
dataSafety: null | {
|
||||||
|
collectsData: boolean; encryptedInTransit: boolean; deletionRequest: boolean; accountCreation: string[];
|
||||||
|
types: { id: string; category: string; shared: boolean; ephemeral: boolean; optional: boolean; collect: string[]; share: string[] }[];
|
||||||
|
/** Extra CSV rows of questions storebound does not model. */
|
||||||
|
extra: number;
|
||||||
|
/** The Play CSV the upload sends (it replaces the whole form). */
|
||||||
|
csv: string;
|
||||||
|
rows: number;
|
||||||
|
/** Play cannot read the form back: changes since the CSV storebound uploaded last (null: never uploaded from here). */
|
||||||
|
uploaded: { at: string; changes: { question: string; response: string; from: string; to: string }[] } | null;
|
||||||
|
};
|
||||||
|
/** App Store App Privacy (no API): the answers the Data safety answers suggest; the owner enters them in App Store Connect. */
|
||||||
|
appPrivacy: null | { items: { apple: string; category: string; from: string[]; purposes: string[]; thirdParty: boolean }[]; fromDataSafety: boolean };
|
||||||
|
appInfo: null | {
|
||||||
|
categories: { primary: string; primarySubOne?: string; primarySubTwo?: string; secondary?: string } | null;
|
||||||
|
/** Overrides of the age rating declaration (every other question: none / false). */
|
||||||
|
ageRating: { question: string; value: string }[];
|
||||||
|
contentRights: string | null;
|
||||||
|
free: boolean;
|
||||||
|
};
|
||||||
|
/** apple.usesNonExemptEncryption (null: not answered; storebound never guesses). */
|
||||||
|
encryption: boolean | null;
|
||||||
|
/** contact / demoAccount: masked ("d***@example.com"), null when missing; never the password. */
|
||||||
|
review: { signInRequired: boolean | null; accounts: boolean; contact: string | null; demoAccount: string | null; notes: string; notesBytes: number; notesMax: number };
|
||||||
|
ask: DeclAsk[];
|
||||||
|
}
|
||||||
|
/** project.listing_text: the listing files as they are (for export). */
|
||||||
|
export interface ListingText { play: { path: string; text: string } | null; apple: { path: string; text: string } | null }
|
||||||
|
/** project.render: one rendered image as a data: URL (null when missing or too big). */
|
||||||
|
export interface RenderImage { file: string; dataUrl: string | null; bytes: number }
|
||||||
|
/** project.renders (`shots gallery --json`): every render per variant, language and size, with the store check issues. */
|
||||||
|
export interface RenderIssue { level: 'error' | 'warn'; code: string; msg: string }
|
||||||
|
export interface RenderTile { src: string; kind: 'image' | 'video'; poster?: string; name: string; w: number; h: number; bytes: number; issues: RenderIssue[] }
|
||||||
|
export interface RendersResult {
|
||||||
|
title: string; generated: string;
|
||||||
|
/** The renders folder relative to the app folder. */
|
||||||
|
dir?: string;
|
||||||
|
variants: { id: string; label: string; langs: { lang: string; rows: { size: string; label: string; store: 'apple' | 'play'; tiles: RenderTile[]; issues: RenderIssue[] }[] }[] }[];
|
||||||
|
totals: { images: number; videos: number; errors: number; warnings: number };
|
||||||
|
}
|
||||||
|
/** apple.ppo_status (`apple ppo status --json`). */
|
||||||
|
export interface PpoTest { id: string; name: string; state: string; trafficProportion?: number; startDate?: string | null; endDate?: string | null; treatments: { id: string; name: string; locales: number }[] }
|
||||||
|
export interface PpoStatus { tests: PpoTest[] }
|
||||||
|
/** analytics.compare (`analytics compare --json`): daily series from the snapshots and the store changes from git. */
|
||||||
|
export interface AnalyticsTotals { impressions?: number; pageViews?: number; downloads?: number; conversion?: number | null; visitors?: number; acquisitions?: number; installs?: number }
|
||||||
|
export interface AnalyticsCompare {
|
||||||
|
snapshots: number; since: string;
|
||||||
|
series: {
|
||||||
|
apple: { date: string; impressions: number; uniqueImpressions: number; pageViews: number; uniquePageViews: number; downloads: number; firstTimeDownloads: number }[];
|
||||||
|
play: { date: string; visitors: number; acquisitions: number; installs: number }[];
|
||||||
|
};
|
||||||
|
effects: { event: { date: string; commit: string; subject: string; files: string[] }; store: 'apple' | 'play'; before: AnalyticsTotals; after: AnalyticsTotals; daysBefore: number; daysAfter: number }[];
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
||||||
import { extname, isAbsolute, join, resolve } from 'node:path';
|
import { extname, isAbsolute, join, resolve } from 'node:path';
|
||||||
import { type ShipConfig, playCodes } from './config';
|
import { type ShipConfig, playCodes } from './config';
|
||||||
import { APPLE_LIMITS, len, PLAY_LIMITS } from './copy';
|
import { APPLE_LIMITS, len, PLAY_LIMITS } from './copy';
|
||||||
import type { DraftsResult, IconResult, ListingField, ListingLocale, ListingsResult, ReplyDraft } from './desktop-protocol';
|
import type { DraftsResult, IconResult, ListingField, ListingLocale, ListingsResult, ListingText, RenderImage, ReplyDraft } from './desktop-protocol';
|
||||||
import { parseFrontMatter, stringifyFrontMatter } from './frontmatter';
|
import { parseFrontMatter, stringifyFrontMatter } from './frontmatter';
|
||||||
import { checkReply, parseDraft } from './reviews';
|
import { checkReply, parseDraft } from './reviews';
|
||||||
|
|
||||||
|
|
@ -148,6 +148,33 @@ export function listingCompleteness(config: ShipConfig, root: string): ListingsR
|
||||||
return { files: { play: playFile.path, apple: appleFile.path }, problems, locales };
|
return { files: { play: playFile.path, apple: appleFile.path }, problems, locales };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** The listing files as they are (the desktop export), or null where the config has no store / the file is missing. */
|
||||||
|
export function listingText(config: ShipConfig, root: string): ListingText {
|
||||||
|
const one = (rel: string): { path: string; text: string } | null => {
|
||||||
|
const p = resolve(root, rel);
|
||||||
|
try { return { path: p, text: readFileSync(p, 'utf8') }; } catch { return null; }
|
||||||
|
};
|
||||||
|
return { play: config.play ? one(config.play.listing ?? 'store/listing.md') : null, apple: config.apple ? one(config.apple.listing ?? 'store/appstore.md') : null };
|
||||||
|
}
|
||||||
|
|
||||||
|
export const RENDER_MAX_BYTES = 12_000_000;
|
||||||
|
/** A render path as the gallery data names it: relative, no "..", an image. */
|
||||||
|
export const RENDER_FILE_RE = /^(?!.*(^|\/)\.\.?(\/|$))(?!\/)[A-Za-z0-9._ @+()/-]{1,300}\.(png|jpe?g|webp)$/i;
|
||||||
|
|
||||||
|
/** One render (a path relative to the renders folder) as a data: URL for the desktop gallery; null when it is not
|
||||||
|
* an image inside the folder or is bigger than RENDER_MAX_BYTES. */
|
||||||
|
export function renderImage(rendersDir: string, file: string): RenderImage {
|
||||||
|
if (!RENDER_FILE_RE.test(file)) return { file, dataUrl: null, bytes: 0 };
|
||||||
|
const base = resolve(rendersDir), p = resolve(base, file);
|
||||||
|
if (!p.startsWith(base + '/') && !p.startsWith(base + '\\')) return { file, dataUrl: null, bytes: 0 };
|
||||||
|
try {
|
||||||
|
const st = statSync(p);
|
||||||
|
const mime = MIME[extname(p).toLowerCase()];
|
||||||
|
if (!st.isFile() || !mime || st.size > RENDER_MAX_BYTES) return { file, dataUrl: null, bytes: st.size };
|
||||||
|
return { file, dataUrl: `data:${mime};base64,${readFileSync(p).toString('base64')}`, bytes: st.size };
|
||||||
|
} catch { return { file, dataUrl: null, bytes: 0 }; }
|
||||||
|
}
|
||||||
|
|
||||||
/** Local reply drafts with their send checks. Unparsable files become problems. */
|
/** Local reply drafts with their send checks. Unparsable files become problems. */
|
||||||
export function readReplyDrafts(dir: string): DraftsResult {
|
export function readReplyDrafts(dir: string): DraftsResult {
|
||||||
const out: DraftsResult = { dir, drafts: [], problems: [] };
|
const out: DraftsResult = { dir, drafts: [], problems: [] };
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
// Play Data safety form through applications.dataSafety (CSV import; replaces every earlier answer).
|
// Play Data safety form through applications.dataSafety (CSV import; replaces every earlier answer).
|
||||||
// storebound play data-safety [--csv out.csv] [--dry]
|
// storebound play data-safety [--csv out.csv] [--dry]
|
||||||
// Answers come from `dataSafety` in storebound.config.ts. --dry only writes / prints the CSV.
|
// Answers come from `dataSafety` in storebound.config.ts. --dry only writes / prints the CSV.
|
||||||
import { writeFileSync } from 'node:fs';
|
import { mkdirSync, writeFileSync } from 'node:fs';
|
||||||
|
import { join } from 'node:path';
|
||||||
import type { Ctx } from '../lib/ctx';
|
import type { Ctx } from '../lib/ctx';
|
||||||
import { need } from '../lib/ctx';
|
import { need } from '../lib/ctx';
|
||||||
import { dataSafetyCsv } from '../lib/data-safety';
|
import { dataSafetyCsv } from '../lib/data-safety';
|
||||||
|
import { DATA_SAFETY_UPLOADED } from '../lib/declarations';
|
||||||
import { done, log } from '../lib/log';
|
import { done, log } from '../lib/log';
|
||||||
import { playClient } from './client';
|
import { playClient } from './client';
|
||||||
|
|
||||||
|
|
@ -18,5 +20,7 @@ export async function run(ctx: Ctx): Promise<void> {
|
||||||
if (ctx.args.has('dry')) { if (!out) process.stdout.write(csv); return; }
|
if (ctx.args.has('dry')) { if (!out) process.stdout.write(csv); return; }
|
||||||
const play = await playClient(root, need(config.play?.packageName, 'play.packageName'));
|
const play = await playClient(root, need(config.play?.packageName, 'play.packageName'));
|
||||||
await play.call('POST', `${play.API}/dataSafety`, { safetyLabels: csv });
|
await play.call('POST', `${play.API}/dataSafety`, { safetyLabels: csv });
|
||||||
|
// Play cannot read the form back: keep what went up, so the desktop app can show what changed since (gitignored).
|
||||||
|
try { mkdirSync(join(root, '.storebound'), { recursive: true }); writeFileSync(join(root, DATA_SAFETY_UPLOADED), csv); } catch { /* the upload itself worked */ }
|
||||||
done('play', `data safety updated (${csv.split('\n').length - 2} rows)`);
|
done('play', `data safety updated (${csv.split('\n').length - 2} rows)`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// In-app product prices for many products and regions from one CSV (both stores).
|
// In-app product prices for many products and regions from one CSV (both stores).
|
||||||
// storebound prices export [--out store/prices.csv] [--store apple|play] [--only ids] [--with-automatic] [--dry]
|
// storebound prices export [--out store/prices.csv] [--store apple|play] [--only ids] [--with-automatic] [--dry] [--json]
|
||||||
// storebound prices import [--csv store/prices.csv] [--store apple|play] [--only ids] [--reconvert] [--all] [--dry] [--yes]
|
// storebound prices import [--csv store/prices.csv] [--store apple|play] [--only ids] [--reconvert] [--all] [--dry] [--yes]
|
||||||
// CSV columns: product, store (apple | play | both), region (ISO alpha-2), currency, price, start_date (App Store
|
// CSV columns: product, store (apple | play | both), region (ISO alpha-2), currency, price, start_date (App Store
|
||||||
// only, a future YYYY-MM-DD = scheduled change), kind (manual | auto; auto rows are Apple's equalized prices, exported
|
// only, a future YYYY-MM-DD = scheduled change), kind (manual | auto; auto rows are Apple's equalized prices, exported
|
||||||
|
|
@ -68,23 +68,30 @@ export async function run(ctx: Ctx): Promise<void> {
|
||||||
|
|
||||||
// current state of every product on the chosen stores
|
// current state of every product on the chosen stores
|
||||||
const current: PriceRow[] = [];
|
const current: PriceRow[] = [];
|
||||||
|
const missing: { product: string; store: 'apple' | 'play' }[] = [];
|
||||||
const iaps = new Map<string, { id: string; base: string | null }>();
|
const iaps = new Map<string, { id: string; base: string | null }>();
|
||||||
const playProducts = new Map<string, PlayProduct>();
|
const playProducts = new Map<string, PlayProduct>();
|
||||||
for (const [i, p] of products.entries()) {
|
for (const [i, p] of products.entries()) {
|
||||||
log(TAG, `${step(i + 1, products.length, p.id)}: reading current prices`);
|
log(TAG, `${step(i + 1, products.length, p.id)}: reading current prices`);
|
||||||
if (c) {
|
if (c) {
|
||||||
const id = await iapId(c, appId, p.id);
|
const id = await iapId(c, appId, p.id);
|
||||||
if (!id) warn(TAG, `${p.id}: not on App Store Connect (storebound apple iap creates it)`);
|
if (!id) { warn(TAG, `${p.id}: not on App Store Connect (storebound apple iap creates it)`); missing.push({ product: p.id, store: 'apple' }); }
|
||||||
else { const cur = await appleCurrent(c, id, p.id, sub === 'export' && a.has('with-automatic')); current.push(...cur.rows); iaps.set(p.id, { id, base: cur.base }); }
|
else { const cur = await appleCurrent(c, id, p.id, sub === 'export' && a.has('with-automatic')); current.push(...cur.rows); iaps.set(p.id, { id, base: cur.base }); }
|
||||||
}
|
}
|
||||||
if (play) {
|
if (play) {
|
||||||
const pp = await playProduct(play, p.id);
|
const pp = await playProduct(play, p.id);
|
||||||
if (!pp) warn(TAG, `${p.id}: not on Google Play (storebound play products creates it)`);
|
if (!pp) { warn(TAG, `${p.id}: not on Google Play (storebound play products creates it)`); missing.push({ product: p.id, store: 'play' }); }
|
||||||
else { current.push(...playPriceRows(pp)); playProducts.set(p.id, pp); }
|
else { current.push(...playPriceRows(pp)); playProducts.set(p.id, pp); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sub === 'export') {
|
if (sub === 'export') {
|
||||||
|
// --json: the current prices as data (the desktop price view); read-only, never writes the CSV
|
||||||
|
if (a.has('json')) {
|
||||||
|
printJson({ csv: csvPath, products: products.map(p => p.id), stores: [...(useApple ? ['apple'] : []), ...(usePlay ? ['play'] : [])], missing,
|
||||||
|
rows: current.map(({ pointId: _p, ...r }) => r) });
|
||||||
|
return;
|
||||||
|
}
|
||||||
const csv = pricesCsv(current);
|
const csv = pricesCsv(current);
|
||||||
if (dry) { console.log(csv); done(TAG, `dry run: would write ${current.length} rows to ${csvPath}`); return; }
|
if (dry) { console.log(csv); done(TAG, `dry run: would write ${current.length} rows to ${csvPath}`); return; }
|
||||||
writeFileSync(csvPath, csv);
|
writeFileSync(csvPath, csv);
|
||||||
|
|
|
||||||
50
cli/serve.ts
50
cli/serve.ts
|
|
@ -20,6 +20,7 @@ import {
|
||||||
DESKTOP_PROTOCOL, ERR, type AppStatus, type MethodDescriptor, type PortfolioResult, type ProjectSummary, type ToolResult, type VirtualProject,
|
DESKTOP_PROTOCOL, ERR, type AppStatus, type MethodDescriptor, type PortfolioResult, type ProjectSummary, type ToolResult, type VirtualProject,
|
||||||
} from './lib/desktop-protocol';
|
} from './lib/desktop-protocol';
|
||||||
import { appIdentity, appleProductIds, appleReleases, catalogParity, playProductIds, playReleases, releaseTrains } from './lib/portfolio';
|
import { appIdentity, appleProductIds, appleReleases, catalogParity, playProductIds, playReleases, releaseTrains } from './lib/portfolio';
|
||||||
|
import { RENDER_FILE_RE } from './lib/project-files';
|
||||||
import { detectTools } from './lib/tools';
|
import { detectTools } from './lib/tools';
|
||||||
import { compiled, pickCallEnv, runCommand, type RunOptions, type Running } from './lib/runner';
|
import { compiled, pickCallEnv, runCommand, type RunOptions, type Running } from './lib/runner';
|
||||||
import { inputSchema, type ToolDef, TOOLS, toArgv, validateInput } from './mcp-tools';
|
import { inputSchema, type ToolDef, TOOLS, toArgv, validateInput } from './mcp-tools';
|
||||||
|
|
@ -32,16 +33,21 @@ export type Runner = (argv: string[], o: RunOptions) => Running;
|
||||||
|
|
||||||
const MAX_OUTPUT = 60_000;
|
const MAX_OUTPUT = 60_000;
|
||||||
|
|
||||||
/** MCP tools the desktop profile leaves out (sending builds to testers on Play, release state changes; the fastlane import
|
const opt = (flag: string, v: unknown): string[] => (v === undefined || v === null || v === '' ? [] : [`--${flag}`, String(v)]);
|
||||||
* needs a folder without a config, which the desktop first-run guide does not offer yet). */
|
const lang = { type: 'string', pattern: '^[A-Za-z0-9_-]{1,20}(,[A-Za-z0-9_-]{1,20}){0,99}$', description: 'Comma-separated language ids from the config (default: all)' };
|
||||||
export const DESKTOP_EXCLUDED = new Set(['play_release_testing', 'apple_phased_release', 'import_fastlane']);
|
/** A price sheet: any .csv file path the owner picked (read only), never an option. */
|
||||||
|
export const PRICE_SHEET_RE = /^(?!-)[^\x00-\x1f]{1,1000}\.[cC][sS][vV]$/;
|
||||||
|
|
||||||
|
/** MCP tools the desktop profile leaves out (sending builds to testers on Play, release state changes: the window has
|
||||||
|
* the owner actions for those). */
|
||||||
|
export const DESKTOP_EXCLUDED = new Set(['play_release_testing', 'apple_phased_release']);
|
||||||
/** Words no desktop method name may contain. */
|
/** Words no desktop method name may contain. */
|
||||||
export const FORBIDDEN_METHOD_WORDS = /submit|release|publish|rollout|resume|complete|send|start|stop|cancel|delete|remove|invite/i;
|
export const FORBIDDEN_METHOD_WORDS = /submit|release|publish|rollout|resume|complete|send|start|stop|cancel|delete|remove|invite/i;
|
||||||
|
|
||||||
/** Read tools whose command prints a structured result with --json. */
|
/** Read tools whose command prints a structured result with --json. */
|
||||||
export const JSON_TOOLS = new Set(['check', 'check_aso', 'validate', 'health', 'reviews_list', 'prices_diff', 'analytics_compare', 'apple_status',
|
export const JSON_TOOLS = new Set(['check', 'check_aso', 'validate', 'health', 'reviews_list', 'prices_diff', 'analytics_compare', 'apple_status',
|
||||||
'apple_next_build', 'play_status', 'play_next_version_code', 'shots_check', 'apple_testflight_status', 'apple_ppo_status', 'catalog_diff',
|
'apple_next_build', 'play_status', 'play_next_version_code', 'shots_check', 'apple_testflight_status', 'apple_ppo_status', 'catalog_diff',
|
||||||
'project_icon', 'project_listings', 'reviews_drafts']);
|
'project_icon', 'project_listings', 'reviews_drafts', 'project_declarations', 'project_listing_text', 'project_renders', 'project_render', 'prices_current']);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Methods only the desktop profile has (not MCP tools): offline reads of the project's own files, and two local
|
* Methods only the desktop profile has (not MCP tools): offline reads of the project's own files, and two local
|
||||||
|
|
@ -67,6 +73,21 @@ export const DESKTOP_ONLY: ToolDef[] = [
|
||||||
{ name: 'project_init', title: 'Start an app folder', command: ['init'], write: true, network: false, idempotent: true,
|
{ name: 'project_init', title: 'Start an app folder', command: ['init'], write: true, network: false, idempotent: true,
|
||||||
description: 'Copies the storebound templates (config, listing, screenshot copy, declarations, privacy policy) for a profile into an empty app folder; existing files are kept.',
|
description: 'Copies the storebound templates (config, listing, screenshot copy, declarations, privacy policy) for a profile into an empty app folder; existing files are kept.',
|
||||||
props: { profile: { type: 'string', enum: ['app', 'game', 'subscription-app'], default: 'app' } }, args: i => ['--profile', String(i.profile ?? 'app')] },
|
props: { profile: { type: 'string', enum: ['app', 'game', 'subscription-app'], default: 'app' } }, args: i => ['--profile', String(i.profile ?? 'app')] },
|
||||||
|
{ name: 'project_declarations', title: 'Store declarations', command: ['inspect', '--declarations'], write: false, network: false,
|
||||||
|
description: 'Play Data safety answers (and the changes since the last upload: Play cannot read the form back), the App Privacy answers they suggest (App Privacy has no API), App Store categories, age rating, content rights, export compliance and App Review details (contact and demo account masked) from the config, with every question only the owner can answer.' },
|
||||||
|
{ name: 'project_listing_text', title: 'Listing files', command: ['inspect', '--listing-text'], write: false, network: false,
|
||||||
|
description: 'The Play and App Store listing files (store/listing.md, store/appstore.md) as they are, for an export.' },
|
||||||
|
{ name: 'project_renders', title: 'Store art', command: ['shots', 'gallery'], write: false, network: false,
|
||||||
|
description: 'Every rendered screenshot and app preview per variant, language and size with the store check issues (the data of the review gallery; nothing is written).',
|
||||||
|
props: { lang }, args: i => opt('lang', i.lang) },
|
||||||
|
{ name: 'project_render', title: 'One render', command: ['inspect'], write: false, network: false,
|
||||||
|
description: 'One rendered image of the renders folder as a data: URL (at most 12 MB), for the desktop gallery.',
|
||||||
|
props: { file: { type: 'string', pattern: RENDER_FILE_RE.source, description: 'Path relative to the renders folder, as project.renders names it' } },
|
||||||
|
required: ['file'], args: i => ['--render', String(i.file)] },
|
||||||
|
{ name: 'prices_current', title: 'Current prices', command: ['prices', 'export'], write: false, network: true,
|
||||||
|
description: 'Read-only: the current price of every product on both stores per region (Apple manual prices, with with_automatic also the equalized ones). Writes nothing.',
|
||||||
|
props: { store: { type: 'string', enum: ['apple', 'play'] }, with_automatic: { type: 'boolean', default: false } },
|
||||||
|
args: i => [...opt('store', i.store), ...(i.with_automatic === true ? ['--with-automatic'] : [])] },
|
||||||
];
|
];
|
||||||
/**
|
/**
|
||||||
* Owner actions (desktop only, kind "owner"): changes the owner decides because users see them at once. Each is a dry
|
* Owner actions (desktop only, kind "owner"): changes the owner decides because users see them at once. Each is a dry
|
||||||
|
|
@ -95,12 +116,24 @@ export const OWNER_TOOLS: ToolDef[] = [
|
||||||
description: 'Adds the testers of the project\'s testers CSV (.storebound/testers.csv, gitignored) to their TestFlight groups; Apple emails them an invitation once the group has a build. Emails stay masked in every line. Removing testers stays a terminal command.',
|
description: 'Adds the testers of the project\'s testers CSV (.storebound/testers.csv, gitignored) to their TestFlight groups; Apple emails them an invitation once the group has a build. Emails stay masked in every line. Removing testers stays a terminal command.',
|
||||||
props: { groups: { type: 'string', pattern: '^[^,;]{1,60}(,[^,;]{1,60}){0,19}$', description: 'Comma-separated group names (default: every group in the CSV)' } },
|
props: { groups: { type: 'string', pattern: '^[^,;]{1,60}(,[^,;]{1,60}){0,19}$', description: 'Comma-separated group names (default: every group in the CSV)' } },
|
||||||
args: i => (i.groups ? ['--group', String(i.groups)] : []) },
|
args: i => (i.groups ? ['--group', String(i.groups)] : []) },
|
||||||
|
{ name: 'owner_prices_import', title: 'Apply the price sheet', command: ['prices', 'import'], write: true, network: true,
|
||||||
|
description: 'Writes the prices of the price sheet (CSV) that differ from the stores: App Store price schedules and Google Play regional prices. Users see them as soon as the stores apply them; an App Store price increase cannot be undone once it starts.',
|
||||||
|
props: { csv: { type: 'string', pattern: PRICE_SHEET_RE.source, description: 'The price sheet: a .csv path (default: prices.csv of the config, else store/prices.csv)' }, store: { type: 'string', enum: ['apple', 'play'] },
|
||||||
|
only: { type: 'string', pattern: '^[A-Za-z0-9._]{1,100}(,[A-Za-z0-9._]{1,100}){0,49}$', description: 'Comma-separated product ids' } },
|
||||||
|
args: i => [...opt('csv', i.csv), ...opt('store', i.store), ...opt('only', i.only)] },
|
||||||
|
{ name: 'owner_ppo_start', title: 'Start the Product Page Optimization test', command: ['apple', 'ppo', 'start'], write: true, network: true,
|
||||||
|
description: 'Starts an App Store Product Page Optimization test: the share of App Store visitors it names sees a treatment (treatments not yet approved go to App Review with the next version first).',
|
||||||
|
props: { experiment: { type: 'string', pattern: '^[^\\x00-\\x1f]{1,64}$', description: 'Test name (default: the one editable test)' } }, args: i => opt('experiment', i.experiment) },
|
||||||
|
{ name: 'owner_ppo_stop', title: 'Stop the Product Page Optimization test', command: ['apple', 'ppo', 'stop'], write: true, network: true,
|
||||||
|
description: 'Stops a running App Store Product Page Optimization test. A stopped test cannot be restarted; the results stay in App Store Connect.',
|
||||||
|
props: { experiment: { type: 'string', pattern: '^[^\\x00-\\x1f]{1,64}$', description: 'Test name (default: the running test)' } }, args: i => opt('experiment', i.experiment) },
|
||||||
];
|
];
|
||||||
/** Flags no owner action may ever produce. */
|
/** Flags no owner action may ever produce (`--csv` only for the price sheet of owner.prices_import). */
|
||||||
export const OWNER_FORBIDDEN_ARGS = ['--yes', '--manual-release', '--cancel-submission', '--submit-review', '--remove', '--invite', '--production', '--csv', 'submit', 'publish', 'distribute'];
|
export const OWNER_FORBIDDEN_ARGS = ['--yes', '--manual-release', '--cancel-submission', '--submit-review', '--remove', '--invite', '--production', '--csv', 'submit', 'publish', 'distribute'];
|
||||||
|
const OWNER_ALLOWED_ARGS: Record<string, string[]> = { owner_prices_import: ['--csv'] };
|
||||||
|
|
||||||
/** Desktop-only methods whose `project` is a folder without a config yet. */
|
/** Desktop-only methods whose `project` is a folder without a config yet (the host picks it in a native dialog). */
|
||||||
const NEW_PROJECT = new Set(['project_init']);
|
export const NEW_PROJECT = new Set(['project_init', 'import_fastlane']);
|
||||||
|
|
||||||
/** `apple_testflight_status` -> `apple.testflight_status`: first underscore becomes the namespace dot. */
|
/** `apple_testflight_status` -> `apple.testflight_status`: first underscore becomes the namespace dot. */
|
||||||
export const methodName = (tool: string): string => tool.replace('_', '.');
|
export const methodName = (tool: string): string => tool.replace('_', '.');
|
||||||
|
|
@ -334,7 +367,8 @@ export class Session {
|
||||||
const json = !t.write && JSON_TOOLS.has(t.name);
|
const json = !t.write && JSON_TOOLS.has(t.name);
|
||||||
const argv = json ? [...built.argv, '--json'] : built.argv;
|
const argv = json ? [...built.argv, '--json'] : built.argv;
|
||||||
if (OWNER.has(t.name)) {
|
if (OWNER.has(t.name)) {
|
||||||
if (argv.some(a => OWNER_FORBIDDEN_ARGS.includes(a))) throw new RpcError(ERR.invalidParams, `${method}: not an owner action from here`);
|
const allowed = OWNER_ALLOWED_ARGS[t.name] ?? [];
|
||||||
|
if (argv.some(a => OWNER_FORBIDDEN_ARGS.includes(a) && !allowed.includes(a))) throw new RpcError(ERR.invalidParams, `${method}: not an owner action from here`);
|
||||||
// the verified token is the owner's answer to the command's own question; nothing else can set it
|
// the verified token is the owner's answer to the command's own question; nothing else can set it
|
||||||
if (!dryRun) env.STOREBOUND_OWNER_CONFIRMED = '1';
|
if (!dryRun) env.STOREBOUND_OWNER_CONFIRMED = '1';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
import { existsSync, writeFileSync } from 'node:fs';
|
import { existsSync, writeFileSync } from 'node:fs';
|
||||||
import { join, relative } from 'node:path';
|
import { join, relative } from 'node:path';
|
||||||
import type { Ctx } from '../lib/ctx';
|
import type { Ctx } from '../lib/ctx';
|
||||||
import { done, log, warn } from '../lib/log';
|
import { done, log, printJson, warn } from '../lib/log';
|
||||||
import { SIZES } from './lib';
|
import { SIZES } from './lib';
|
||||||
import { allIssues, requiredSets, type RendersScan, scanRenders } from './report';
|
import { allIssues, requiredSets, type RendersScan, scanRenders } from './report';
|
||||||
import { type Issue, IMAGE_SPECS, VIDEO_TARGETS } from './spec';
|
import { type Issue, IMAGE_SPECS, VIDEO_TARGETS } from './spec';
|
||||||
|
|
@ -244,7 +244,8 @@ export async function run(ctx: Ctx): Promise<void> {
|
||||||
const scan = scanRenders(dir, { langs, variants, required: lang => requiredSets(config, lang) });
|
const scan = scanRenders(dir, { langs, variants, required: lang => requiredSets(config, lang) });
|
||||||
if (!scan.images.length && !scan.videos.length) warn('shots', `no renders in ${dir} (storebound shots render)`);
|
if (!scan.images.length && !scan.videos.length) warn('shots', `no renders in ${dir} (storebound shots render)`);
|
||||||
const data = galleryData(scan, { at: join(out, '..'), title: `${config.app.name} · store renders`, exists: existsSync });
|
const data = galleryData(scan, { at: join(out, '..'), title: `${config.app.name} · store renders`, exists: existsSync });
|
||||||
if (a.has('json')) { console.log(JSON.stringify(data, null, 2)); return; }
|
// --json: the data only (the desktop gallery), with the renders folder relative to the app folder; writes nothing
|
||||||
|
if (a.has('json')) { printJson({ ...data, dir: relative(ctx.loaded.root, dir).split('\\').join('/') || '.' }); return; }
|
||||||
if (a.has('dry')) { log('shots', `would write ${out}: ${data.totals.images} images, ${data.totals.videos} videos, ${data.totals.errors} errors`); return; }
|
if (a.has('dry')) { log('shots', `would write ${out}: ${data.totals.images} images, ${data.totals.videos} videos, ${data.totals.errors} errors`); return; }
|
||||||
writeFileSync(out, galleryHtml(data));
|
writeFileSync(out, galleryHtml(data));
|
||||||
log('shots', `${data.totals.images} images, ${data.totals.videos} videos, ${data.variants.length} variant tab(s): ${data.totals.errors} errors, ${data.totals.warnings} warnings`);
|
log('shots', `${data.totals.images} images, ${data.totals.videos} videos, ${data.variants.length} variant tab(s): ${data.totals.errors} errors, ${data.totals.warnings} warnings`);
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ development; this page is for contributors.
|
||||||
(`storebound serve --stdio`, compiled with `bun tools/build-sidecars.ts`) and asks it for everything.
|
(`storebound serve --stdio`, compiled with `bun tools/build-sidecars.ts`) and asks it for everything.
|
||||||
- **App-centric.** One app = one product with up to two platforms (iOS bundle id / App Store Connect app id, Android
|
- **App-centric.** One app = one product with up to two platforms (iOS bundle id / App Store Connect app id, Android
|
||||||
package name), one `storebound.config.ts` per app folder, many apps per workspace. Navigation: Portfolio -> App
|
package name), one `storebound.config.ts` per app folder, many apps per workspace. Navigation: Portfolio -> App
|
||||||
(Releases, Catalog, Listings, Health, Reviews, TestFlight) plus the workspace screens (App folders, Accounts,
|
(Releases, Catalog, Prices, Listings, Store art, Health, Reviews, TestFlight, Growth, App info, Checks) plus the
|
||||||
Dependencies, Settings).
|
workspace screens (App folders, Accounts, Dependencies, Settings).
|
||||||
- **Release trains.** A version (for example 2.3.0) spans both stores: iOS build and Android versionCode, per-store
|
- **Release trains.** A version (for example 2.3.0) spans both stores: iOS build and Android versionCode, per-store
|
||||||
state (TestFlight, review, live, phased release, rollout fraction). `portfolio.status` returns per app the current
|
state (TestFlight, review, live, phased release, rollout fraction). `portfolio.status` returns per app the current
|
||||||
train (highest version live on a store) and the next one (highest version above it anywhere).
|
train (highest version live on a store) and the next one (highest version above it anywhere).
|
||||||
|
|
@ -114,8 +114,8 @@ host state file (`overrides_set`, every key checked in `workspace.rs`).
|
||||||
- The host checks the target and the account kinds, and passes `virtual: { name, apple, play }`. The sidecar writes
|
- The host checks the target and the account kinds, and passes `virtual: { name, apple, play }`. The sidecar writes
|
||||||
a minimal `storebound.config.json` (store ids, placeholder links) into its temp folder.
|
a minimal `storebound.config.json` (store ids, placeholder links) into its temp folder.
|
||||||
- Only `apple.status`, `play.status`, `health`, `reviews.list`, `apple.testflight_status` and `apple.ppo_status` work
|
- Only `apple.status`, `play.status`, `health`, `reviews.list`, `apple.testflight_status` and `apple.ppo_status` work
|
||||||
this way, and `portfolio.status` takes store-only entries.
|
this way (tabs Releases, Health, Reviews, TestFlight, Growth), and `portfolio.status` takes store-only entries.
|
||||||
- "Link a folder" or "Start an app folder here" turn it into a full app.
|
- "Link a folder", "Start an app folder here" or "Import from fastlane" turn it into a full app.
|
||||||
|
|
||||||
### Settings
|
### Settings
|
||||||
|
|
||||||
|
|
@ -138,12 +138,62 @@ Each write is a dry run, then the native dialog, then the real run, with one pro
|
||||||
|
|
||||||
- **Listings tab:** Play listing text, App Store version and text, Play graphics, App Store screenshots and
|
- **Listings tab:** Play listing text, App Store version and text, Play graphics, App Store screenshots and
|
||||||
previews; local render jobs (screenshots, previews, icons, gallery).
|
previews; local render jobs (screenshots, previews, icons, gallery).
|
||||||
- **Catalog tab:** Play products and subscriptions, App Store IAPs and subscriptions, price export. Price import
|
- **Catalog tab:** Play products and subscriptions, App Store IAPs and subscriptions, price export.
|
||||||
stays a terminal step.
|
- **Prices tab:** the price sheet compared with the stores and applied (`owner.prices_import`, an owner action).
|
||||||
|
- **App info tab:** Play Data safety upload, App Store app info, export compliance, App Review details.
|
||||||
|
- **Growth tab:** analytics snapshot and report request, PPO create and treatment upload; PPO start / stop
|
||||||
|
(`owner.ppo_start`, `owner.ppo_stop`, owner actions).
|
||||||
|
- **Store art tab:** render, review page.
|
||||||
- **Releases tab:** rollout and phased release owner actions.
|
- **Releases tab:** rollout and phased release owner actions.
|
||||||
- **TestFlight tab:** What to Test, internal groups, testers.
|
- **TestFlight tab:** What to Test, internal groups, testers.
|
||||||
- **Reviews tab:** reply editor (`reviews.reply`), approve, send (owner action).
|
- **Reviews tab:** reply editor (`reviews.reply`), approve, send (owner action).
|
||||||
|
|
||||||
|
## Every CLI area in the window
|
||||||
|
|
||||||
|
| CLI | where in the window |
|
||||||
|
|---|---|
|
||||||
|
| `prices export --json` (new, read-only) | Prices: product x territory matrix (both stores, Apple manual / equalized), per-territory table with gaps |
|
||||||
|
| `prices export` | Prices: "Write store/prices.csv" (confirm flow); "Export prices CSV" saves the same sheet anywhere |
|
||||||
|
| `prices import --dry --json` / `prices import` | Prices: compare store/prices.csv or a picked CSV (`price_sheet_pick`), diff table, Apply = `owner.prices_import` |
|
||||||
|
| `inspect --declarations --json` (new) | App info: Data safety, App Privacy suggestions, app info, encryption, review details, "ask the owner" items |
|
||||||
|
| `play data-safety` | App info: Upload (keeps `.storebound/data-safety.uploaded.csv`, so the tab shows changes since; Play cannot read the form back) |
|
||||||
|
| `apple appinfo`, `apple encryption`, `apple review-details` | App info: Push buttons (confirm flow) |
|
||||||
|
| `apple ppo status / create / upload / start / stop` | Growth: tests table, create, upload, Start / Stop owner actions |
|
||||||
|
| Play store listing experiments | no API: Growth links Play Console and the variant renders |
|
||||||
|
| `analytics compare --json`, `snapshot`, `setup` | Growth: chart (reach, installs, conversion, listing changes as markers), before / after table, snapshot and setup buttons |
|
||||||
|
| `shots gallery --json`, `inspect --render` (new) | Store art: grid per variant / language / size, issues, lightbox; images load lazily one at a time as data: URLs (never cached) |
|
||||||
|
| `shots render`, `shots gallery` | Store art: Render (language, variant), Write review page, Open review page / folder (`project_reveal`) |
|
||||||
|
| `inspect --listing-text --json` (new) | Listings export (Markdown) |
|
||||||
|
| `import fastlane` | First-run guide, App folders, store-only app banner (`project_import_fastlane`: plan in a native dialog first) |
|
||||||
|
|
||||||
|
**Exports.** Every screen registers what it can save (`src/ui/Exports.tsx`): the "Export" menu at the top right of
|
||||||
|
the top bar and the "Export" group of the command palette. Files: prices CSV (the `prices import` format), listings
|
||||||
|
(md), reviews CSV, health report (md), catalog parity (md), store readiness report (md), store declarations (md),
|
||||||
|
Data safety CSV, analytics CSV, portfolio CSV. `export_save` writes only through a native save dialog (Downloads
|
||||||
|
first), only csv / md / json / txt, sanitized names, at most 16 MB; the reviews export shows a native personal-data
|
||||||
|
note first.
|
||||||
|
|
||||||
|
## UX audit (full CLI coverage)
|
||||||
|
|
||||||
|
- **Two clicks.** From an app page every action is one tab plus one button: prices, Data safety, app info, review
|
||||||
|
details, PPO, analytics, renders. The command palette jumps to Prices and Store art and runs every export.
|
||||||
|
- **One place for exports.** Before, the only export was a write button in Catalog. Now each screen's exports sit in
|
||||||
|
one menu at the top right (the same spot on every screen) and in the palette; disabled items say why.
|
||||||
|
- **Buttons.** Card head actions go from secondary (ghost: open, show) to the primary action at the right end; owner
|
||||||
|
actions are named on the button and in their native dialog. App folders: Import from fastlane, Start an app folder,
|
||||||
|
Add app folder (primary) in the page header, the same three in the empty state; each folder row has Open and Show.
|
||||||
|
- **Empty states say what to do.** Prices not read (Read prices), no products (where to add them), no snapshots (what
|
||||||
|
a snapshot is, the bucket for Play), no PPO tests (create from a variant, or add variants), no renders (Render), no
|
||||||
|
Data safety answers (which skill), store-only app (Link a folder / Start / Import).
|
||||||
|
- **Errors say how to fix.** `fixHint` (src/lib/views.ts) maps known CLI errors (keys, permissions, config values,
|
||||||
|
ffmpeg, Chrome, renders, snapshots, bucket, editable version, fastlane folder, price sheet, price points, network,
|
||||||
|
history) to the step that fixes them, shown under read errors and in failure toasts.
|
||||||
|
- **Ask, never guess.** App info opens with the questions only the owner can answer (age rating, App Privacy linked /
|
||||||
|
tracking, encryption, sign-in, contact), highlighted in amber, each with how to answer.
|
||||||
|
- **First run.** The guide now starts with the studio (pick or create, with a colour), so the keys added two steps
|
||||||
|
later land in it; the app step offers add / start / import from fastlane side by side.
|
||||||
|
- **Tabs.** Eleven app tabs fit 1440 px; narrower windows scroll the tab bar sideways instead of wrapping.
|
||||||
|
|
||||||
R&D on a fastlane importer and a RevenueCat adapter: `docs/research/fastlane-revenuecat.md`.
|
R&D on a fastlane importer and a RevenueCat adapter: `docs/research/fastlane-revenuecat.md`.
|
||||||
|
|
||||||
## Dependencies screen
|
## Dependencies screen
|
||||||
|
|
|
||||||
62
tests/desktop-complete.test.ts
Normal file
62
tests/desktop-complete.test.ts
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
// Desktop full CLI coverage, CLI side: store declarations as data (ask the owner, never guess), Data safety changes
|
||||||
|
// since the last upload, renders as data: URLs only from inside the renders folder.
|
||||||
|
import { describe, expect, test } from 'bun:test';
|
||||||
|
import { mkdirSync, mkdtempSync, writeFileSync } from 'node:fs';
|
||||||
|
import { tmpdir } from 'node:os';
|
||||||
|
import { join } from 'node:path';
|
||||||
|
import type { ShipConfig } from '../cli/lib/config';
|
||||||
|
import { dataSafetyCsv } from '../cli/lib/data-safety';
|
||||||
|
import { applePurpose, dataSafetyChanges, declarations } from '../cli/lib/declarations';
|
||||||
|
import { RENDER_FILE_RE, renderImage } from '../cli/lib/project-files';
|
||||||
|
|
||||||
|
const base = (o: Partial<ShipConfig> = {}): ShipConfig => ({
|
||||||
|
app: { name: 'Demo', privacyPolicyUrl: 'https://example.com/p', supportUrl: 'https://example.com/s', website: 'https://example.com', contactEmail: 'a@example.com', profile: 'app' },
|
||||||
|
languages: [{ id: 'en', play: 'en-US', apple: 'en-US' }], play: { packageName: 'com.example.demo' }, apple: { bundleId: 'com.example.demo' }, ...o,
|
||||||
|
} as ShipConfig);
|
||||||
|
const none = { demoUser: null, contactEmail: null, uploaded: null };
|
||||||
|
|
||||||
|
describe('declarations', () => {
|
||||||
|
test('an empty config asks the owner everything it cannot prove', () => {
|
||||||
|
const d = declarations(base(), none);
|
||||||
|
expect(d.ask.map(a => a.id).sort()).toEqual(['ai-age', 'ai-categories', 'ai-rights', 'ap-unknown', 'ds-missing', 'enc-unset', 'rv-contact', 'rv-signin']);
|
||||||
|
expect(d.encryption).toBeNull();
|
||||||
|
expect(d.dataSafety).toBeNull();
|
||||||
|
});
|
||||||
|
test('Data safety answers become App Privacy suggestions; linked / tracking stay questions', () => {
|
||||||
|
const cfg = base({
|
||||||
|
dataSafety: { collectsData: true, encryptedInTransit: true, deletionRequest: true, data: {
|
||||||
|
PSL_DEVICE_ID: { shared: true, collect: ['analytics'], share: ['advertising'] }, PSL_CRASH_LOGS: { shared: false, collect: ['analytics'] } } },
|
||||||
|
apple: { bundleId: 'com.example.demo', usesNonExemptEncryption: false, info: { categories: { primary: 'UTILITIES' }, ageRating: {}, contentRights: 'DOES_NOT_USE_THIRD_PARTY_CONTENT' } },
|
||||||
|
reviewAccess: { signInRequired: false },
|
||||||
|
});
|
||||||
|
const d = declarations(cfg, { ...none, contactEmail: 'a***@example.com' });
|
||||||
|
expect(d.appPrivacy!.items.find(x => x.apple === 'Device ID')).toEqual({ apple: 'Device ID', category: 'Identifiers', from: ['PSL_DEVICE_ID'], purposes: ['Analytics', 'Third-Party Advertising'], thirdParty: true });
|
||||||
|
expect(d.ask.map(a => a.id)).toEqual(['ap-linked']);
|
||||||
|
expect(d.encryption).toBe(false);
|
||||||
|
expect(d.review.contact).toBe('a***@example.com');
|
||||||
|
expect(applePurpose('advertising', false)).toBe('Developer\'s Advertising or Marketing');
|
||||||
|
});
|
||||||
|
test('changes since the last upload compare answers, not labels', () => {
|
||||||
|
const ds = { collectsData: true, encryptedInTransit: true, deletionRequest: false, data: { PSL_CRASH_LOGS: { shared: false, collect: ['analytics' as const] } } };
|
||||||
|
const before = dataSafetyCsv(ds);
|
||||||
|
expect(dataSafetyChanges(before, before)).toEqual([]);
|
||||||
|
const after = dataSafetyCsv({ ...ds, deletionRequest: true });
|
||||||
|
expect(dataSafetyChanges(before, after)).toEqual([{ question: 'PSL_DATA_COLLECTION_USER_REQUEST_DELETE', response: '', from: 'FALSE', to: 'TRUE' }]);
|
||||||
|
const d = declarations(base({ dataSafety: { ...ds, deletionRequest: true } }), { ...none, uploaded: { csv: before, at: '2026-10-01T00:00:00Z' } });
|
||||||
|
expect(d.dataSafety!.uploaded!.changes.length).toBe(1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('renders as data: URLs', () => {
|
||||||
|
test('only image paths inside the renders folder', () => {
|
||||||
|
const dir = mkdtempSync(join(tmpdir(), 'sb-renders-'));
|
||||||
|
mkdirSync(join(dir, 'en', 'ios69'), { recursive: true });
|
||||||
|
writeFileSync(join(dir, 'en', 'ios69', '01.png'), Buffer.from([0x89, 0x50, 0x4e, 0x47]));
|
||||||
|
writeFileSync(join(dir, 'secret.txt'), 'x');
|
||||||
|
expect(renderImage(dir, 'en/ios69/01.png').dataUrl).toStartWith('data:image/png;base64,');
|
||||||
|
for (const bad of ['../x.png', 'en/../../x.png', '/etc/x.png', 'secret.txt', 'en/./01.png', '-x.png']) {
|
||||||
|
if (bad !== '-x.png') expect(RENDER_FILE_RE.test(bad), bad).toBe(false);
|
||||||
|
expect(renderImage(dir, bad).dataUrl, bad).toBeNull();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -40,6 +40,11 @@ const D3_WRITES: [string, J][] = [
|
||||||
['shots.render', {}], ['shots.video', {}], ['shots.gallery', {}], ['icons', {}],
|
['shots.render', {}], ['shots.video', {}], ['shots.gallery', {}], ['icons', {}],
|
||||||
['owner.play_rollout', { action: 'percent', percent: 50 }], ['owner.play_rollout', { action: 'halt' }], ['owner.ios_phased', { action: 'pause', version: '2.3.0' }],
|
['owner.play_rollout', { action: 'percent', percent: 50 }], ['owner.play_rollout', { action: 'halt' }], ['owner.ios_phased', { action: 'pause', version: '2.3.0' }],
|
||||||
['owner.ios_phased', { action: 'resume' }], ['owner.reply_send', { file: 'play-r-p1.md' }], ['owner.testflight_testers', { groups: 'Friends and family' }],
|
['owner.ios_phased', { action: 'resume' }], ['owner.reply_send', { file: 'play-r-p1.md' }], ['owner.testflight_testers', { groups: 'Friends and family' }],
|
||||||
|
// full CLI coverage: price sheet, Data safety, app info, PPO, analytics
|
||||||
|
['owner.prices_import', {}], ['owner.prices_import', { csv: '/tmp/sheets/prices autumn.csv', store: 'play' }], ['prices.export', {}],
|
||||||
|
['play.data_safety', {}], ['apple.appinfo', {}], ['apple.review_details', {}], ['apple.encryption', {}],
|
||||||
|
['apple.ppo_create', { variants: 'b', traffic: 30 }], ['apple.ppo_upload', { variant: 'b', experiment: 'storebound b' }],
|
||||||
|
['owner.ppo_start', { experiment: 'storebound b' }], ['owner.ppo_stop', {}], ['analytics.snapshot', {}], ['analytics.setup', {}],
|
||||||
];
|
];
|
||||||
|
|
||||||
describe('D3 writes: token binding for every method the window offers', () => {
|
describe('D3 writes: token binding for every method the window offers', () => {
|
||||||
|
|
@ -82,7 +87,7 @@ describe('D3 writes: token binding for every method the window offers', () => {
|
||||||
|
|
||||||
describe('owner actions', () => {
|
describe('owner actions', () => {
|
||||||
test('exactly these, desktop only, kind owner, never a submit / release request / cancel / external TestFlight flag', () => {
|
test('exactly these, desktop only, kind owner, never a submit / release request / cancel / external TestFlight flag', () => {
|
||||||
expect(OWNER_TOOLS.map(t => methodName(t.name)).sort()).toEqual(['owner.ios_phased', 'owner.play_rollout', 'owner.reply_send', 'owner.testflight_testers']);
|
expect(OWNER_TOOLS.map(t => methodName(t.name)).sort()).toEqual(['owner.ios_phased', 'owner.play_rollout', 'owner.ppo_start', 'owner.ppo_stop', 'owner.prices_import', 'owner.reply_send', 'owner.testflight_testers']);
|
||||||
for (const t of OWNER_TOOLS) expect(TOOLS.some(x => x.name === t.name)).toBe(false);
|
for (const t of OWNER_TOOLS) expect(TOOLS.some(x => x.name === t.name)).toBe(false);
|
||||||
const ds = describeMethods().filter(m => m.method.startsWith('owner.'));
|
const ds = describeMethods().filter(m => m.method.startsWith('owner.'));
|
||||||
for (const d of ds) expect(d.kind).toBe('owner');
|
for (const d of ds) expect(d.kind).toBe('owner');
|
||||||
|
|
@ -111,12 +116,37 @@ describe('owner actions', () => {
|
||||||
const s = await session();
|
const s = await session();
|
||||||
for (const [m, args] of [['owner.play_rollout', { action: 'manual' }], ['owner.play_rollout', { action: 'percent', percent: 100 }], ['owner.play_rollout', { action: 'percent', percent: 0.5 }],
|
for (const [m, args] of [['owner.play_rollout', { action: 'manual' }], ['owner.play_rollout', { action: 'percent', percent: 100 }], ['owner.play_rollout', { action: 'percent', percent: 0.5 }],
|
||||||
['owner.ios_phased', { action: 'release' }], ['owner.ios_phased', { action: 'on', version: '--manual-release' }], ['owner.reply_send', { file: '../../etc/passwd' }],
|
['owner.ios_phased', { action: 'release' }], ['owner.ios_phased', { action: 'on', version: '--manual-release' }], ['owner.reply_send', { file: '../../etc/passwd' }],
|
||||||
['owner.reply_send', {}], ['reviews.reply', { file: 'play-1.md', text: '--yes' }], ['reviews.reply', { file: 'play-1.md', text: 'x'.repeat(6001) }]] as [string, J][])
|
['owner.reply_send', {}], ['reviews.reply', { file: 'play-1.md', text: '--yes' }],
|
||||||
|
['owner.prices_import', { csv: '--yes.csv' }], ['owner.prices_import', { csv: 'prices.txt' }], ['owner.prices_import', { only: 'a,--yes' }], ['owner.ppo_stop', { experiment: '--yes' }],
|
||||||
|
['project.render', { file: '../../etc/passwd.png' }], ['project.render', { file: '/etc/x.png' }], ['project.render', { file: 'en/ios69/01.txt' }], ['reviews.reply', { file: 'play-1.md', text: 'x'.repeat(6001) }]] as [string, J][])
|
||||||
expect(err(await s.call(m, { project: DEMO, args })).code).toBe(ERR.invalidParams);
|
expect(err(await s.call(m, { project: DEMO, args })).code).toBe(ERR.invalidParams);
|
||||||
expect(s.calls.length).toBe(0);
|
expect(s.calls.length).toBe(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('full CLI coverage: new methods', () => {
|
||||||
|
test('argv of the price sheet, PPO start / stop and the offline reads', async () => {
|
||||||
|
const t = (name: string) => OWNER_TOOLS.find(x => x.name === name)!;
|
||||||
|
expect(toArgv(t('owner_prices_import'), { csv: '/tmp/p.csv', dry_run: false }).argv).toEqual(['prices', 'import', '--csv', '/tmp/p.csv']);
|
||||||
|
expect(toArgv(t('owner_ppo_start'), { experiment: 'storebound b' }).argv).toEqual(['apple', 'ppo', 'start', '--experiment', 'storebound b', '--dry']);
|
||||||
|
expect(toArgv(t('owner_ppo_stop'), { dry_run: false }).argv).toEqual(['apple', 'ppo', 'stop']);
|
||||||
|
const s = await session();
|
||||||
|
for (const [m, args, argv] of [
|
||||||
|
['project.declarations', {}, ['inspect', '--declarations', '--json']], ['project.listing_text', {}, ['inspect', '--listing-text', '--json']],
|
||||||
|
['project.renders', { lang: 'en' }, ['shots', 'gallery', '--lang', 'en', '--json']], ['project.render', { file: 'b/en/ios69/01.png' }, ['inspect', '--render', 'b/en/ios69/01.png', '--json']],
|
||||||
|
['prices.current', { with_automatic: true }, ['prices', 'export', '--with-automatic', '--json']], ['prices.diff', { csv: '/tmp/p.csv' }, ['prices', 'import', '--csv', '/tmp/p.csv', '--dry', '--json']],
|
||||||
|
] as [string, J, string[]][]) {
|
||||||
|
expect(err(await s.call(m, { project: DEMO, args }))).toBeUndefined();
|
||||||
|
expect(s.calls.at(-1)!.argv).toEqual(argv);
|
||||||
|
}
|
||||||
|
// the fastlane import runs only on a folder without a config, and never through write_with_confirm's project list
|
||||||
|
expect(err(await s.call('import.fastlane', { project: DEMO, args: {} })).code).toBe(ERR.invalidParams);
|
||||||
|
const empty = mkdtempSync(join(tmpdir(), 'sb-fl-'));
|
||||||
|
expect(err(await s.call('import.fastlane', { project: empty, args: {} }))).toBeUndefined();
|
||||||
|
expect(s.calls.at(-1)!.argv).toEqual(['import', 'fastlane', '--dry']);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('the owner flag', () => {
|
describe('the owner flag', () => {
|
||||||
const saved = { ...process.env };
|
const saved = { ...process.env };
|
||||||
afterEach(() => { for (const k of ['STOREBOUND_SERVE', 'STOREBOUND_OWNER_CONFIRMED']) { if (saved[k] === undefined) delete process.env[k]; else process.env[k] = saved[k]; } });
|
afterEach(() => { for (const k of ['STOREBOUND_SERVE', 'STOREBOUND_OWNER_CONFIRMED']) { if (saved[k] === undefined) delete process.env[k]; else process.env[k] = saved[k]; } });
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue