Skip to content

feat(wework): collapse composer plugin picker to an icon in conversation - #2506

Merged
qdaxb merged 1 commit into
mainfrom
feature/wework-composer-plugin-collapse-in-conversation
Aug 8, 2026
Merged

feat(wework): collapse composer plugin picker to an icon in conversation#2506
qdaxb merged 1 commit into
mainfrom
feature/wework-composer-plugin-collapse-in-conversation

Conversation

@qdaxb

@qdaxb qdaxb commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

背景

进入对话后,composer 里的插件入口仍然以展开形式显示“插件”文字和最多 3 个插件预览图标(超出显示 +N),占据工具栏空间。需求是:默认状态保持展开不变,只有开始对话以后才收成一个图标。

改动

  • ComposerToolbar 新增 pluginPickerIconOnly 透传开关:进入对话(hasConversation)或临时对话面板时,把 PluginPickerMenu 收成单个 Puzzle 图标;默认(空启动台)仍保持“插件 + 预览图标”的展开形式。
  • 图标收起后,为 composer 里纯图标按钮补齐 hover tooltip(添加上下文、快捷短语、插件、发送/暂停回复),新增共享 Tooltip 组件(700ms 延迟,符合 DESIGN.md 6.6)。
  • 单元测试:PluginPickerMenu iconOnly 渲染、ComposerToolbar 对话后收起、Tooltip hover/Escape 行为。

影响

  • 用户:进入对话后工具栏更紧凑,插件入口变成图标,hover 可看到名称提示;默认首页行为不变。

验证

  • wework 相关单测全部通过。
  • 真实 Tauri 会话(ai-verify):默认空启动台保持“插件 + 预览图标 +N”;发送消息进入对话后按钮变为 28×28 图标且无预览列表;hover 插件图标显示“插件”tooltip。
  • pre-push:ESLint / TypeScript / 单测全部通过。

Summary by CodeRabbit

  • New Features

    • Added tooltips to chat composer controls, including context, plugins, quick phrases, pause, and send actions.
    • Added compact icon-only plugin picker support for desktop and temporary chat composers.
    • Tooltips now support accessible hover and keyboard interactions.
  • Tests

    • Added coverage for tooltip behavior and compact plugin picker presentation.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a reusable tooltip component for composer controls. Adds configurable icon-only plugin-picker rendering and forwards the setting through desktop and temporary chat composers. Adds tests for tooltip interactions and plugin-picker presentation.

Changes

Composer UI improvements

Layer / File(s) Summary
Tooltip component and interaction tests
wework/src/components/ui/tooltip.tsx, wework/src/components/ui/tooltip.test.tsx
Adds delayed, accessible tooltip rendering with placement options and dismissal handling. Tests cover hover, focus, pointer leave, and Escape behavior.
Composer control presentation
wework/src/components/chat/composer/ComposerToolbar.tsx, wework/src/components/chat/composer/PluginPickerMenu.tsx, wework/src/components/chat/composer/AddContextMenu.tsx, wework/src/components/chat/composer/QuickPhraseMenu.tsx, wework/src/components/chat/composer/*test.tsx
Adds localized tooltips to composer controls. Enables icon-only plugin-picker rendering through pluginPickerIconOnly and validates the compact presentation.
Composer prop propagation and layout wiring
wework/src/components/chat/ChatInput.tsx, wework/src/components/chat/composer/ProjectChatComposer.tsx, wework/src/components/layout/DesktopWorkbenchMain.tsx, wework/src/components/layout/workspace-panels/TemporaryChatPanel.tsx
Forwards pluginPickerIconOnly through the composer components. Enables icon-only plugin-picker rendering in desktop and temporary chat contexts.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DesktopWorkbenchMain
  participant ChatInput
  participant ProjectChatComposer
  participant ComposerToolbar
  participant PluginPickerMenu
  DesktopWorkbenchMain->>ChatInput: Set pluginPickerIconOnly
  ChatInput->>ProjectChatComposer: Forward pluginPickerIconOnly
  ProjectChatComposer->>ComposerToolbar: Forward pluginPickerIconOnly
  ComposerToolbar->>PluginPickerMenu: Enable iconOnly mode
  PluginPickerMenu-->>ComposerToolbar: Render compact plugin-picker trigger
Loading

Possibly related PRs

Suggested reviewers: micro66, luckjun529-lang

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: collapsing the WeWork composer plugin picker to an icon during conversations.
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.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/wework-composer-plugin-collapse-in-conversation

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.

@qdaxb
qdaxb marked this pull request as ready for review August 8, 2026 14:32
@qdaxb
qdaxb enabled auto-merge August 8, 2026 14:32

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@wework/src/components/ui/tooltip.tsx`:
- Around line 69-74: Update the tooltip popup className in
wework/src/components/ui/tooltip.tsx lines 69-74 to toggle pointer-events-auto
when visible while retaining pointer-events-none when hidden. Add or update the
visible-tooltip assertion in wework/src/components/ui/tooltip.test.tsx lines
14-37 to verify pointer events are enabled.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 49d63cdb-abb2-44bb-9945-a345d367b51e

📥 Commits

Reviewing files that changed from the base of the PR and between 211cc13 and 4b0c58d.

📒 Files selected for processing (12)
  • wework/src/components/chat/ChatInput.tsx
  • wework/src/components/chat/composer/AddContextMenu.tsx
  • wework/src/components/chat/composer/ComposerToolbar.test.tsx
  • wework/src/components/chat/composer/ComposerToolbar.tsx
  • wework/src/components/chat/composer/PluginPickerMenu.test.tsx
  • wework/src/components/chat/composer/PluginPickerMenu.tsx
  • wework/src/components/chat/composer/ProjectChatComposer.tsx
  • wework/src/components/chat/composer/QuickPhraseMenu.tsx
  • wework/src/components/layout/DesktopWorkbenchMain.tsx
  • wework/src/components/layout/workspace-panels/TemporaryChatPanel.tsx
  • wework/src/components/ui/tooltip.test.tsx
  • wework/src/components/ui/tooltip.tsx

Comment on lines +69 to +74
className={cn(
'pointer-events-none absolute z-system-popover max-w-[20rem] whitespace-nowrap rounded-lg border border-border/70 bg-popover/95 px-2 py-1 text-sm leading-5 text-text-primary shadow-[0_10px_28px_rgba(0,0,0,0.18)] backdrop-blur-md transition-opacity duration-100',
visible ? 'opacity-100' : 'opacity-0',
sidePosition[side],
alignPosition[align]
)}

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep visible tooltips hoverable.

Line 70 disables pointer events for the popup. When the popup is outside the trigger bounds, moving the pointer onto it dismisses the tooltip through onPointerLeave. Enable pointer events only while the popup is visible.

  • wework/src/components/ui/tooltip.tsx#L69-L74: Toggle pointer-events-auto with visible state.
  • wework/src/components/ui/tooltip.test.tsx#L14-L37: Assert that a visible tooltip enables pointer events.
Proposed fix
-          visible ? 'opacity-100' : 'opacity-0',
+          visible ? 'pointer-events-auto opacity-100' : 'pointer-events-none opacity-0',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
className={cn(
'pointer-events-none absolute z-system-popover max-w-[20rem] whitespace-nowrap rounded-lg border border-border/70 bg-popover/95 px-2 py-1 text-sm leading-5 text-text-primary shadow-[0_10px_28px_rgba(0,0,0,0.18)] backdrop-blur-md transition-opacity duration-100',
visible ? 'opacity-100' : 'opacity-0',
sidePosition[side],
alignPosition[align]
)}
className={cn(
'pointer-events-none absolute z-system-popover max-w-[20rem] whitespace-nowrap rounded-lg border border-border/70 bg-popover/95 px-2 py-1 text-sm leading-5 text-text-primary shadow-[0_10px_28px_rgba(0,0,0,0.18)] backdrop-blur-md transition-opacity duration-100',
visible ? 'pointer-events-auto opacity-100' : 'pointer-events-none opacity-0',
sidePosition[side],
alignPosition[align]
)}
📍 Affects 2 files
  • wework/src/components/ui/tooltip.tsx#L69-L74 (this comment)
  • wework/src/components/ui/tooltip.test.tsx#L14-L37
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wework/src/components/ui/tooltip.tsx` around lines 69 - 74, Update the
tooltip popup className in wework/src/components/ui/tooltip.tsx lines 69-74 to
toggle pointer-events-auto when visible while retaining pointer-events-none when
hidden. Add or update the visible-tooltip assertion in
wework/src/components/ui/tooltip.test.tsx lines 14-37 to verify pointer events
are enabled.

@qdaxb
qdaxb added this pull request to the merge queue Aug 8, 2026
Merged via the queue into main with commit c168977 Aug 8, 2026
72 of 74 checks passed
@qdaxb
qdaxb deleted the feature/wework-composer-plugin-collapse-in-conversation branch August 8, 2026 14:58
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