Skip to content

feat(tray): mark dev-instance tray icons with a DEV indicator - #9253

Merged
nwparker merged 2 commits into
mainfrom
nwparker/dev-indicator-tray
Jul 18, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/dev-indicator-tray

Conversation

@nwparker

@nwparker nwparker commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Dev builds reuse the production template glyph in the macOS menu bar, so a dev instance's status item was indistinguishable from the installed app's. This adds a DEV indicator to the system tray without changing the status item's size:

  • macOS: a 5px pixel-caps DEV badge is stamped directly into the menu-bar template bitmap (tray-dev-badge.ts), in the empty area left of the orca glyph — the status item keeps the exact production footprint. Badge pixels are template black, so macOS tints them correctly in both light and dark menu bars, and the attention (amber dot) tint path inherits the badge for free since it reads the same pixels. A one-pixel cleared margin keeps the orca tail's antialiased pixels from bleeding into the V. The @2x Retina representation is rebuilt with the badge so it stays sharp.
  • macOS + Windows: the tooltip becomes Orca DEV (<worktree/branch label>), using the same getDevInstanceIdentity label that already feeds the window title and Dock, so multiple side-by-side dev instances (one per worktree) can be told apart by hover.
  • Both: the tray context menu gains a disabled header row with the same label, tying the menu to its instance.
  • Production instances are entirely unaffected (isDev: false short-circuits to the previous image and strings), and a badge-stamping failure degrades to the plain icon instead of aborting tray creation.

New tray.activityWaitingSuffix key synced across all locale catalogs via pnpm run sync:localization-catalog.

Screenshots

Menu bar — dev instance (left, with DEV badge) next to the production Orca icon (right), same footprint:

menu bar with DEV-badged icon

Pixel zoom (nearest-neighbor 8x) of the badged icon vs the production icon:

badge pixel zoom

Tray menu with the instance-identifying header:

tray menu with Orca DEV header

Testing

  • tray-dev-badge.test.ts: badge keeps the template canvas size, stamps only opaque template-black pixels, empty-image no-op, and the @2x stamp covers exactly 4x the 1x area.
  • system-tray.test.ts: dev badge stamped with rebuilt Retina rep + setTemplateImage(true), attention tints the badged image, stamping failure falls back to the plain icon, tooltip/menu header with and without label, attention-toggle tooltip persistence, Windows tooltip, production no-op. 32/32 tray tests pass.
  • pnpm run typecheck clean.
  • Verified live across three iterations: launched the dev build via run-electron-vite-dev.mjs, screenshotted the real menu bar, and pixel-zoomed the result. First attempt used tray.setTitle('DEV') (rejected: widens the item); the first in-icon placement collided with the orca tail's antialiasing and read "DEU" — fixed by shifting the badge up one row and clearing a margin. Final screenshots above show the corrected badge at production width.

Dev builds reuse the production template glyph in the macOS menu bar, so a
dev status item was indistinguishable from the installed app's. Show a
'DEV' title next to the glyph on macOS, carry the dev worktree/branch label
in the tooltip on both macOS and Windows, and add a disabled menu header
identifying the instance so side-by-side dev trays can be told apart.

Co-authored-by: Orca <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Development-instance metadata now flows into the system tray. Development trays display DEV-aware tooltips and menu indicators, while macOS applies a DEV badge to the template icon and preserves the indicator during attention updates. Windows uses the tooltip without macOS-specific behavior. Production trays remain unchanged. Tray tests cover these behaviors, and localized waiting-state suffix keys were added across supported locales.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary, screenshots, and testing, but it omits required AI Review Report, Security Audit, and Notes sections. Add the missing AI Review Report, Security Audit, and Notes sections, and include the cross-platform review details required by the template.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly summarizes the main change: adding a DEV indicator to dev-instance tray icons.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The setTitle('DEV') text widened the status item beyond the production
footprint. Stamp a 5px pixel-caps DEV badge into the menu-bar template
instead: same item size, template-tinted for both menu-bar themes, and
inherited by the attention tint path. A cleared margin keeps the orca
tail's antialiased pixels from closing the V into a U.

Co-authored-by: Orca <[email protected]>

@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.

🧹 Nitpick comments (1)
src/main/tray/tray-dev-badge.ts (1)

34-38: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Optimize bounding box clearing by using row-level fills.

Calling bitmap.fill() for every single pixel introduces unnecessary function-call overhead. Since the pixels in each row are contiguous in memory, you can clear each row segment in a single fill() call.

♻️ Proposed refactor
-  for (let y = Math.max(0, clearTop); y < Math.min(pixelHeight, clearBottom); y++) {
-    for (let x = Math.max(0, clearLeft); x < Math.min(pixelWidth, clearRight); x++) {
-      bitmap.fill(0x00, (y * pixelWidth + x) * 4, (y * pixelWidth + x) * 4 + 4)
-    }
-  }
+  const startX = Math.max(0, clearLeft)
+  const endX = Math.min(pixelWidth, clearRight)
+  if (startX < endX) {
+    for (let y = Math.max(0, clearTop); y < Math.min(pixelHeight, clearBottom); y++) {
+      bitmap.fill(0x00, (y * pixelWidth + startX) * 4, (y * pixelWidth + endX) * 4)
+    }
+  }

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 05f58652-254e-4613-a9f5-03fd6aa2f4b9

📥 Commits

Reviewing files that changed from the base of the PR and between 01cf71c and 436e85f.

📒 Files selected for processing (4)
  • src/main/tray/system-tray.test.ts
  • src/main/tray/system-tray.ts
  • src/main/tray/tray-dev-badge.test.ts
  • src/main/tray/tray-dev-badge.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/tray/system-tray.ts
  • src/main/tray/system-tray.test.ts

@nwparker
nwparker merged commit c436df0 into main Jul 18, 2026
1 check passed
@nwparker
nwparker deleted the nwparker/dev-indicator-tray branch July 18, 2026 01:50
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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