Repository navigation
Plugin check runs the worker; check scenarios; RelativeTime - #37047
Conversation
- orca plugin check mounts the plugin's worker (main) on the same mock host
as each panel, so plugin.request reaches its orca.panels.handle handlers
as in Orca; a worker that fails to activate or deactivate is an issue
named after its file. In orca/testing, a worker mounted on a host answers
that host's panel requests unless `requests` stubs the name.
- Check scenarios: <entry>.check.ts (e.g. src/panel.check.ts) exports
defineCheck({ name: { ...mockHost options, persisted, theme, events } });
check renders the panel once per scenario and labels each result.
- RelativeTime (catalog 3, since 1.4.247) and { type: 'relative', at } Table
cells: Orca ticks them (each second under a minute, then less often), so
plugins never poll. Inline inside Text; test kit reads them as drawn.
- Typings, docs, skill guide, generated references; gallery shows it.
Findings
|
There was a problem hiding this comment.
Actionable comments posted: 2

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
bdc41a23-3e8f-417f-9d91-b31bb9e53847
Files selected for processing: 36-
config/scripts/generate-plugin-authoring-skill-references.mjsdocs/reference/plugin-declarative-ui.mdexamples/plugins/components-gallery/src/content.tsxresources/plugins/declarative/orca-components-data.d.tsresources/plugins/declarative/orca-components.d.tsresources/plugins/declarative/orca-runtime.mjsresources/plugins/declarative/orca-testing.mjsresources/plugins/types/orca-testing.d.tsskill-guides/orca-plugin-authoring.mdskill-guides/orca-plugin-authoring/references/components.mdskill-guides/orca-plugin-authoring/references/recipes.mdskill-guides/orca-plugin-authoring/references/testing.mdskill-guides/orca-plugin-authoring/references/workflow.mdsrc/cli/bundled-skill-guides.tssrc/cli/plugin-authoring/plugin-panel-check-script.tssrc/cli/plugin-authoring/plugin-panel-check.tssrc/cli/plugin-authoring/plugin-test-runner.test.tssrc/renderer/src/components/plugins/declarative/PluginDeclarativeRelativeTime.tsxsrc/renderer/src/components/plugins/declarative/PluginDeclarativeRichNode.tsxsrc/renderer/src/components/plugins/declarative/PluginDeclarativeTable.tsxsrc/renderer/src/components/plugins/declarative/PluginDeclarativeView.rich.test.tsxsrc/shared/plugins/declarative/plugin-declarative-catalog.tssrc/shared/plugins/declarative/plugin-declarative-content-props.tssrc/shared/plugins/declarative/plugin-declarative-data-props.tssrc/shared/plugins/declarative/plugin-declarative-message-names.tssrc/shared/plugins/declarative/plugin-declarative-relative-time.test.tssrc/shared/plugins/declarative/plugin-declarative-relative-time.tssrc/shared/plugins/declarative/plugin-declarative-tree.tssrc/shared/plugins/declarative/runtime/declarative-lifecycle.test.tssrc/shared/plugins/declarative/runtime/orca-module.tssrc/shared/plugins/declarative/testing/orca-testing-worker.test.tssrc/shared/plugins/declarative/testing/orca-testing.tssrc/shared/plugins/declarative/testing/testing-host.tssrc/shared/plugins/declarative/testing/testing-plugin-data.tssrc/shared/plugins/declarative/testing/testing-tree.tssrc/shared/plugins/declarative/testing/testing-worker.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
-
| export const pluginRelativeTimeAt = z | ||
| .number() | ||
| .refine(Number.isFinite, 'must be a finite time in milliseconds') |
There was a problem hiding this comment.
Reject timestamps that Date cannot represent.
pluginRelativeTimeAt accepts 1e16, but PluginDeclarativeRelativeTimeText calls new Date(at).toISOString(). That call throws a RangeError instead of displaying the schema’s placeholder. Limit at to the supported Date range in this shared schema so both RelativeTime nodes and Table cells reject it before rendering. (raw.githubusercontent.com)
| export function pluginRelativeTimeTickMs(diffMs: number): number { | ||
| const size = Math.abs(diffMs) | ||
| return size < 60_000 ? 1000 : size < 3_600_000 ? 15_000 : 300_000 |
There was a problem hiding this comment.
Schedule future timestamps before the next unit boundary.
When at is 61 minutes away, this helper returns five minutes. The display can therefore remain at “in 1 hour” for almost five minutes after it should switch to minutes. Cap the delay at the time remaining until the next smaller-unit boundary for future timestamps. (raw.githubusercontent.com)
ELI5
orca plugin checkrenders each plugin panel once to catch problems before you load the plugin. A second from-scratch dogfood build found three gaps:This fixes all three.
What Changed
orca plugin checkruns the workermain, check mounts the worker (mountWorker) on the same mock host before mounting each panel, soplugin.requestreaches the worker'sorca.panels.handlehandlers as it does in Orca.worker (src/worker.ts): ….mockHost({ requests })stubs the name. Tests can drive a panel and its real worker together.Check scenarios
src/panel.check.tsbeside the panel exportsdefineCheck({ name: { ...mockHost options, persisted, theme, events } })fromorca/testing.panel (src/panel.tsx, scenario "busy").RelativeTime(catalog 3, since 1.4.247)<RelativeTime at format? />can sit inline insideText, and relative Table cells are{ type: 'relative', at, format? }.short"5m ago",long"5 minutes ago",duration"5m".<time>with a full-date tooltip in the UI locale. No plugin polling.ui.has('RelativeTime'); the test kit reads it as Orca draws it.Docs and skill
defineCheckandCheckScenario, plusRelativeTimePropsand the relative cell.references/workflow.md. The recipe uses a Table with a relative "since" cell.RelativeTime.Why
setuppreviously had to swallow the error to pass check, which also hid real failures.Linked Issue
N/A (maintainer change).
Visual Proof
N/A:
RelativeTimerenders as plain text (e.g. "5m ago") with a tooltip. The gallery example's Content tab shows one, and the renderer test advances "58 seconds ago" to "1 minute ago" with fake timers.Testing
Unit:
unknown_method.CLI:
activateworker and an unanswered request are each reported.Gates:
pnpm tc, the fullpnpm lint, and the skill references and bundled-guide checks pass. Unit tests: 3,829 passed. The plugin e2e set passes, 27/27 (macOS).I manually tested these changes locally
Automated tests added/updated, or explained why not below
Agent skill upstream boundary
Notes
RelativeTimeas the neutral placeholder; plugins can checkui.has.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)