Skip to content

feat(desktop): add task context titlebar - #178

Merged
cnjack merged 2 commits into
mainfrom
codex/desktop-task-titlebar
Jul 30, 2026
Merged

feat(desktop): add task context titlebar#178
cnjack merged 2 commits into
mainfrom
codex/desktop-task-titlebar

Conversation

@cnjack

@cnjack cnjack commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Use the macOS Desktop overlay titlebar for the active task title, workspace, and branch context, aligned with the main workspace column rather than the sidebar.
  • Add a task-details popover with workspace/path/model information, per-session cloud sync, and pin/rename/archive actions—without an ellipsis menu.
  • Discover supported editors, terminals, and Finder through macOS Launch Services by bundle ID; show only applications actually installed on the Mac.
  • Render each discovered app's native .icns artwork in the “Open” menu, use Finder's native reveal API, and resolve all other apps inside the Tauri backend.
  • Validate canonical workspace paths and opaque app IDs in Rust, removing the broader frontend opener allowlist.
  • Keep browser and non-macOS surfaces on the existing standalone TopBar and cloud control.
  • Make branch lookup task-scoped and harden cloud sync against stale refreshes, rapid task switching, duplicate toggles, and unmount races.
  • Add keyboard navigation, ARIA relationships, localized copy, and focused Go/React/Rust tests.

Why

The macOS Desktop titlebar was visually empty even though task identity and environment context are frequently needed. The first pass also guessed at installed applications and represented them with generic symbols. This revision follows the model used by GitHub Desktop and Raycast: identify installed apps through their bundle IDs, then let the operating system supply the real app identity and icon.

User impact

Desktop users can identify the active task and branch at a glance, manage task metadata and cloud sync from one place, and open the current local workspace only in tools present on their Mac. Finder now uses the system reveal path. Browser behavior is unchanged.

Validation

  • make build-web
  • make lint-web
  • go test ./...
  • pnpm --dir web test (19 tests)
  • cargo check --manifest-path desktop/src-tauri/Cargo.toml
  • cargo test --manifest-path desktop/src-tauri/Cargo.toml (3 tests, including native Finder discovery/icon extraction on macOS)
  • cargo clippy --manifest-path desktop/src-tauri/Cargo.toml --all-targets -- -D warnings
  • git diff --check
  • Prior titlebar visual QA at 1280 px and the 760 px minimum width
  • Adversarial audit plus read-only Kimi CLI and Grok CLI reviews; final Kimi review: APPROVE

make lint is currently blocked by 44 pre-existing SA5011 findings in untouched Go test files; none are in this PR's diff. The web lint/typecheck and all Go, React, and Rust tests above pass.

Summary by CodeRabbit

  • New Features

    • Added a macOS desktop title bar with task details, workspace information, task actions, and cloud sync controls.
    • Open local workspaces directly in supported applications, including Finder, with app icons and keyboard navigation.
    • Added localized title bar text in English, Japanese, Korean, Simplified Chinese, and Traditional Chinese.
  • Bug Fixes

    • Workspace details and Git status now reflect the selected task’s project.
    • Improved cloud sync reliability, preventing stale updates and duplicate toggle requests.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e10f5917-4fd2-43d5-9be4-91c488c3d018

📥 Commits

Reviewing files that changed from the base of the PR and between d63dd31 and 9b39ff3.

⛔ Files ignored due to path filters (1)
  • desktop/src-tauri/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (18)
  • desktop/src-tauri/Cargo.toml
  • desktop/src-tauri/src/desktop_apps.rs
  • desktop/src-tauri/src/main.rs
  • internal/web/server.go
  • internal/web/tasks_test.go
  • web/src/App.tsx
  • web/src/components/CloudSyncToggle.tsx
  • web/src/components/DesktopTitlebar.test.tsx
  • web/src/components/DesktopTitlebar.tsx
  • web/src/components/TopBar.tsx
  • web/src/i18n/locales/en.ts
  • web/src/i18n/locales/ja.ts
  • web/src/i18n/locales/ko.ts
  • web/src/i18n/locales/zh-Hans.ts
  • web/src/i18n/locales/zh-Hant.ts
  • web/src/lib/api.ts
  • web/src/lib/useDesktop.test.ts
  • web/src/lib/useDesktop.ts

📝 Walkthrough

Walkthrough

Adds a macOS Desktop overlay titlebar with task details, cloud sync, and workspace application actions. Adds Tauri commands for macOS app discovery/opening, task-scoped workspace Git status resolution, local path validation, localization, and frontend tests.

Changes

Task Workspace Resolution

Layer / File(s) Summary
Task-scoped workspace lookup
internal/web/server.go, internal/web/tasks_test.go, web/src/lib/api.ts
Workspace requests accept task_id, resolve the task’s project path, run Git commands there, and verify the behavior across separate repositories.

Native Workspace Applications

Layer / File(s) Summary
macOS application discovery and opening
desktop/src-tauri/Cargo.toml, desktop/src-tauri/src/desktop_apps.rs, desktop/src-tauri/src/main.rs
Tauri exposes allowlisted application discovery and workspace-opening commands, including path scoping, Finder handling, icon conversion, non-macOS stubs, and unit tests.

Cloud Sync State

Layer / File(s) Summary
Session cloud-sync hook
web/src/components/CloudSyncToggle.tsx
Cloud-sync polling and toggling move into a guarded reusable hook with stale-response protection, optimistic updates, and in-flight request prevention.

macOS Desktop Titlebar

Layer / File(s) Summary
Titlebar, workspace menu, and shell integration
web/src/components/DesktopTitlebar.tsx, web/src/App.tsx, web/src/components/TopBar.tsx, web/src/lib/useDesktop.ts
The macOS shell renders task details, task actions, cloud status, workspace application discovery/opening, keyboard-accessible menus, and embedded top-bar controls.
Localization and interaction coverage
web/src/i18n/locales/*, web/src/components/DesktopTitlebar.test.tsx, web/src/lib/useDesktop.test.ts
Titlebar strings are added for supported locales, with tests covering task actions, application icons, menu navigation, rename failures, cloud-toggle concurrency, and local path validation.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TaskTitlebar
  participant WorkspaceAPI
  participant WebServer
  participant Git
  participant Tauri
  participant macOS
  TaskTitlebar->>WorkspaceAPI: request workspace(taskId)
  WorkspaceAPI->>WebServer: GET /api/workspace?task_id=taskId
  WebServer->>Git: run branch and status in task workspace
  Git-->>WebServer: branch and dirty state
  WebServer-->>TaskTitlebar: workspace metadata
  TaskTitlebar->>Tauri: discover or open workspace application
  Tauri->>macOS: resolve application or reveal workspace
  macOS-->>Tauri: application result
  Tauri-->>TaskTitlebar: discovery or open result
Loading

Possibly related PRs

  • cnjack/jcode#82: Shares the task-scoped workspace resolution flow across the server, API, and tests.
  • cnjack/jcode#165: Also modifies CloudSyncToggle.tsx, overlapping with this PR’s shared cloud-sync hook refactor.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/desktop-task-titlebar

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.

@cnjack
cnjack marked this pull request as ready for review July 30, 2026 16:13
@cnjack
cnjack merged commit 9ee212b into main Jul 30, 2026
3 of 4 checks passed
@cnjack
cnjack deleted the codex/desktop-task-titlebar branch July 30, 2026 16:13
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