Skip to content

fix(web): keep empty workspace draggable on Windows - #6030

Closed
virtuscyber wants to merge 1 commit into
pingdotgg:mainfrom
virtuscyber:fix/windows-empty-state-window-drag
Closed

virtuscyber wants to merge 1 commit into
pingdotgg:mainfrom
virtuscyber:fix/windows-empty-state-window-drag

Conversation

@virtuscyber

@virtuscyber virtuscyber commented Aug 10, 2026 •

Copy link
Copy Markdown

What Changed

  • add an Electron-only workspace titlebar spacer for otherwise headerless views
  • render it on the no-projects landing state
  • cover Electron and browser rendering with focused regression tests

Why

On Windows 11, the no-projects workspace has no drag-region in the main pane. The sidebar header is therefore the only place that moves the window, and collapsing the sidebar removes the last draggable surface entirely.

This reuses the existing workspace-topbar sizing and drag-region behavior, while rendering nothing in the browser. I searched the current open issues and PRs for the same no-projects/collapsed-sidebar drag failure and did not find an existing report or fix.

UI Changes

There is no visual appearance change. This restores drag hit-testing across the empty workspace's titlebar-height strip on Electron; browser layout remains unchanged.

Before — Windows 11 reporter capture

Before: only the sidebar header is draggable; the main titlebar region is not

The red-marked sidebar header was draggable. The purple-marked main titlebar was not; collapsing the sidebar removed the final drag surface.

After — native Windows validation with the sidebar collapsed

After: the workspace titlebar remains draggable with the sidebar collapsed

The green-marked strip is the new Electron-only drag surface. Native minimize, maximize, and close controls remain outside the highlighted region.

Interaction video

Windows interaction preview: collapse the sidebar, then drag the window from the main titlebar

View/download the full 9-second MP4.

A native Windows workflow built exact PR head 90662e296ad4716d72959c31ec06e051ed0aa2e6, opened a clean no-projects state, collapsed the sidebar with Ctrl+B, and dragged from the main workspace titlebar. Win32 coordinates confirmed that the application moved from (20, 40) to (136, 98) — a verified 116 × 58 px movement.

Verification

  • vp check
  • vp run typecheck
  • vp test apps/web/src/components/DesktopTitlebarSpacer.test.tsx (2 passed)
  • pnpm --filter @t3tools/web build
  • full vp test: 7,292 passed / 7 skipped; two unrelated suites fail identically on current main (thread-transfer-report.test.cjs discovery and ghostty-vt.wasm?inline import parsing)
  • independent pre-commit review: passed with no security or logic findings
  • native Windows interaction workflow: passed; sidebar collapsed and main-titlebar drag moved the OS window by 116 × 58 px

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Low Risk
Small UI-only Electron hit-testing fix with no auth, data, or API changes; browser layout is unchanged.

Overview
Restores window dragging on Electron when the main workspace has no chat header—especially the no-projects landing and collapsed sidebar on Windows 11.

Adds DesktopTitlebarSpacer, an Electron-only strip using existing workspace-topbar and drag-region classes; it renders nothing in the browser. The spacer is wired into NoProjectsHero on the chat index route. Regression tests cover Electron markup vs empty browser output.

Reviewed by Cursor Bugbot for commit 90662e2. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix empty workspace drag region on Windows by adding DesktopTitlebarSpacer

On Windows (Electron), an empty workspace with no projects had no draggable titlebar region, making the window difficult to move. A new DesktopTitlebarSpacer component renders a hidden div with workspace-topbar drag-region classes when running in Electron, and nothing otherwise. This component is added to the NoProjectsHero view so the titlebar remains draggable on empty workspaces.

Macroscope summarized 90662e2.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 30bf6144-725c-424c-ae24-e4361148c09c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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 github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Aug 10, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved 90662e2

This is a straightforward UI fix that adds a draggable region for Electron/Windows when the workspace is empty. The component is minimal (renders a div with CSS classes only in Electron, nothing in browser mode) and includes tests.

You can customize Macroscope's approvability policy. Learn more.

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

The gap is real, but there is already a solution to it one function away, and another instance of the bug in the file this PR edits.

NoActiveThreadState.tsx handles the same case inline:

className={cn(
  "border-b border-border px-3 ...",
  isElectron ? "workspace-topbar drag-region" : "workspace-topbar",
  COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
)}

Same SidebarInset / div / header shape, same inset class. So the repo already has an idiom for "empty state that still needs a drag region", and this adds a second one: a separate aria-hidden spacer element rather than the class on the existing header. In NoProjectsHero there is no header to hang it on, so a spacer is defensible, but it is worth a line in the PR saying why this is not just the NoActiveThreadState treatment, otherwise the next person has two patterns and no rule.

The one I would actually fix before merging: HostedStaticOnboardingState, in _chat.index.tsx, roughly forty lines below the change:

<header
  className={cn(
    "workspace-topbar border-b border-border px-3 ...",
    COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
  )}
>

workspace-topbar with no drag-region. That is the same undraggable-topbar bug, in the same file, in the sibling empty state. Since it already has a header, it wants the NoActiveThreadState one-liner rather than the spacer.

Smaller: neither new test exercises the default.

renderToStaticMarkup(<DesktopTitlebarSpacer enabled />)
renderToStaticMarkup(<DesktopTitlebarSpacer enabled={false} />)

Both pass enabled explicitly, but production always uses enabled = isElectron. The prop is covered and the wiring is not, so the component could stop reading isElectron entirely and both tests would stay green. Rendering it once with no props under a stubbed isElectron would pin the part that actually ships.

@juliusmarminge

Copy link
Copy Markdown
Member

Superseded by #13713 (eeea71a88108), which landed the empty-workspace / no-projects drag fix via the shared WorkspacePageHeader instead of a separate spacer. Closing in favor of that merge.

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

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants