From 8654aee77fa6aab9c40847021c5ba9bd5f788342 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 12 Aug 2026 12:50:48 +0000 Subject: [PATCH] showcase: author an `emptyState` fixture on the Urgent task view (#7714) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The spec declares a per-view empty-state translation surface (`objects.._views..emptyState.{title,message}`), it is authorable on a list view and it is documented — but no view anywhere under `examples/` authored one, so the declared key group had no reachable instance on the stock fixture. The i18n surface-matrix check had nothing to resolve and was recorded as waived-for-missing-fixture rather than actually run. Author the specimen on `showcase_task.listViews.urgent` and translate it in both bundle locales. The view choice is the substance here. Emptiness means different things on a filtered saved view and on an unfiltered object list: empty and unfiltered is a setup state ("nothing exists yet") that the showcase seed deliberately never produces, while empty and filtered is a steady state ("nothing matches right now") that a running deployment hits constantly. On this particular filter the empty result is also the outcome the user wants, so the copy reports good news instead of nagging about absent data — which is the case per-view empty-state copy exists to serve. It stays reachable without touching the seed, too: the two urgent seed rows are what the neighbouring `bulk_actions` view's `showcase_mark_done` is there to clear. The `en` arm is a first for this bundle, which until now carried `_views` only on the zh-CN side. It is deliberately not a mirror: view labels are already English in the view file, so restating all fifteen would be fifteen fake translations of exactly the kind this bundle's header warns about. Only the `emptyState` group is pinned, because a key present in one locale cannot demonstrate a locale-resolving surface — an `en` session would read the view's inline source string through the fallback path instead, which is a different code path. No changeset: `@objectstack/example-showcase` is a private workspace package, which the changeset gate excludes by design. --- .../src/system/translations/index.ts | 33 ++++++++++++++++++- .../app-showcase/src/ui/views/task.view.ts | 27 +++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/examples/app-showcase/src/system/translations/index.ts b/examples/app-showcase/src/system/translations/index.ts index 284ea770c2..755ef79c9a 100644 --- a/examples/app-showcase/src/system/translations/index.ts +++ b/examples/app-showcase/src/system/translations/index.ts @@ -58,6 +58,25 @@ export const ShowcaseTranslationBundle = { }, sync_error: { label: 'Sync Error' }, }, + // The FIRST `_views` block on the `en` side of this bundle, and + // deliberately not a mirror of the zh-CN one below: view LABELS are + // already English in `ui/views/task.view.ts`, so restating all fifteen + // here would be fifteen fake translations of the kind this bundle's + // header warns about. What earns an entry is the `emptyState` fixture + // (#7714): the surface-matrix check wants the SAME key resolving to + // different copy per locale, and a key present only in zh-CN cannot + // show that — an en session would be reading the view's inline source + // string through the fallback path, which is a different code path and + // proves nothing about the resolver. So this pins the en arm of that + // one key group, and nothing else. + _views: { + urgent: { + emptyState: { + title: 'No urgent tasks', + message: 'Nothing needs immediate attention right now. A task appears here as soon as its priority is raised to Urgent.', + }, + }, + }, }, showcase_account: { label: 'Account', @@ -247,7 +266,19 @@ export const ShowcaseTranslationBundle = { // The default list — keyed `default`, see showcase_project above. default: { label: '全部任务' }, in_progress: { label: '进行中' }, - urgent: { label: '紧急' }, + urgent: { + label: '紧急', + // The showcase's only `emptyState` specimen (#7714) — the view is + // authored with one in `ui/views/task.view.ts`, so this is the + // locale half of that fixture. Two new source labels enter the + // extractor's expected set here; both are translated in the same + // change, which is what keeps check:i18n-coverage's frozen + // untranslated count for this example unmoved in either direction. + emptyState: { + title: '暂无紧急任务', + message: '当前没有需要立即处理的事项。任务优先级调整为「紧急」后会出现在这里。', + }, + }, done: { label: '已完成' }, tabular: { label: '任务清单' }, grid: { label: '表格' }, diff --git a/examples/app-showcase/src/ui/views/task.view.ts b/examples/app-showcase/src/ui/views/task.view.ts index 934f37c467..337230eb45 100644 --- a/examples/app-showcase/src/ui/views/task.view.ts +++ b/examples/app-showcase/src/ui/views/task.view.ts @@ -74,6 +74,33 @@ export const TaskViews = defineView({ data, columns: [{ field: 'title' }, { field: 'project' }, { field: 'assignee' }, { field: 'status' }, { field: 'priority' }, { field: 'due_date' }], filter: [{ field: 'priority', operator: 'equals', value: 'urgent' }], + + // ── The showcase's `emptyState` specimen (#7714) ────────────────────── + // Authored HERE, on a filtered saved view, and not on some unfiltered + // object list: emptiness means different things on the two. An empty + // unfiltered list is a SETUP state ("nothing exists yet") that the seed + // deliberately never produces; an empty filtered view is a STEADY state + // ("nothing matches right now") that a running deployment hits + // constantly — and on *this* filter it is the outcome you want, so the + // copy can report good news instead of nagging about missing data. That + // is the case per-view empty-state copy exists for, which makes this the + // spelling worth pinning as the fixture. + // + // It is also reachable without touching the seed: the two urgent seed + // rows are exactly what the `bulk_actions` view's `showcase_mark_done` + // is there to clear, so a demo user empties this view by using the app. + // + // Consumed as a translation surface at + // `objects.showcase_task._views.urgent.emptyState.{title,message}` — + // both locales are authored in `system/translations/index.ts`. Until + // this fixture existed the spec declared that key group with no + // reachable instance anywhere under `examples/`, so the i18n + // surface-matrix check had nothing to resolve and was waived rather + // than run. + emptyState: { + title: 'No urgent tasks', + message: 'Nothing needs immediate attention right now. A task appears here as soon as its priority is raised to Urgent.', + }, }, done: { label: 'Done',