Skip to content

fix: theme-aware tab strip, tooltip address line, and divider polish - #3422

Closed
rodrigok wants to merge 2 commits into
masterfrom
chore/tabs-tweaks
Closed

fix: theme-aware tab strip, tooltip address line, and divider polish#3422
rodrigok wants to merge 2 commits into
masterfrom
chore/tabs-tweaks

Conversation

@rodrigok

@rodrigok rodrigok commented Jul 17, 2026

Copy link
Copy Markdown
Member

What changed

Polish for the workspace tab strip, focused on transparent-window legibility and small UX fixes.

Theming

  • The shell palette now follows the resolved theme (auto tracks the OS) when the window is transparent; opaque windows stay pinned to dark. Extracted into a shared useShellTheme hook used by both Shell and TabBar.
  • Centralized the selected-tab / hover / divider / strip-border fill into a single --tab-chrome-fill CSS variable set on Strip. Over a transparent window it becomes a translucent overlay that inverts with the palette (subtle darkening in light mode, subtle brightening in dark mode); opaque uses the solid sidebar surface.

Add button

  • Matches the button hover background to the tab fill when transparency is enabled (falls back to fuselage's default when opaque).

Dividers

  • Each tab now renders its divider as a trailing sibling, so one sits between the last tab and the add button automatically — no special-case element.
  • Divider visibility (leading edge, and the flanks of the selected/hovered tab) is driven purely in CSS via aria-selected / role="tab" sibling selectors, replacing the previous JS isDividerVisible computation.
  • Tab hover background and divider opacity now animate (150ms).

Tooltip

  • Tab tooltip shows the server address on its own second line, with the trailing slash removed. When the title already embeds the address, it's stripped from the name line so it isn't duplicated.

Test

  • Updated the tab max-width assertion from 180px to 230px to match the current strip metrics.

Verification

  • tsc --noEmit: pass
  • yarn lint: pass
  • yarn test: 156 suites / 1674 tests passing, 0 failed (2 skipped)

🤖 Generated with Claude Code

Images

Not transparent, Dark (Before / After)
Screenshot 2026-07-17 at 13 52 59 (3)

Not transparent, Light (Before / After)
Screenshot 2026-07-17 at 13 53 15 (3)

Transparent, Dark (Before / After)
Screenshot 2026-07-17 at 13 54 26 (3)

Transparent, Light (Before / After)
Screenshot 2026-07-17 at 13 54 18 (3)

Hover before
Screenshot 2026-07-17 at 16 29 57

Hover after
Screenshot 2026-07-17 at 16 30 16

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added adaptive light/dark shell theming that follows transparency, machine theme, and user theme preference.
    • Enhanced workspace tab tooltips with clearer multi-line server name/address and improved label formatting.
    • Added dividers between workspace tabs.
  • UI Improvements

    • Updated tab bar “chrome” styling for transparent vs opaque windows, including new gradient behavior, sizing/spacing, hover/selected states, and typography.
  • Tests

    • Expanded and refined theme selection assertions to cover transparent and non-transparent scenarios.

- Follow the resolved theme for the shell palette when the window is
  transparent (opaque stays dark), via a shared useShellTheme hook, so tab
  text stays legible over a light desktop
- Centralize the tab/divider/hover fill into a single --tab-chrome-fill CSS
  variable that inverts with the palette under transparency
- Match the add button hover to the tab fill when transparency is enabled
- Render each tab's divider as a trailing sibling so one sits before the add
  button automatically; drive divider visibility (leading edge, selected and
  hovered flanks) purely in CSS
- Animate tab hover background and divider opacity
- Show the server address on its own tooltip line, stripped from the title
  when the title already embeds it
- Update tab max-width test to 230px to match the strip metrics

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Shell theme resolution now reflects transparency and theme preferences. Tab-bar chrome uses the resolved palette with updated sizing, gradients, dividers, labels, and add-button styling. Workspace tabs improve server tooltips and displayed labels.

Changes

Shell theme and tab bar UI

Layer / File(s) Summary
Theme resolution and shell integration
src/ui/components/hooks/useShellTheme.ts, src/ui/components/Shell/index.tsx, src/ui/components/Shell/index.spec.tsx
Theme selection resolves machine and user preferences for transparent windows, and Shell applies the result to its palette tag and background.
Palette-aware tab chrome and layout
src/ui/components/TabBar/index.tsx, src/ui/components/TabBar/styles.tsx, src/ui/components/TabBar/index.spec.tsx
TabBar styling uses theme-aware chrome fills, updated dimensions, divider behavior, add-button hover styling, typography, and revised width expectations.
Workspace tab labels and tooltips
src/ui/components/TabBar/WorkspaceTab.tsx
Workspace tooltips separate server names from addresses, labels normalize protocols and trailing slashes, and trailing dividers are rendered.

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

Sequence Diagram(s)

sequenceDiagram
  participant ReduxState
  participant useShellTheme
  participant Shell
  participant PaletteStyleTag
  participant TabBar
  participant Strip
  ReduxState->>useShellTheme: read transparency and theme preferences
  useShellTheme->>Shell: return shellTheme
  Shell->>PaletteStyleTag: set data-theme
  useShellTheme->>TabBar: return paletteTheme
  TabBar->>Strip: pass paletteTheme and transparency state
Loading

Possibly related PRs

Suggested labels: type: bug

Suggested reviewers: jeanfbrito

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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 changes: theme-aware tab strip updates, tooltip line formatting, and divider polish.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (2)
  • DD53-4544: Request failed with status code 401
  • A8936C88-1049: Request failed with status code 401

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.

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

- Hide the divider before the add button when the button is hovered
- Round tab corners and align the add button radius
- Dim idle dividers to 50% opacity

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@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.

🧹 Nitpick comments (1)
src/ui/components/TabBar/styles.tsx (1)

133-133: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Simplify redundant padding logic.

The ternary operator evaluates to '0 6px' in both conditions, making the isCompact check redundant. If the padding is intentionally identical for both compact and non-compact modes, this expression can be simplified.

If isCompact is no longer utilized elsewhere in this styled component, you may also consider removing it from TabProps to clean up unused properties.

♻️ Proposed fix
-  padding: ${({ isCompact }) => (isCompact ? '0 6px' : '0 6px')};
+  padding: 0 6px;
🤖 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 `@src/ui/components/TabBar/styles.tsx` at line 133, In the styled component’s
padding declaration, replace the redundant isCompact ternary with the shared
constant value '0 6px'. Remove isCompact from TabProps only if it is unused
elsewhere in the component, preserving the prop when other styles still depend
on it.
🤖 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.

Nitpick comments:
In `@src/ui/components/TabBar/styles.tsx`:
- Line 133: In the styled component’s padding declaration, replace the redundant
isCompact ternary with the shared constant value '0 6px'. Remove isCompact from
TabProps only if it is unused elsewhere in the component, preserving the prop
when other styles still depend on it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 74d132b5-222a-40ee-8a25-723d0d31b4f5

📥 Commits

Reviewing files that changed from the base of the PR and between 3c7fd30 and d80167c.

📒 Files selected for processing (1)
  • src/ui/components/TabBar/styles.tsx
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use TypeScript for new code unless explicitly told otherwise.
Use Fuselage components from @rocket.chat/fuselage for UI work unless the design requires something Fuselage does not provide.
Check Theme.d.ts for valid color tokens before using Fuselage colors.
Verify library props, APIs, and tokens against official docs or local .d.ts files instead of assuming.
Use React functional components with hooks.
Redux actions follow FSA shape.
Use camelCase for file names and PascalCase for components.
Prefer clear names over unnecessary comments.
Prefer editing existing files over creating new abstractions unless the new abstraction removes real complexity or matches an existing pattern.

**/*.{ts,tsx}: Use TypeScript for all new code unless explicitly told otherwise.
Use Fuselage components for all UI work; create custom components only when Fuselage lacks the required functionality.
Import Fuselage components from @rocket.chat/fuselage.
Use only valid color tokens documented by Theme.d.ts.
Use optional chaining with fallbacks for platform-specific APIs, especially Linux-only process APIs such as process.getuid(), getgid(), geteuid(), and getegid().
Use TypeScript strict mode.
Redux actions must follow the Flux Standard Action pattern.
Use camelCase for file names and PascalCase for component names.
Avoid unnecessary comments; prefer self-documenting code through clear naming.
Do not commit or push without explicit user permission.
Verify library APIs, props, tokens, and types against official documentation and .d.ts files instead of assuming they are valid.

Files:

  • src/ui/components/TabBar/styles.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use React functional components with hooks.

Files:

  • src/ui/components/TabBar/styles.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant