Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
fix(ui): show shortcuts in chat tooltips
vastsaef5492339db9
diff --git a/apps/desktop/src/components/ConversationTopbar.tsx b/apps/desktop/src/components/ConversationTopbar.tsxindex 7790abaed..3720928c7 100644--- a/apps/desktop/src/components/ConversationTopbar.tsx+++ b/apps/desktop/src/components/ConversationTopbar.tsx@@ -1,3 +1,9 @@+import {+ KEYBOARD_SHORTCUTS,+ keybindingDisplayParts,+ resolveKeybinding,+ type ShortcutPlatform,+} from "@pi-desktop/shared";import { useTranslation } from "react-i18next";import { useAppStore } from "../stores/app-store";import {@@ -37,6 +43,40 @@ export function ConversationTopbar({const activeSessionId = useAppStore((s) => s.activeSessionId);const sessions = useAppStore((s) => s.sessions);const workspace = useAppStore((s) => s.workspace);+ const keybindings = useAppStore((s) => s.settings?.keybindings);+ const platform = (+ typeof window === "undefined" ? "darwin" : window.piDesktop?.platform ?? "darwin"+ ) as ShortcutPlatform;+ const newTaskShortcut = KEYBOARD_SHORTCUTS.find(+ (shortcut) => shortcut.id === "newTask",+ );+ const searchShortcut = KEYBOARD_SHORTCUTS.find(+ (shortcut) => shortcut.id === "openSearch",+ );+ const newTaskBinding = newTaskShortcut+ ? resolveKeybinding(newTaskShortcut, keybindings, platform)+ : null;+ const searchBinding = searchShortcut+ ? resolveKeybinding(searchShortcut, keybindings, platform)+ : null;+ const newTaskShortcutLabel = keybindingDisplayParts(newTaskBinding, platform).join(+ platform === "darwin" ? "" : "+",+ );+ const searchShortcutLabel = keybindingDisplayParts(searchBinding, platform).join(+ platform === "darwin" ? "" : "+",+ );+ const newTaskTooltip = newTaskShortcutLabel+ ? t("nav.actionWithShortcut", {+ action: t("nav.newTask"),+ shortcut: newTaskShortcutLabel,+ })+ : t("nav.newTask");+ const searchTooltip = searchShortcutLabel+ ? t("nav.actionWithShortcut", {+ action: t("nav.search"),+ shortcut: searchShortcutLabel,+ })+ : t("nav.search");const activeSession = sessions.find((session) => session.id === activeSessionId);@@ -84,7 +124,7 @@ export function ConversationTopbar({<TooltipButtontype="button"className="ct-icon-btn"- tooltip={t("nav.newTask")}+ tooltip={newTaskTooltip}ariaLabel={t("nav.newTask")}onClick={onNewTask}>@@ -93,7 +133,7 @@ export function ConversationTopbar({<TooltipButtontype="button"className="ct-icon-btn"- tooltip={t("nav.search")}+ tooltip={searchTooltip}ariaLabel={t("nav.search")}onClick={onOpenSearch}>diff --git a/apps/desktop/test/icon-tooltip.test.mjs b/apps/desktop/test/icon-tooltip.test.mjsindex b6ca5f56d..852712b6a 100644--- a/apps/desktop/test/icon-tooltip.test.mjs+++ b/apps/desktop/test/icon-tooltip.test.mjs@@ -54,6 +54,21 @@ test("icon-only actions expose localized hover tooltips", () => {assert.match(uiSource, /onClick=\{\(event\) => \{[\s\S]*?tooltip\.dismiss\(\)/);});+test("conversation topbar tooltips reflect configured shortcuts", () => {+ const topbarSource = source("components/ConversationTopbar.tsx");+ assert.match(topbarSource, /settings\?\.keybindings/);+ assert.match(topbarSource, /resolveKeybinding\(newTaskShortcut, keybindings, platform\)/);+ assert.match(topbarSource, /resolveKeybinding\(searchShortcut, keybindings, platform\)/);+ assert.match(topbarSource, /keybindingDisplayParts\(newTaskBinding, platform\)/);+ assert.match(topbarSource, /keybindingDisplayParts\(searchBinding, platform\)/);+ assert.match(topbarSource, /newTaskTooltip = newTaskShortcutLabel[\s\S]*?t\("nav\.actionWithShortcut"[\s\S]*?: t\("nav\.newTask"\)/);+ assert.match(topbarSource, /searchTooltip = searchShortcutLabel[\s\S]*?t\("nav\.actionWithShortcut"[\s\S]*?: t\("nav\.search"\)/);+ assert.match(topbarSource, /tooltip=\{newTaskTooltip\}/);+ assert.match(topbarSource, /tooltip=\{searchTooltip\}/);+ assert.match(topbarSource, /ariaLabel=\{t\("nav\.newTask"\)\}/);+ assert.match(topbarSource, /ariaLabel=\{t\("nav\.search"\)\}/);+});+// A tooltip that survives its trigger is the reported "sometimes it never goes// away" failure: the anchor unmounts (a row leaves the list, a menu closes),// the window loses focus, or the pointer leaves the window without a matchingdiff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.mdindex a850e10d8..5506cdfec 100644--- a/docs/spec/04-ux/08-component-spec.md+++ b/docs/spec/04-ux/08-component-spec.md@@ -242,6 +242,11 @@ expanded it owns that control, so the top bar does not duplicate it. Thedoes not duplicate it. Keyboard shortcuts and the application menu remainavailable.)+The conversation-topbar New task and Search tooltips append the effective,+platform-formatted shortcut. A custom binding replaces the default; an+explicitly unbound shortcut is omitted. The accessible name remains the+localized action label.+The conversation top bar renders for the chat route only; Scheduled, Plugins,and Settings keep the frameless drag band. It owns the task title andwindow actions only. Project scope remains in the title tooltip instead of addingdiff --git a/docs/spec/04-ux/09-interaction-patterns.md b/docs/spec/04-ux/09-interaction-patterns.mdindex 096b8543c..405ef864e 100644--- a/docs/spec/04-ux/09-interaction-patterns.md+++ b/docs/spec/04-ux/09-interaction-patterns.md@@ -1046,6 +1046,10 @@ Running turns and pending approvals continue to gate the controls.- Decorative icons remain `aria-hidden` and do not need a tooltip.- Tooltip text must describe the action, not the icon shape, and must come fromthe active i18n catalog.+- The conversation-topbar New task and Search tooltips append the effective,+ platform-formatted binding (user override or default). Explicitly unbound+ shortcuts are omitted; their accessible names remain the localized action+ labels.- Clicking an action dismisses its tooltip immediately and suppresses it untilthe pointer leaves or focus moves away; keyboard focus still reveals thetooltip before activation.diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.mdindex c17af702f..481c70e27 100644--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@ -1776,10 +1776,11 @@ identify the platform validation still needed.- **Preconditions**: Provider configured; at least one session exists.- **Steps**: 1) Open the chat route. 2) Inspect the 46px bar at the top of theconversation area. 3) Confirm it shows the concise session/task title and the- New task / Search action buttons; confirm the- sidebar toggle appears **only when the sidebar is collapsed** (when expanded,- the sidebar owns that control). 4) Switch to the Scheduled,- Plugins, or Settings routes and inspect the same top region.+ New task / Search buttons; hover or focus each and inspect its tooltip. Confirm+ the sidebar toggle appears **only when collapsed**. 4) Customize each shortcut+ in Settings → Shortcuts and confirm the tooltip updates; disable each binding+ and confirm its shortcut is omitted. 5) Switch to Scheduled, Plugins, or+ Settings and inspect the same top region.- **Expected**: Every route-owned top region uses the same `--ds-toolbar-height`(46px), bg-primary surface, and bottom border; Windows/Linux reserve thesame 120px native-control band at the right. On the chat route the@@ -1791,12 +1792,14 @@ identify the platform validation still needed.with an ellipsis only on overflow. Check an English title longer than 10characters in wide and narrow layouts, with the sidebar expanded/collapsedand the work panel open/closed; titles must not overlap the action buttons.- The complete title and project scope remain available through its tooltip. The sidebar- toggle is present only in the collapsed state (no- duplicate of the sidebar's control). On every other route the frameless drag- band renders instead (no chat top-bar controls) while retaining the same- surface and alignment. The bar is draggable to move the window; interactive- controls do not start a window drag.+ The complete title and project scope remain available through its tooltip.+ New task and Search tooltips show their effective platform-formatted+ shortcuts, including custom bindings; an explicitly unbound shortcut is+ omitted, while the accessible name remains the localized action. The sidebar+ toggle is present only when collapsed (no duplicate of the sidebar's control).+ On every other route the frameless drag band renders instead (no chat top-bar+ controls) while retaining the same surface and alignment. The bar is draggable+ to move the window; interactive controls do not start a window drag.macOS leaves the left 88px clear for traffic lights only while the sidebar iscollapsed (8px in fullscreen); Windows/Linux leave the right 120px clear fornative window controls.diff --git a/packages/i18n/src/locales/de/index.ts b/packages/i18n/src/locales/de/index.tsindex 54493e530..cb867c419 100644--- a/packages/i18n/src/locales/de/index.ts+++ b/packages/i18n/src/locales/de/index.ts@@ -137,6 +137,7 @@ export const de = {"checkForUpdates": "Auf Updates prüfen","buildUnknown": "Version unbekannt","search": "Suche",+ "actionWithShortcut": "{{action}} ({{shortcut}})","temporarySessions": "Temporäre Chats","newTemporarySession": "Neuer temporärer Chat","noProjectSessions": "Nr Chats in diesem Projekt bisher",diff --git a/packages/i18n/src/locales/en/index.ts b/packages/i18n/src/locales/en/index.tsindex 831adb203..bdaf1bc7d 100644--- a/packages/i18n/src/locales/en/index.ts+++ b/packages/i18n/src/locales/en/index.ts@@ -144,6 +144,7 @@ export const en = {checkForUpdates: "Check for updates",buildUnknown: "Version unknown",search: "Search",+ actionWithShortcut: "{{action}} ({{shortcut}})",temporarySessions: "Temporary chats",newTemporarySession: "New temporary chat",noProjectSessions: "No chats in this project yet",diff --git a/packages/i18n/src/locales/es/index.ts b/packages/i18n/src/locales/es/index.tsindex c2bc34fc7..7d9acfe17 100644--- a/packages/i18n/src/locales/es/index.ts+++ b/packages/i18n/src/locales/es/index.ts@@ -137,6 +137,7 @@ export const es = {"checkForUpdates": "Buscar actualizaciones","buildUnknown": "Versión desconocida","search": "Buscar",+ "actionWithShortcut": "{{action}} ({{shortcut}})","temporarySessions": "Chats temporales","newTemporarySession": "Nuevo chat temporal","noProjectSessions": "No chats en este proyecto todavía",diff --git a/packages/i18n/src/locales/fr/index.ts b/packages/i18n/src/locales/fr/index.tsindex 73c347158..724e751a3 100644--- a/packages/i18n/src/locales/fr/index.ts+++ b/packages/i18n/src/locales/fr/index.ts@@ -137,6 +137,7 @@ export const fr = {"checkForUpdates": "Vérifier les mises à jour","buildUnknown": "Version inconnue","search": "Recherche",+ "actionWithShortcut": "{{action}} ({{shortcut}})","temporarySessions": "Chats temporaires","newTemporarySession": "Nouveau chat temporaire","noProjectSessions": "Aucun chat dans ce domaine projet pour l'instant",diff --git a/packages/i18n/src/locales/ko/index.ts b/packages/i18n/src/locales/ko/index.tsindex 1969fbec4..f4d96e985 100644--- a/packages/i18n/src/locales/ko/index.ts+++ b/packages/i18n/src/locales/ko/index.ts@@ -146,6 +146,7 @@ export const ko = {checkForUpdates: "업데이트 확인",buildUnknown: "버전 알 수 없음",search: "검색",+ actionWithShortcut: "{{action}} ({{shortcut}})",temporarySessions: "임시 대화",newTemporarySession: "새 임시 채팅",noProjectSessions: "이 프로젝트에 채팅이 아직 없습니다",diff --git a/packages/i18n/src/locales/pt-BR/index.ts b/packages/i18n/src/locales/pt-BR/index.tsindex e6334b7ed..452502bb8 100644--- a/packages/i18n/src/locales/pt-BR/index.ts+++ b/packages/i18n/src/locales/pt-BR/index.ts@@ -136,6 +136,7 @@ export const ptBR = {checkForUpdates: "Verificar atualizações",buildUnknown: "Versão desconhecida",search: "Pesquisar",+ actionWithShortcut: "{{action}} ({{shortcut}})",temporarySessions: "Conversas temporárias",newTemporarySession: "Nova conversa temporária",noProjectSessions: "Nenhuma conversa neste projeto ainda",diff --git a/packages/i18n/src/locales/tr/index.ts b/packages/i18n/src/locales/tr/index.tsindex 2b4973c67..35f54ab25 100644--- a/packages/i18n/src/locales/tr/index.ts+++ b/packages/i18n/src/locales/tr/index.ts@@ -146,6 +146,7 @@ export const tr = {checkForUpdates: "Güncellemeleri denetle",buildUnknown: "Sürüm bilinmiyor",search: "Ara",+ "actionWithShortcut": "{{action}} ({{shortcut}})",temporarySessions: "Geçici sohbetler",newTemporarySession: "Yeni geçici sohbet",noProjectSessions: "Bu projede henüz sohbet yok",diff --git a/packages/i18n/src/locales/zh-CN/index.ts b/packages/i18n/src/locales/zh-CN/index.tsindex d790cc9c5..ec16c49a1 100644--- a/packages/i18n/src/locales/zh-CN/index.ts+++ b/packages/i18n/src/locales/zh-CN/index.ts@@ -139,6 +139,7 @@ export const zhCN = {checkForUpdates: "检查更新",buildUnknown: "版本未知",search: "搜索",+ actionWithShortcut: "{{action}}({{shortcut}})",temporarySessions: "临时对话",newTemporarySession: "新建临时对话",noProjectSessions: "当前项目还没有对话",diff --git a/packages/i18n/src/locales/zh-TW/index.ts b/packages/i18n/src/locales/zh-TW/index.tsindex 02637ef3a..b3b055ddb 100644--- a/packages/i18n/src/locales/zh-TW/index.ts+++ b/packages/i18n/src/locales/zh-TW/index.ts@@ -139,6 +139,7 @@ export const zhTW = {checkForUpdates: "檢查更新",buildUnknown: "版本未知",search: "搜尋",+ actionWithShortcut: "{{action}}({{shortcut}})",temporarySessions: "臨時對話",newTemporarySession: "新建臨時對話",noProjectSessions: "當前專案還沒有對話",