Skip to content

feat(plugins): status bar items plugins can update live - #37291

Merged
nwparker merged 9 commits into
mainfrom
nwparker/plugin-a2-status-bar-keybindings
Nov 2, 2026
Merged

nwparker merged 9 commits into
mainfrom
nwparker/plugin-a2-status-bar-keybindings

Conversation

@nwparker

@nwparker nwparker commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​498 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​495
Prod 43 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​810 $\color{#cf222e}{\Huge{\mathbf{−}}}$​57 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​753

ELI5

Plugins can now put small items in Orca's status bar, such as a count, a state or a quick action, and update them live. Pressing an item runs one of the plugin's commands.

What Changed

  • Manifest: contributes.statusBarItems is now a real contribution point (it was reserved and had to be empty): { id, text?, icon?, tone?, tooltip?, command? }, at most 8 per plugin. icon uses the plugin icon set, tone the usual tones, and command must be one of the plugin's own commands. The lowest profile (declarative) is enough for static items. Engine floor 1.4.248.
  • Live updates: a worker calls orca.host.call('statusBar.update', { id, text, icon, tone, tooltip, visible }). It is a new row in the host-API table (API 1.2), so typings, docs and host.has are generated. Main keeps the values for the session and pushes them to every desktop window. They are cleared when the plugin is disabled, removed or updated, so a re-enable starts from the manifest.
  • Display: items sit next to the Plugins icon in the status bar, use the existing status bar button style, icons and tone colours, and are hidden in paired web windows like the Plugins icon. The plugin page's "Adds to Orca" lists them.
  • Docs: regenerated references, schemas, typings and skill references, plus a recipe ("A status bar item a worker updates").

Why

Full modability needs plugins to reach Orca's own surfaces, and the status bar is the most-wanted one (counters, sync state, quick toggles). Declaring items in the manifest and updating them through one host method keeps them native-looking and lets Orca show them before the worker starts. Not audit-logged, because a worker may redraw an item many times a minute.

Linked Issue

N/A (maintainer).

Visual Proof

A dev plugin declares one status bar item (Guard: idle, flag icon, runs guard.check). Pressing it runs the worker command, which calls statusBar.update with 3 blocked and the warning tone.

Before (manifest value):

(screenshot removed: contained real product data)

After the worker's update:

(screenshot removed: contained real product data)

The plugin page's "Adds to Orca" lists the item:

(screenshot removed: contained real product data)

Testing

  • New tests: manifest validation, the host method and stored state, collecting items (updated, hidden, disabled plugin, older host), clearing on disable/remove/update, rendering and pressing, plugin page row.
  • pnpm test over shared/main plugins, main/ipc, main/startup, cli, renderer plugins and status bar: all pass. pnpm tc passes.

Risk

Level: Low. Additive; the status bar shows nothing new unless a plugin declares items. Older hosts ignore the field. Paired web clients do not show the items. Item text is not localized (it comes from the plugin). Plain revert.

Agent skill upstream boundary

  • Not applicable.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I stated the risk
  • Before/after screenshots attached

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Recent 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: 9b8e0374-046b-4810-aadb-0390a1e4e5db
Commits

Reviewing files that changed from the base of the PR and between a6c739c and 445cc52.

Files selected for processing: 2
  • src/renderer/src/i18n/locales/en.json
  • src/shared/plugins/installation/plugin-host-version.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Walkthrough

The change adds manifest-defined status-bar items with validation for their fields, commands, and plugin profile. Workers can update declared items through statusBar.update. The main process stores overrides and sends changes to renderer subscribers. The renderer merges overrides with enabled plugins’ contributions and displays eligible items. Plugin manager contribution summaries and authoring references also include status-bar items.

Merge Risk: Low · previous review 445cc

Plugin details may fail to show available status-bar additions, leaving users with incomplete contribution information.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.83% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: plugins can add status bar items and update them live.
Description check Passed The description covers the required sections and provides user-facing behavior, implementation details, rationale, visual proof, testing results, risk, and rollback information. The Review and Notes s…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description covers the required sections and provides user-facing behavior, implementation details, rationale, visual proof, testing results, risk, and rollback information. The Review and Notes sections are omitted, and several checklist items remain unchecked, but the description is mostly complete.

Full details: Docstring Coverage

Explanation

Docstring coverage is 20.83% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 24 functions across 39 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Nitpick comments: 1
src/main/plugins/status-bar/plugin-status-bar-state.ts: 1

21-26: Trivial · Performance & Scalability · Quick win

Skip the emit when an update changes nothing.

update always replaces this.overrides and calls emit(). This happens even when the merged patch equals the stored one. A worker that polls and writes the same text every few seconds sends one IPC message per call to every window. Each message gives the renderer a new overrides identity. That identity re-runs collectPluginStatusBarItems and re-renders the status bar. The statusBar.update spec says calls may happen "many times a minute", so this case is realistic.

Return early when the install is unchanged and the merged patch is shallow-equal to the previous one. The revisions entry must still be set first.

Proposed change
-    const items = this.revisions.get(pluginKey) === revision ? this.overrides[pluginKey] : {}
+    const sameInstall = this.revisions.get(pluginKey) === revision
+    const items = sameInstall ? this.overrides[pluginKey] : {}
     this.revisions.set(pluginKey, revision)
-    const merged = { ...items?.[itemId], ...patch }
+    const previous = items?.[itemId]
+    const merged = { ...previous, ...patch }
+    if (sameInstall && previous && isSamePatch(previous, merged)) {
+      return
+    }

Add this helper at module level:

function isSamePatch(a: PluginStatusBarItemPatch, b: PluginStatusBarItemPatch): boolean {
  const keys = new Set([...Object.keys(a), ...Object.keys(b)])
  return [...keys].every((key) => a[key as keyof typeof a] === b[key as keyof typeof b])
}
[recommended_refactor_placeholder]

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: 149e78ba-55d2-4025-9843-86efd5a9502c
Commits

Reviewing files that changed from the base of the PR and between a29461b and a6c739c.

Files selected for processing: 47
  • docs/reference/plugin-authoring.md
  • docs/reference/plugin-catalog.md
  • docs/reference/plugin-host-api.md
  • docs/reference/plugin-manifest.md
  • docs/schemas/plugins/orca-catalog.v2.schema.json
  • docs/schemas/plugins/orca-plugin.v2.schema.json
  • resources/plugins/types/orca-host.d.ts
  • skill-guides/orca-plugin-authoring/references/host-api.md
  • skill-guides/orca-plugin-authoring/references/manifest.md
  • skill-guides/orca-plugin-authoring/references/recipes.md
  • src/cli/bundled-skill-guides.ts
  • src/main/ipc/plugin-status-bar-ipc.test.ts
  • src/main/ipc/plugin-status-bar-ipc.ts
  • src/main/ipc/plugins-panel-document-lifetime.test.ts
  • src/main/ipc/plugins.ts
  • src/main/plugins/plugin-list-projection.ts
  • src/main/plugins/plugin-service-host-call.ts
  • src/main/plugins/plugin-service-options.ts
  • src/main/plugins/plugin-service.ts
  • src/main/plugins/status-bar/plugin-status-bar-state.ts
  • src/main/plugins/workers/plugin-host-method-bindings.ts
  • src/main/plugins/workers/plugin-host-service-bindings.ts
  • src/main/plugins/workers/plugin-host-status-bar-method-bindings.ts
  • src/main/plugins/workers/plugin-host-status-bar-methods.test.ts
  • src/main/startup/main-process-plugins.ts
  • src/preload/api/plugin-host-api.ts
  • src/preload/api/plugins-bridge.ts
  • src/renderer/src/components/plugins/list/PluginManager.catalog.test.tsx
  • src/renderer/src/components/plugins/page/PluginAddsSection.tsx
  • src/renderer/src/components/plugins/presentation/plugin-contribution-row-labels.ts
  • src/renderer/src/components/plugins/presentation/plugin-contributions.test.ts
  • src/renderer/src/components/plugins/presentation/plugin-contributions.ts
  • src/renderer/src/components/plugins/state/use-plugin-contribution-source.ts
  • src/renderer/src/components/status-bar/PluginStatusBarItems.test.tsx
  • src/renderer/src/components/status-bar/PluginStatusBarItems.tsx
  • src/renderer/src/components/status-bar/StatusBarSurface.tsx
  • src/renderer/src/store/plugin-status-bar-items.test.ts
  • src/renderer/src/store/plugin-status-bar-items.ts
  • src/shared/plugins/contributions/plugin-content-pack-contributions.test.ts
  • src/shared/plugins/contributions/plugin-contribution-points.ts
  • src/shared/plugins/contributions/plugin-status-bar-item-contribution.test.ts
  • src/shared/plugins/contributions/plugin-status-bar-item-contribution.ts
  • src/shared/plugins/contributions/plugin-status-bar-state.ts
  • src/shared/plugins/manifest/plugin-manifest-contribution-validation.ts
  • src/shared/plugins/plugin-list-entry.ts
  • src/shared/plugins/workers/plugin-host-api-status-bar.ts
  • src/shared/plugins/workers/plugin-host-api.ts
Files with no reviewable changes: 1
  • docs/reference/plugin-authoring.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

if (mode === 'light') {
return `${kindLabel} · ${translate('auto.components.settings.pluginContributions.light', 'Light')}`
newFiles: of('newFiles').map((item) => ({ title: item.name, extension: item.detail ?? '' })),
statusBarItems: []

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Include status-bar items in catalog summaries.

When a catalog release has a contribution summary, PluginAddsSection prefers it over the fetched manifest. This empty array therefore hides its status-bar items before installation, even after the preview loads.

Add status-bar items to both this projection and pluginContributionSummary, which currently omits them. (raw.githubusercontent.com)

@nwparker
nwparker force-pushed the nwparker/plugin-a2-status-bar-keybindings branch from 445cc52 to 4257bed Compare November 2, 2026 03:59
…date)

A plugin declares status bar items { id, text?, icon?, tone?, tooltip?,
command? } (declarative profile, engines >=1.4.247); pressing one runs
its own command. A trusted worker changes them with the new worker-only
host method statusBar.update; main keeps the session's changes and
pushes snapshots to desktop windows over plugins:statusBarChanged.
Regenerates schemas, references, typings and the authoring skill.
… catalog summaries

- An item whose command needs a workspace is disabled with no open workspace.
- A dev code edit (new devRevision) drops the old worker's status bar changes.
- Catalog summaries list status bar items, and marketplace details show them.
…l lists them

The skill no longer calls status bar items reserved and gains a row for them. The
dev-load/inspect approval already lists them via the contribution summary; a test pins
that and the fingerprint binding.
@nwparker
nwparker force-pushed the nwparker/plugin-a2-status-bar-keybindings branch from 945eefb to 5f29fe4 Compare November 2, 2026 04:26
@nwparker
nwparker enabled auto-merge (squash) November 2, 2026 04:26
@nwparker
nwparker merged commit a9b1041 into main Nov 2, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant