Skip to content

🀯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

πŸ› fix(desktop): keep lone tab title stable on hover (#18188)

Inneia3b430e113f8
diff --git a/.agents/skills/deep-review/references/dimensions/logic.md b/.agents/skills/deep-review/references/dimensions/logic.md
index 514d75080be..55f49c4b3e1 100644
--- a/.agents/skills/deep-review/references/dimensions/logic.md
+++ b/.agents/skills/deep-review/references/dimensions/logic.md
@@ -17,7 +17,7 @@ Does the change do what the requirement asked, and does it hold up under real in
- Error handling: failure paths that leave state half-mutated or the UI stuck
- State machines: unreachable/unhandled states after this change
- Requirement deviation: the diff contradicts the stated need, acceptance criteria, or key decisions recorded in the PR/issue/conversation. Report even when the code is internally correct β€” the reviewer cannot tell a legitimate mid-implementation adjustment from a forgotten decision (context loss, compaction), so the fix is always two-option: align the implementation with the recorded decision, or update the record to state why the decision changed
-- Bug fixes ship a regression test covering the fixed scenario; new services / store actions / utilities have test coverage; new database Model/Repository ships a sibling `__tests__/<name>.test.ts` incl. user isolation (see `.agents/skills/testing/`)
+- Bug fixes ship a regression test covering the fixed scenario (skip pure style/CSS fixes whose only practical assertion is stylesheet source-string matching β€” see `.agents/skills/testing/`); new services / store actions / utilities have test coverage; new database Model/Repository ships a sibling `__tests__/<name>.test.ts` incl. user isolation
## Rule sources (deep mode: read before reviewing)
@@ -36,7 +36,7 @@ Does the change do what the requirement asked, and does it hold up under real in
- A concrete input/state sequence produces a wrong result, crash, stuck UI, or half-committed state.
- The change silently narrows/broadens behavior versus the requirement.
-- A bug fix without a test that would have caught the original bug.
+- A bug fix without a test that would have caught the original bug (except pure style/CSS fixes per the testing skill).
## Not violations
diff --git a/.agents/skills/testing/SKILL.md b/.agents/skills/testing/SKILL.md
index eaaa71ee028..1f320fd367a 100644
--- a/.agents/skills/testing/SKILL.md
+++ b/.agents/skills/testing/SKILL.md
@@ -43,7 +43,7 @@ cd packages/database && TEST_SERVER_DB=1 bunx vitest run --silent='passed-only'
2. **Tests must pass type check** - Run `bun run type-check` after writing tests
3. **After 1-2 failed fix attempts, stop and ask for help**
4. **Test behavior, not implementation details**
-5. **Regression tests for bug fixes** - After fixing a bug, add a regression test that fails before the fix and passes after, to prevent recurrence
+5. **Regression tests for bug fixes** - After fixing a bug, add a regression test that fails before the fix and passes after, to prevent recurrence. **Skip** pure style/CSS fixes (selector, hover, mask, spacing, color) when the only practical assertion would be source-string matching on the stylesheet β€” that is not a regression test worth shipping.
6. **No new component tests** - Only update existing React component tests. Complex logic should be extracted into hooks and tested there instead
7. **All source changes before any test changes** - Complete all source file edits first, then update tests in a separate pass. Interleaving disrupts reasoning about the source changes, especially across many files
diff --git a/AGENTS.md b/AGENTS.md
index c35a801435e..1aae7a5f354 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -115,7 +115,7 @@ Open this URL to develop locally against the production backend (app.lobehub.com
bun run check [changed-files...]
```
-- Every bug fix must include a corresponding regression test that fails before the fix and passes after it.
+- Every bug fix must include a corresponding regression test that fails before the fix and passes after it. **Skip** when the fix is pure style/CSS (selector, hover, mask, spacing, color) and the only practical assertion would be source-string matching on the stylesheet β€” that is not a regression test worth shipping.
- No selector = **lint + test in a single pass** β€” run it once; don't fire a separate pass per selector. `--lint` / `--test` / `--type` narrow scope and are composable within one run. Default files = all working-tree changes (staged + unstaged + untracked); explicit paths override.
- `--lint` auto-fixes the given files and prints the applied fixes as a diff, so you can review what changed.
- `--test` auto-discovers the related tests for the given source files and runs them under the nearest owning vitest config (e.g. `packages/database`) β€” no need to `cd` into packages.
diff --git a/src/features/Electron/titlebar/TabBar/styles.ts b/src/features/Electron/titlebar/TabBar/styles.ts
index aa72c7ec454..333b5e7a478 100644
--- a/src/features/Electron/titlebar/TabBar/styles.ts
+++ b/src/features/Electron/titlebar/TabBar/styles.ts
@@ -132,14 +132,19 @@ export const useStyles = createStaticStyles(({ css, cssVar }) => ({
too. The button stays mounted at every tier and fades; unmounting it made it vanish
mid-pin.
- :has() carries the keyboard path β€” the button is focusable at these tiers, so
+ A lone tab never mounts the button (the last tab cannot close), so :has([data-
+ tab-close]) keeps the title margin from opening a hole for a control that is not
+ there β€” which otherwise still ran the mask gradient in as if a close affordance
+ were arriving.
+
+ :has() also carries the keyboard path β€” the button is focusable at these tiers, so
without it a tabbing user would land on something invisible.
Reservation is 20px button + 3px inset - the tab's own 6px end padding. Margin
rather than padding: the mask applies to the padding box, so padding would put the
gradient inside the reservation instead of at the text's edge. */
- &[data-tier='full']:hover,
- &[data-tier='compact']:hover,
+ &[data-tier='full']:hover:has([data-tab-close]),
+ &[data-tier='compact']:hover:has([data-tab-close]),
&[data-tier='full']:has([data-tab-close]:focus-visible),
&[data-tier='compact']:has([data-tab-close]:focus-visible) {
[data-tab-close] {