Skip to content

fix(desktop): restore add-menu tooltip behavior and labels#156

Merged
Sun-sunshine06 merged 3 commits intoOpenCoworkAI:mainfrom
1WorldCapture:fix/tooltip-and-i18n
Apr 22, 2026
Merged

fix(desktop): restore add-menu tooltip behavior and labels#156
Sun-sunshine06 merged 3 commits intoOpenCoworkAI:mainfrom
1WorldCapture:fix/tooltip-and-i18n

Conversation

@1WorldCapture
Copy link
Copy Markdown
Contributor

@1WorldCapture 1WorldCapture commented Apr 22, 2026

Summary

This PR fixes the add-menu tooltip in the desktop composer.

It does three things:

  • restores tooltip hover/focus behavior without leaking hover state from the outer composer container
  • ensures the desktop renderer emits the shared tooltip's Tailwind classes by explicitly sourcing packages/ui/src
  • adds the missing localized tooltip labels for the add-menu trigger in both en and zh-CN

Problem

From the user’s perspective, the bug showed up in two ways:

  • moving the mouse over the prompt input area incorrectly triggered the add-menu tooltip even when the + trigger itself was not being hovered
  • when the tooltip appeared, it was visually broken: it looked like a white floating block and the text was not readable

How to Reproduce

  1. Create a new design.
  2. Move the mouse over the prompt input area in the lower-left composer.
  3. Observe that the add-menu tooltip is triggered even though the pointer is not on the + trigger.

Root Cause

The add-menu tooltip regressed for two separate reasons:

  1. The shared Tooltip component stopped using an isolated hover scope, which made the composer and tooltip hover behavior interfere with each other.
  2. The desktop renderer's Tailwind source detection was not scanning packages/ui/src, so the shared tooltip's named group variants were not emitted into the app CSS.
  3. The sidebar.chat.addMenu.trigger translation key was missing, so the add-menu trigger had no proper user-facing tooltip label.

What Changed

Tooltip behavior

  • switched the shared Tooltip component back to named Tailwind groups via group/tooltip
  • restored the corresponding hover/focus visibility classes:
    • group-hover/tooltip:opacity-100
    • group-focus-within/tooltip:opacity-100
    • group-focus/tooltip:opacity-100
  • updated the shared tooltip test assertions to match the named-group implementation

Tailwind source detection

  • added an explicit Tailwind @source entry in the desktop renderer CSS so the renderer build scans packages/ui/src
  • this ensures shared UI component classnames are included in the generated desktop CSS

i18n

  • added sidebar.chat.addMenu.trigger in en
  • added sidebar.chat.addMenu.trigger in zh-CN

DCO

  • added a signed-off follow-up commit so the current DCO workflow passes without rewriting the earlier fix commits

User Impact

  • hovering the + add-menu trigger shows a tooltip again
  • hovering the prompt textarea no longer causes tooltip leakage from the nested add-menu control
  • the tooltip now has proper localized text instead of relying on a missing translation key

Validation

  • turbo run test via the repository commit hook
  • pnpm --filter @open-codesign/ui test -- Tooltip
  • pre-push workspace checks:
    • typecheck
    • lint

Principles §5b

  • Compatibility: ✅ No schema, storage, or IPC contract changes.
  • Upgradeability: ✅ Localized UI-only fix with no migration risk.
  • No bloat: ✅ No new dependencies or runtime subsystems.
  • Elegance: ✅ Uses scoped Tailwind groups and explicit source detection instead of extra JS or ad-hoc DOM workarounds.

@github-actions github-actions Bot added area:desktop apps/desktop (Electron shell, renderer) area:ui packages/ui (design system) labels Apr 22, 2026
@1WorldCapture 1WorldCapture marked this pull request as ready for review April 22, 2026 12:22
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings

  • None.

Summary

  • Review mode: initial
  • No high-confidence issues found on added/modified lines in the latest diff.
  • Residual risk/testing gap: runtime validation was not executed in this environment because pnpm is unavailable; review is based on static diff and source inspection only.
  • docs/VISION.md and docs/PRINCIPLES.md: Not found in repo/docs for this workspace, so hard-constraint cross-checks used CLAUDE.md and changed files only.

Testing

  • Not run (automation): pnpm not available in this runner. Suggested: pnpm --filter @open-codesign/ui test -- Tooltip and desktop smoke to verify tooltip styling in renderer build.

open-codesign Bot

Copy link
Copy Markdown
Collaborator

@Sun-sunshine06 Sun-sunshine06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed locally: tooltip scoped-group fix, Tailwind @source inclusion, and i18n additions look correct. Tooltip tests pass and desktop typecheck passes.

@Sun-sunshine06 Sun-sunshine06 merged commit 6d8e8de into OpenCoworkAI:main Apr 22, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:desktop apps/desktop (Electron shell, renderer) area:ui packages/ui (design system)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants