Skip to content

Conversation

@VancySavoki
Copy link
Contributor

@VancySavoki VancySavoki commented Sep 1, 2025

  1. Adds .hd-drag and .hd-btns CSS classes in index.css to control window dragging.
  2. Updates Header to use these classes, improving window management UX.
  3. Renames scripts/build-desktop.js to build-desktop.cjs and switches build/install commands from npm to pnpm.
  4. Updates Electron window icon path in the build script.
  5. Adds electron and electron-builder as devDependencies in package.json.
  6. Sets base: './' in vite.config.ts for correct asset paths for electron apps resources path
  7. Updates .gitignore to ignore release and electron directories.

Summary by CodeRabbit

  • New Features
    • Added a draggable header region in the desktop app; controls within remain fully clickable.
  • Style
    • Updated the application window icon.
  • Build
    • Set a relative base path for builds to improve asset handling.
    • Enabled macOS code signing and notarization for desktop releases.
  • Chores
    • Expanded ignore list to cover additional build and release artifacts.

* Implemented `.hd-drag` and `.hd-btns` classes for better window management in the Electron app.
* Updated `Header.tsx` to utilize these new classes for improved user experience.
@coderabbitai
Copy link

coderabbitai bot commented Sep 1, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The PR adds Electron-focused refinements: introduces draggable header and non-draggable button areas via new CSS classes and applies them in Header.tsx; updates Electron window icon; sets Vite base to './'; augments CI with macOS signing/notarization; expands .gitignore entries. No public APIs or runtime logic were changed.

Changes

Cohort / File(s) Summary of changes
Ignore rules
.\gitignore
Added dist-ssr, release, and electron to ignored paths.
UI: draggable header
src/components/Header.tsx, src/index.css
Added CSS classes .hd-drag and .hd-btns; applied to header and action areas to enable window drag zone and exclude interactive buttons. Closed utilities layer block before new classes.
Build config (Vite)
vite.config.ts
Set base: './' in Vite config.
CI workflow (desktop build)
.github/workflows/build-desktop.yml
Commented out VITE_BASE_PATH env for web build; added macOS signing/notarization env vars for Electron build from secrets.
Electron app icon
scripts/build-desktop.js
Switched BrowserWindow icon from vite.svg to icon.svg.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Renderer as Web UI (Header.tsx)
  participant CSS as CSS (.hd-drag / .hd-btns)
  participant Electron as Electron Window

  User->>Renderer: Click-drag on header
  Renderer->>CSS: Element has .hd-drag
  CSS-->>Electron: -webkit-app-region: drag
  Electron-->>Electron: Move window

  User->>Renderer: Click on button in header
  Renderer->>CSS: Element has .hd-btns
  CSS-->>Electron: no-drag (interaction allowed)
  Electron-->>Renderer: Event delivered to button

  note over CSS,Electron: Drag zone applies only to regions without .hd-btns
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

I nudge the header—hop, it slides—
Buttons stay put, where click delight resides.
A shiny new icon blinks hello,
Base set to dot for tidy flow.
Signed for the orchard in macOS skies—
Ship it! thump-thump, says bunny’s eyes. 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e49d20d and babe33e.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • .github/workflows/build-desktop.yml (2 hunks)
  • scripts/build-desktop.js (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
.gitignore (1)

11-11: Consider keeping the original dist pattern for broader coverage.

The change from dist to dist/* means the dist directory itself won't be ignored, only its contents. This could lead to the empty dist directory being tracked in git, which may not be intended.

If you want to ignore the entire dist directory (which is typical for build outputs), consider reverting to:

-dist/*
+dist
vite.config.ts (1)

10-10: Remove unnecessary blank line.

The extra blank line inside the optimizeDeps object serves no purpose and should be removed for consistency.

   optimizeDeps: {
     exclude: ['lucide-react'],
-    
   },
src/components/Header.tsx (1)

101-101: Scope drag to Electron and re-enable selection in no-drag zones

Applying hd-drag unconditionally can disable text selection across the header on the web (since .hd-drag sets user-select: none). Make the class conditional for Electron, and ensure .hd-btns restores text selection.

Apply this diff within the component:

-    <header className="bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 sticky top-0 z-50 hd-drag">
+    <header className={`bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 sticky top-0 z-50 ${isElectron ? 'hd-drag' : ''}`}>

Add near the top of the component (outside JSX):

const isElectron =
  typeof navigator !== 'undefined' && navigator.userAgent.includes('Electron');

And in index.css (or Tailwind layer) ensure no-drag areas allow selection:

.hd-btns {
  -webkit-app-region: no-drag;
  user-select: text;
  -webkit-user-select: text;
}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 7cddb5e and da13c7b.

📒 Files selected for processing (6)
  • .gitignore (2 hunks)
  • package.json (2 hunks)
  • scripts/build-desktop.cjs (3 hunks)
  • src/components/Header.tsx (3 hunks)
  • src/index.css (1 hunks)
  • vite.config.ts (1 hunks)
🔇 Additional comments (11)
.gitignore (1)

27-28: LGTM! Appropriate ignore entries for Electron build artifacts.

The addition of release and electron directories aligns well with the Electron build tooling being added in this PR.

vite.config.ts (1)

6-6: LGTM! Correct base path configuration for Electron.

Setting base: './' is necessary for Electron apps to properly resolve static assets when loaded via file:// protocol instead of HTTP.

scripts/build-desktop.cjs (2)

11-11: LGTM! Consistent with pnpm usage.

The switch from npm run build to pnpm run build aligns with the project's package manager choice.


165-165: LGTM! Consistent with pnpm usage.

The switch from npm install to pnpm install aligns with the project's package manager choice and matches the dependency installation in package.json.

package.json (2)

11-11: LGTM! Correct script path update.

The script path correctly reflects the file extension change from .js to .cjs.


31-32: Electron v37.4.0 is up-to-date and stable. It’s the current stable release (Aug 27, 2025) with no major regressions, and pairs smoothly with electron-builder ^26.0.12.

src/index.css (3)

12-12: LGTM! Proper closure of utilities layer.

The closing brace correctly terminates the @layer utilities block, allowing the new drag-related classes to be defined outside the layer.


14-18: LGTM! Proper draggable region implementation.

The .hd-drag class correctly implements the WebKit-specific CSS properties needed for draggable regions in Electron apps. Disabling text selection is appropriate for drag handles.


20-22: LGTM! Proper non-draggable region for interactive elements.

The .hd-btns class correctly uses -webkit-app-region: no-drag to ensure buttons and interactive elements within the draggable header remain clickable.

src/components/Header.tsx (2)

124-158: Nav correctly excluded from drag region

hd-btns on the nav ensures buttons remain interactive within a draggable header. Looks good.


161-210: User actions correctly marked no-drag

hd-btns here preserves clicks/hover on sync/theme/logout controls within the draggable header. LGTM.

* Implemented `.hd-drag` and `.hd-btns` classes for better window management in the Electron app.
* Updated `Header.tsx` to utilize these new classes for improved user experience.
* Implemented `.hd-drag` and `.hd-btns` classes for better window management in the Electron app.
* Updated `Header.tsx` to utilize these new classes for improved user experience.
@VancySavoki VancySavoki marked this pull request as draft September 1, 2025 09:28
VancySavoki and others added 7 commits September 1, 2025 17:31
* Implemented `.hd-drag` and `.hd-btns` classes for better window management in the Electron app.
* Updated `Header.tsx` to utilize these new classes for improved user experience.
* Implemented `.hd-drag` and `.hd-btns` classes for better window management in the Electron app.
* Updated `Header.tsx` to utilize these new classes for improved user experience.
This is a merge commit the virtual branches in your workspace.

Due to GitButler managing multiple virtual branches, you cannot switch back and
forth between git branches and virtual branches easily. 

If you switch to another branch, GitButler will need to be reinitialized.
If you commit on this branch, GitButler will throw it away.

Here are the branches that are currently applied:
 - fix/build-and-drag-window (refs/gitbutler/fix/build-and-drag-window)
   - electron-builder.yml
   - dist/index.html
For more information about what we're doing here, check out our docs:
https://docs.gitbutler.com/features/virtual-branches/integration-branch
* Implemented `.hd-drag` and `.hd-btns` classes for better window management in the Electron app.
* Updated `Header.tsx` to utilize these new classes for improved user experience.
* Implemented `.hd-drag` and `.hd-btns` classes for better window management in the Electron app.
* Updated `Header.tsx` to utilize these new classes for improved user experience.
* Implemented `.hd-drag` and `.hd-btns` classes for better window management in the Electron app.
* Updated `Header.tsx` to utilize these new classes for improved user experience.
* Implemented `.hd-drag` and `.hd-btns` classes for better window management in the Electron app.
* Updated `Header.tsx` to utilize these new classes for improved user experience.
@AmintaCCCP AmintaCCCP marked this pull request as ready for review September 3, 2025 06:11
@AmintaCCCP AmintaCCCP merged commit e095d95 into AmintaCCCP:main Sep 3, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants