Skip to content

fix(web): target icon for Goal, working new-task shortcut, ⌘J terminal alias - #146

Merged
cnjack merged 1 commit into
mainfrom
feat/goal-target-icon-shortcut-fixes
Jul 17, 2026
Merged

fix(web): target icon for Goal, working new-task shortcut, ⌘J terminal alias#146
cnjack merged 1 commit into
mainfrom
feat/goal-target-icon-shortcut-fixes

Conversation

@cnjack

@cnjack cnjack commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Goal 图标 → 靶心

BoltIcon(闪电)→ ViewfinderCircleIcon(准星 / 靶心),覆盖 GoalBanner 活跃目标横幅与 ChatInput 的 Goal 菜单项 + armed 状态 chip。设置页里的闪电用于小模型 / BLE / MCP,与 Goal 无关,未动。

新建任务快捷键根本没生效

双重 bug

  1. 处理器本身是坏的——⌘N 调用 loadSession(''),空 uuid 使 thunk 在 api.session('') 处提前 return,注释里写的 "handled in Sidebar" 实际从未实现。
  2. ⌘N 在浏览器里被系统保留(新开窗口),页面无法拦截。

修复:抽出共享 thunk startNewChat(清空 timeline → 切到 chat 视图 → 分配新 session id),Sidebar 的「新建任务」按钮也改用它:

快捷键 状态 说明
⇧⌘O 新建任务 ✅ 新增 浏览器 / desktop 都可用(ChatGPT 同款),UI 显示的快捷键
⌘N 新建任务 ✅ 修复 desktop 别名(Tauri 无原生菜单拦截),浏览器里保留给系统
⌘J 终端面板 ✅ 新增 ⌘\`` 在 macOS 被系统窗口切换吃掉;⌘J 为 VS Code 风格别名,带 !shiftKey` 守卫不影响 ⇧⌘J DevTools

测试

  • tsc --noEmit 通过
  • make build-web 通过
  • 手动验证:Sidebar 新建按钮 ⇧⌘O 提示,⌘J 切终端,Goal 横幅 / 菜单显示靶心

…l alias

Goal icon
- Replace BoltIcon with ViewfinderCircleIcon (crosshair / target) in the
  GoalBanner and the ChatInput Goal menu item + armed chip. The bolt icon
  is kept for non-Goal settings rows (small model, BLE, MCP).

New-task shortcut was broken
- ⌘N dispatched loadSession(''), whose thunk short-circuited on the empty
  uuid (the "handled in Sidebar" comment was aspirational — nothing there
  handled it), so the shortcut did nothing. Extract a shared startNewChat
  thunk (clear timeline → switch to chat view → allocate a fresh session id)
  and wire both ⌘N (desktop, where Tauri has no native menu to eat it) and
  ⇧⌘O (browser, where ⌘N is reserved by the OS) to it. Sidebar's "new task"
  button calls the same thunk; the displayed hint becomes ⇧⌘O.

Terminal shortcut was unreachable on macOS
- ⌘` is eaten by macOS window cycling and never reaches the page. Add ⌘J as
  an alias (with !shiftKey so ⇧⌘J DevTools stays intact) and surface it in
  the settings shortcuts list. ⌘` stays as an additional trigger where it
  does fire.
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@cnjack, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 41 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 353586b5-1867-4e41-964b-2c4180b68cec

📥 Commits

Reviewing files that changed from the base of the PR and between c2a3e49 and 812b0e6.

📒 Files selected for processing (6)
  • web/src/App.tsx
  • web/src/app/store.ts
  • web/src/components/ChatInput.tsx
  • web/src/components/GoalBanner.tsx
  • web/src/components/SettingsDialog.tsx
  • web/src/components/Sidebar.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/goal-target-icon-shortcut-fixes

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 merged commit 0b2d53c into main Jul 17, 2026
3 checks passed
@cnjack
cnjack deleted the feat/goal-target-icon-shortcut-fixes branch July 17, 2026 01:02
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