Commit 6d8e8de
fix(desktop): restore add-menu tooltip behavior and labels (#156)
## 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.
---------
Signed-off-by: Lyon Liang <lyon.liang12@gmail.com>
Co-authored-by: Lyon Liang <lyon.liang12@gmail.com>1 parent 4391788 commit 6d8e8de
5 files changed
Lines changed: 13 additions & 6 deletions
File tree
- apps/desktop/src/renderer/src
- packages
- i18n/src/locales
- ui/src/components
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
130 | 133 | | |
131 | 134 | | |
132 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
130 | 133 | | |
131 | 134 | | |
132 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | | - | |
| 171 | + | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
0 commit comments