Skip to content

fix(wework): overlay mode pill cancel icon - #1892

Merged
qdaxb merged 1 commit into
mainfrom
fix/wework-mode-pill-icons
Jul 11, 2026
Merged

qdaxb merged 1 commit into
mainfrom
fix/wework-mode-pill-icons

Conversation

@qdaxb

@qdaxb qdaxb commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add semantic icons to the plan-mode and goal-draft composer pills.
  • Overlay the hover-only cancel button on the left icon so the label does not shift.
  • Document the shared mode-pill behavior for desktop and compact layouts.

Root cause

The cancel affordance expanded within the pill, placing it next to the new mode icon and changing the pill width on hover.

Validation

  • pnpm exec vitest run src/components/chat/ChatInput.test.tsx
  • pnpm typecheck
  • Pre-push ESLint, TypeScript, and Wework unit tests

Summary by CodeRabbit

  • New Features

    • Added clear visual icons for plan mode and goal-draft mode in the chat composer.
    • Improved cancel-button behavior with hover-based icon transitions and consistent positioning.
    • Preserved composer pill dimensions to prevent layout shifts across desktop and compact layouts.
  • Documentation

    • Documented composer mode indicator behavior in English and Chinese developer guides.
  • Tests

    • Updated composer UI tests to validate icon sizing, positioning, and hover interactions.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Composer mode pills now display semantic icons for plan and goal-draft modes. Cancel controls use absolute positioning and hover visibility, with tests and English/Chinese documentation updated accordingly.

Changes

Composer mode indicators

Layer / File(s) Summary
Pill icon and cancel rendering
wework/src/components/chat/composer/GoalDraftPill.tsx
ComposerModePill accepts optional Lucide icons, renders them, and updates cancel-button positioning and hover styling. GoalDraftPill supplies the Target icon.
Composer wiring and UI validation
wework/src/components/chat/composer/ComposerToolbar.tsx, wework/src/components/chat/composer/CompactChatComposer.tsx, wework/src/components/chat/ChatInput.test.tsx, docs/*/developer-guide/wework-chat-state-sources.md
Plan-mode composers supply the ClipboardList icon; tests and documentation cover icon sizing, hover behavior, absolute positioning, and layout stability.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 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 matches the main UI change: overlaying the mode pill's cancel control to avoid layout shifts.
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
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/wework-mode-pill-icons

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 July 11, 2026 04:28
@qdaxb
qdaxb merged commit c7ede9b into main Jul 11, 2026
12 of 13 checks passed
@qdaxb
qdaxb deleted the fix/wework-mode-pill-icons branch July 11, 2026 04:30

@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: 2

🤖 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/chat/composer/GoalDraftPill.tsx`:
- Line 85: The cancel icon button in GoalDraftPill uses the nonstandard h-5 w-5
size; update its sizing to the required h-8 w-8 compact icon-button dimensions,
or add an explicit documented exception if the h-7 pill layout cannot
accommodate it.
- Line 85: Update the cancel button styling in GoalDraftPill so it is reachable
without hover: use compact h-8 w-8 icon-button sizing, and make it visible on
keyboard focus and non-hover/touch devices while preserving hover behavior and
disabled styling. Ensure it is not an invisible tab stop when hidden.
🪄 Autofix (Beta)

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

Run ID: e2170982-5812-40e9-a63c-3e7331e87b02

📥 Commits

Reviewing files that changed from the base of the PR and between f407ab1 and 395d109.

📒 Files selected for processing (6)
  • docs/en/developer-guide/wework-chat-state-sources.md
  • docs/zh/developer-guide/wework-chat-state-sources.md
  • wework/src/components/chat/ChatInput.test.tsx
  • wework/src/components/chat/composer/CompactChatComposer.tsx
  • wework/src/components/chat/composer/ComposerToolbar.tsx
  • wework/src/components/chat/composer/GoalDraftPill.tsx

}}
disabled={disabled}
className="pointer-events-none flex h-5 w-0 items-center justify-center overflow-hidden rounded-full bg-text-muted/15 text-text-muted opacity-0 transition-[width,margin,opacity,background-color,color] group-hover:pointer-events-auto group-hover:mr-1.5 group-hover:w-5 group-hover:bg-text-muted/15 group-hover:opacity-100 hover:bg-text-muted/30 hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-0"
className="pointer-events-none absolute left-2 flex h-5 w-5 items-center justify-center rounded-full bg-text-muted/15 text-text-muted opacity-0 transition-[opacity,background-color,color] group-hover:pointer-events-auto group-hover:opacity-100 hover:bg-text-muted/30 hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-0"

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use the required compact icon-button size or document an exception.

The cancel button uses h-5 w-5, which conflicts with the Wework control sizing rule requiring icon-only buttons to use h-8 w-8. If the pill’s h-7 layout requires the smaller control, document that exception explicitly.

As per coding guidelines: “Wework desktop workbench controls must use the compact sizing system: buttons h-8, icon-only buttons h-8 w-8.”

🤖 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/chat/composer/GoalDraftPill.tsx` at line 85, The cancel
icon button in GoalDraftPill uses the nonstandard h-5 w-5 size; update its
sizing to the required h-8 w-8 compact icon-button dimensions, or add an
explicit documented exception if the h-7 pill layout cannot accommodate it.

Source: Coding guidelines


🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the target file and nearby context
wc -l wework/src/components/chat/composer/GoalDraftPill.tsx
sed -n '1,220p' wework/src/components/chat/composer/GoalDraftPill.tsx

# Find where this component is used
rg -n "GoalDraftPill|ComposerModePill|CompactChatComposer" wework/src/components wework/src -g '*.ts' -g '*.tsx'

# Inspect the compact composer files mentioned by the review comment
fd -a "CompactChatComposer.tsx|ComposerModePill.tsx|GoalDraftPill.tsx" wework/src

Repository: wecode-ai/Wegent

Length of output: 7500


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sed -n '1,260p' wework/src/components/chat/composer/CompactChatComposer.tsx
printf '\n----\n'
sed -n '1,180p' wework/src/components/chat/composer/ComposerToolbar.tsx
printf '\n----\n'
rg -n "cancel-goal-draft-button|onCancelGoalDraft|cancel_goal_draft|workbench.cancel_mode" wework/src -g '*.ts' -g '*.tsx'

Repository: wecode-ai/Wegent

Length of output: 15863


Make the cancel control reachable without hover.

This shared pill is used in the compact composer, so the cancel button can’t be used on touch devices and becomes an invisible tab stop on keyboard because it only appears on group-hover. Reveal it on focus/non-hover devices, and use the required compact h-8 w-8 icon-button sizing instead of h-5 w-5.

🤖 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/chat/composer/GoalDraftPill.tsx` at line 85, Update the
cancel button styling in GoalDraftPill so it is reachable without hover: use
compact h-8 w-8 icon-button sizing, and make it visible on keyboard focus and
non-hover/touch devices while preserving hover behavior and disabled styling.
Ensure it is not an invisible tab stop when hidden.

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