FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: render TopBar on Linux in sidebar and hidden layouts by jeanfbrito · Pull Request #3449 · RocketChat/Rocket.Chat.Electron · GitHub

fix: render TopBar on Linux in sidebar and hidden layouts - #3449

Merged
jeanfbrito merged 4 commits into
masterfrom
fix/linux-topbar-parity
Aug 10, 2026
Merged

fix: render TopBar on Linux in sidebar and hidden layouts#3449
jeanfbrito merged 4 commits into
masterfrom
fix/linux-topbar-parity

Conversation

jeanfbrito commented Aug 10, 2026
edited by coderabbitai Bot
Loading

Copy link
Copy Markdown
Member

What changed

In 4.16, update notifications moved from a modal to a titlebar UpdateLabel, and a DownloadsIndicator moved into the same title/tab bars. Shell renders a horizontal TopBar for non-tabs layouts (sidebar/hidden) — but that branch was gated to darwin only, and a separate branch covers win32. Linux fell through both, so on Linux those layouts got no TopBar at all: no update surface, no downloads indicator, and no ServerSwitcher in the hidden layout.

This extends the darwin-only branch to also cover linux (['darwin', 'linux'].includes(process.platform)), mirroring darwin: no WindowControls (native frame already provides them) and no WindowDragBar (that block stays darwin-only — Linux has a native titlebar to drag, macOS does not).

Before touching the shared TopBar/TabBar chrome, I checked for darwin-only assumptions that would misrender on Linux under a native frame:

  • Traffic-light inset (TrafficLightSpacer in TabBar/styles.tsx) is already gated with isDarwin && !isVertical at the call site in TabBar/index.tsx. TopBar/index.tsx never imports/uses it at all, so there's nothing to gate there.
  • -webkit-app-region: drag on the shared Strip is unconditional today, and TabBar already renders that same Strip on Linux in the tabs layout (its tabs branch is gated !== 'win32', not === 'darwin') — so Linux already ships with an unconditional drag region on the tab strip today, without incident. TopBar follows the same precedent; no new gating needed.
  • The win32-only process.platform reads in UpdateLabel/DownloadsIndicator (dropdown placement) fall through to the darwin/default case for Linux, which is the correct anchor since Linux, like darwin, has no leading meatball button pushing the pill.

No component-level code changes were needed beyond the Shell gate itself — everything else already generalizes correctly to Linux by existing precedent.

Also fixed

While adding Linux coverage to Shell/index.spec.tsx, found the test's TopBar mock dropped centerSlot entirely, so the hidden layout's ServerSwitcher was never actually exercised by any existing test (darwin included) despite Shell passing it. Fixed the mock to forward centerSlot and added assertions that exercise it.

What CI proves

  • Shell/index.spec.tsx: new linux chrome cases assert the TopBar mounts with the downloads indicator (and, in hidden layout, the ServerSwitcher) with no WindowControls, on a real Electron-runtime component tree (@kayahr/jest-electron-runner).
  • This proves component mounting/wiring correctness on Linux, not visual rendering — the tests run in Electron's renderer but without an actual native Linux window frame.
  • Visual verification on a native Linux frame pending — screenshots welcome.

Deflake (separate commit)

TopBar/DownloadsIndicator.spec.tsx's "reverts to the plain idle glyph ... once ... marked seen" test flaked on Ubuntu CI (run 31395755173): getByTestId('downloads-unseen-dot') didn't find the dot on a slow runner tick, though the same code passed on the previous run. Switched that assertion and its synchronous siblings (that seed the same unseen state at mount and assert on it) to await screen.findByTestId(...), so they wait for the unseen state to render instead of racing it. No component code changed.

Test plan

  • yarn test --runTestsByPath src/ui/components/Shell/index.spec.tsx src/ui/components/TopBar/DownloadsIndicator.spec.tsx — 68 passed, 0 failed
  • yarn lint — exit 0
  • npx tsc --noEmit — exit 0
  • Visual verification on a native Linux frame (GPU/real X11/Wayland window) — pending, screenshots welcome

Summary by CodeRabbit

  • New Features

    • Added the standard top bar to Linux layouts.
    • Linux layouts now display the downloads indicator and the appropriate tab bar or workspace switcher.
    • Windows-specific controls are omitted from Linux chrome.
  • Bug Fixes

    • Improved download indicator behavior by reliably displaying unseen completed downloads before updating their state.
  • Documentation

    • Documented a known issue affecting transition-style checks under reduced-motion settings.

Extends the darwin-only non-tabs TopBar branch in Shell to also cover
linux, so the sidebar and hidden layouts get the update label and
downloads indicator on Linux the same way they already do on darwin
and win32. The WindowDragBar and TrafficLightSpacer stay darwin-only
since Linux has a native titlebar to drag and no macOS traffic lights
to inset for.

Also fixes the Shell spec's TopBar mock, which dropped centerSlot
entirely (so the hidden layout's ServerSwitcher was never actually
exercised on any platform), and adds linux coverage asserting the
TopBar mounts with the downloads indicator (and server switcher in
hidden layout) with no window controls.
Ubuntu CI occasionally rendered the unseen-completed state one tick
after mount, so a synchronous getByTestId('downloads-unseen-dot')
right after render could miss it. Await the unseen state with
findByTestId before asserting on it or clicking through it in every
test that seeds a completed-unseen download at mount time.

coderabbitai Bot commented Aug 10, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info ⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1ee34ec5-f633-4b82-bc0a-1c3640688fbb

📥 Commits

Reviewing files that changed from the base of the PR and between 4816217 and 2a2214d.

📒 Files selected for processing (2)
  • docs/KNOWN_ISSUES.md
  • src/ui/components/TopBar/DownloadsIndicator.spec.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/ui/components/TopBar/DownloadsIndicator.spec.tsx
📜 Recent review details ⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: check (ubuntu-latest)
  • GitHub Check: check (macos-latest)
  • GitHub Check: check (windows-latest)
🧰 Additional context used 📓 Path-based instructions (1) **/*.{md,mdx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{md,mdx}: Avoid subjective descriptors and use measurable descriptions.
Never invent metrics; use only numbers from actual logs, error messages, or documented sources.
PR descriptions should use straightforward language and focus on what changed and why.

Files:

  • docs/KNOWN_ISSUES.md
🔇 Additional comments (1)
docs/KNOWN_ISSUES.md (1)

99-122: LGTM!


Walkthrough

The Shell now renders the non-tab TopBar on Linux. Shell tests cover Linux layouts and controls. DownloadsIndicator tests stabilize asynchronous state and time-dependent assertions. Known issue documentation describes platform-dependent transition assertions.

Changes

Linux TopBar and download indicator

Layer / File(s) Summary
Linux non-tab TopBar rendering
src/ui/components/Shell/index.tsx, src/ui/components/Shell/index.spec.tsx
The non-tab TopBar now renders on macOS and Linux. Linux tests cover sidebar and hidden layouts, download indicator placement, omitted Windows controls, and TabBar or workspace-switcher rendering.
Asynchronous download indicator assertions
src/ui/components/TopBar/DownloadsIndicator.spec.tsx, docs/KNOWN_ISSUES.md
Unseen completed-download tests wait for the indicator and control timestamps during state transitions. The known issue documents platform-dependent transition assertions and a CSSOM workaround.

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

Suggested labels: type: bug

🚥 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 and concisely describes the main change: rendering the TopBar on Linux in sidebar and hidden layouts.
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.


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.

The "reverts to the plain idle glyph" test seeded endTime as
mountTime + 1 against a separately captured Date.now() call, requiring
store creation and first render to land within the same millisecond as
the capture to pass. Pin Date.now for the test's duration so seenAt and
endTime ordering is deterministic instead of racing the wall clock.

Also reverts the 3 sibling findByTestId conversions (4816217) back to
synchronous getByTestId — their endTime seeding already has a 1000ms
margin and never flaked, so the async retry was dead weight.
GitHub-hosted Windows/macOS runners report prefers-reduced-motion:
reduce at the OS level while ubuntu-latest/xvfb and local dev Macs
report no-preference, so getComputedStyle-based transition assertions
diverge per platform. Document the parsed-CSSOM workaround pattern
already in use in DownloadsIndicator.spec.tsx.
jeanfbrito merged commit 3207b48 into master Aug 10, 2026
9 checks passed
jeanfbrito deleted the fix/linux-topbar-parity branch August 10, 2026 16:23
jeanfbrito mentioned this pull request Aug 10, 2026
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL