You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b223072
Browse filesBrowse the repository at this point in the historyBrowse files
fix(setup): mute a not-running packaged flow's switch and say the scheduled-work policy plainly (#27389)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8L5cxFd5VXuXyEz4rkHiJ9G)_Fixes#27378
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:Setup ›
打包自动化里,开关已开但引擎没有运行的流程,开关的「开」轨道改成灰色;因部署策略不运行定时任务的那一行,徽标换成一句白话「已启用,但此部署不运行计划任务」(十种语言)。
- 为什么改:原来绿色轨道让管理员以为流程在跑,而唯一的解释藏在 Details 里、还点名一个浏览器里改不了的环境变量。
- 风险与回滚:只改外观和文字,开关仍可点、仍写入启用标志,服务端原句仍在 Details 后面;回滚即还原本 PR。
-
先看:`ui/packages/app-shell/src/views/setup/PackagedAutomationPage.tsx`(Activation
单元格那段)、`PackagedAutomationPage.test.tsx` 第 7
节、`ui/packages/i18n/src/locales/en.ts` 新 key。
- 两分钟验证:`pnpm --dir ui exec vitest run
packages/app-shell/src/views/setup/PackagedAutomationPage.test.tsx`,预期
31 个用例全绿。
- 需要你做的:无,席位落地。
## What changes
On Setup › Packaged automation, the Activation cell of a flow whose
activation flag is on but which the engine has not armed (the row
carries an `unboundCause`):
- **Muted on-track.** The switch gets
`data-[state=checked]:bg-muted-foreground/60`, the same muted fill
Studio's Automations pillar uses for an on switch it cannot flip
(#27376, merged). `cn()` inside the `Switch` primitive drops the
primitive's `data-[state=checked]:bg-primary` for it. Only the colour
moves: the switch stays enabled, `checked` stays `row.enabled`,
`aria-checked` stays `true`, and toggling still writes the flag (the
ruling kept from objectui#13159).
- **Plain words for `deployment_policy`.** A row whose `unboundCause` is
`deployment_policy` reads "On, but this deployment does not run
scheduled work" in place of the badge, as a muted text line rather than
a badge, because the badge is `whitespace-nowrap` and the sentence would
overflow the 220px column. New key
`packagedAutomation.notRunningDeploymentPolicy` in all ten locale packs,
as `packagedAutomation.notRunning` is. The server's reason sentence is
not rewritten: it stays verbatim behind the Details chip
(`ReasonDetails`).
- **Unchanged.** Rows with `disabled_subflow`, `missing_trigger` or
`binding_failure` keep the outlined "Not running here" badge. Running
rows keep "On" on the primary track; off rows keep "Off".
- Doc comments in `PackagedAutomationPage.tsx` and `packagedFlows.ts`
that said the page reads `unboundCause` "for presence only" / "no cause
is told apart" now say which cause is told apart and why.
## Why
HotCRM's 18.2.0 browser pass (row 3 of #27356): five scheduled flows
each showed a green On switch beside "Not running here", and the only
explanation was the platform sentence naming
`OS_AUTOMATION_SCHEDULED_WORK_ENABLED`, which an administrator cannot
act on from the browser.
## Tests
`PackagedAutomationPage.test.tsx` section 7 (the Activation cell),
beside the existing pins:
- acceptance: a `deployment_policy` row's switch is checked,
`aria-checked="true"`, enabled, carries the muted track and not the
primary one; the cell reads the plain line and does not contain the
variable name;
- Details on that row still opens the platform sentence verbatim;
- CONTROL: bound, no-trigger and off rows keep the primary track class
and "On" / "On" / "Off";
- CONTROL: `binding_failure`, `disabled_subflow` and `missing_trigger`
rows keep "Not running here" (one badge class), with a muted track; none
is destructive or an alert;
- CONTROL: the switch on a not-running row is muted and still toggles
and writes `{ enabled: false }`;
- the existing re-read-after-toggle pin now expects the plain line for
the policy row.
Four existing section 7 assertions pinned "Not running here" on a
`deployment_policy` row; they now pin the plain line, which is this
card's intended change.
## Acceptance notes
- The plain line is keyed on the closed `unboundCause` value, never on
the reason sentence, which stays rendered and not parsed.
- `react-hooks/set-state-in-effect` warns on the page's existing load
effect (`setLoadError(null)`); it predates this diff and is untouched.
## Verification
All local runs on head `447a335f`, in worktree
`objectstack-issue-27378`, after the `@object-ui/app-shell^...` closure
build.
<details><summary>Tests and ablations</summary>
- `pnpm --dir ui exec vitest run --maxWorkers=2` over
`PackagedAutomationPage.test.tsx`, `packagedFlows.test.ts`,
`PackagedAutomationPage.navContribution.test.tsx`, `i18n
all-locales-key-parity.test.ts`, `en-zh-key-parity.test.ts`: Test Files
5 passed (5), Tests 100 passed (100); lock VERDICT command-exit 0.
- Ablation 1 (`scripts/ablation-replace.mjs`, anchor the Switch
`className` expression replaced by `className={undefined}`): mutation
landed (anchor 1 to 0, blob 821b47b to 97d1e96a); 4 failed, 27 passed,
including the acceptance test and the controls test.
- Ablation 2 (the `deployment_policy` branch condition replaced by
`false ?`): mutation landed (blob 821b47b to 3e057618); 4 failed, 27
passed, including the acceptance test.
- Restore: `git hash-object` of the page = `git rev-parse HEAD:` blob
`821b47b0`, `git diff HEAD` empty.
</details>
<details><summary>Type-check, lint, gates</summary>
- `pnpm --filter @object-ui/app-shell run type-check` exit 0; `pnpm
--filter @object-ui/i18n run type-check` exit 0.
- `eslint --no-inline-config` on the touched page, test,
`packagedFlows.ts`, `en.ts`, `zh.ts`: 0 errors, 1 pre-existing warning
(above).
- `pnpm --dir ui run check:i18n-keys`, `check:i18n-drift`,
`check:i18n-dead-keys`: exit 0.
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`: 34 commands derived; each run with its exit
captured before any pipe, all 34 exit 0; `--ran` reconciliation: 34
derived, 34 run, 0 NOT-MEASURED, 0 UNRUN. `node
scripts/check-sdui-manifest.mjs` exit 0, `--self-test` exit 0; `pnpm
--dir ui exec vitest run scripts/` Test Files 169 passed, 2 skipped. The
type-check lanes and the wide-population families are CI's.
- `pnpm check:changeset-fixed` (roster under `.changeset`): exit 0.
`pnpm --dir ui run check:new-line-citations`: exit 0.
</details>
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes. (touched files linted
locally; CI runs the full lint)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (not touched)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English. (the 维护者速读 block is in
Chinese by the os-dev order)
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JQwxbZD1bmtia9yxWboCpN)_
Co-authored-by: Claude <noreply@anthropic.com>
fix(setup): a packaged flow the deployment does not run no longer shows a green switch, and a scheduled-work policy row says so in plain words
8
+
9
+
Clause-②: no
10
+
Metadata-protocol: none
11
+
12
+
-**Before.** On Setup › Packaged automation, a flow whose activation flag is on but which the engine has not armed showed the switch's green "on" track beside an outlined "Not running here" badge. An administrator read the green track as "running". When the cause was the deployment's scheduled-work policy, the only explanation was the platform's sentence behind Details, which names an environment variable the administrator cannot set from the browser.
13
+
-**Now.** A not-running row's switch draws a muted on-track. A row whose engine cause is `deployment_policy` reads "On, but this deployment does not run scheduled work" in place of the badge, localized in all ten packs (new key `packagedAutomation.notRunningDeploymentPolicy`). The platform's sentence stays verbatim behind Details.
14
+
-**Unchanged.** The switch stays enabled, stays checked while the flag is on, and still writes the flag. Rows with the other causes (`disabled_subflow`, `missing_trigger`, `binding_failure`) keep "Not running here". Running rows keep the primary track and "On"; off rows keep "Off".
Copy file name to clipboardExpand all lines: ui/packages/i18n/src/locales/de.ts
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4616,6 +4616,7 @@ const de = {
4616
4616
on: "An",
4617
4617
off: "Aus",
4618
4618
notRunning: "Läuft hier nicht",
4619
+
notRunningDeploymentPolicy: "An, aber diese Installation führt keine geplanten Aufgaben aus",
4619
4620
clone: "Klonen",
4620
4621
cloneTitle: "Paket-Flow klonen",
4621
4622
cloneBody: "Die Kopie übernimmt die gesamte Definition und benötigt einen neuen Maschinennamen und ein neues Label. Bearbeiten Sie die Kopie im Studio.",
0 commit comments