feat: 隐藏 Windows 原生菜单栏 + 优化窗口滚动条 (closes #252) - #257
Merged
Conversation
Hide the native top menu bar (Edit/View/Window) on Windows/Linux via autoHideMenuBar while keeping the application menu installed so role shortcuts (copy/paste/cut/selectAll/undo/redo, toggleDevTools, reload, zoom) keep working. Enable DevTools in production so the toggleDevTools role is an accessible entrypoint with the menu hidden. Globally restyle the window's native scrollbar (thin, translucent, dark-mode aware) and add overflow-x: hidden to html/body to eliminate the bottom horizontal scrollbar, without affecting per-component opt-in scrollbar classes. Closes #252 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe Electron window always enables DevTools and conditionally auto-hides its menu bar by platform. Global CSS now prevents horizontal overflow and styles document scrollbars for light and dark themes. ChangesUI polish
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 背景
Closes #252。
Windows 构建的窗口顶部会显示原生菜单栏(Edit / View / Window 三个菜单),需要在不影响复制粘贴、DevTools 等快捷键的前提下将其隐藏;同时优化窗口右侧与底部的原生滚动条样式,并确保窗口横向滚动条不再出现。
🔧 改动
electron/main.jsautoHideMenuBar从无条件false改为process.platform === 'darwin' ? false : true。Windows/Linux 隐藏顶部菜单栏(按 Alt 可临时呼出);macOS 保持可见(系统级常驻)。Menu.setApplicationMenu安装,role 快捷键(copy/paste/cut/selectAll/undo/redo、toggleDevTools、reload、缩放等)在菜单栏隐藏后照常生效。webPreferences.devTools由isDev改为true,使菜单toggleDevToolsrole 成为隐藏菜单后可用的生产 DevTools 入口。globalShortcut的 Ctrl+Shift+I 维持 dev-only(避免生产环境全局热键冲突),生产入口由菜单 role 覆盖。src/index.css(新增全局规则)html, body { overflow-x: hidden }—— 消除窗口底部横向滚动条(App 根用min-h-screen且 body 未限横向的根因)。html.dark/html.dark::-webkit-scrollbar-thumb)。.scrollbar-auto/.category-scrollbar/.readme-scrollbar/textarea/.prose pre。✅ 验证
npm run build通过,新规则已正确编译进dist/assets/index-*.css(html,body{overflow-x:hidden}与html.dark::-webkit-scrollbar-thumb均已产出)。npm run lint无新增问题(既有 2 个 error 位于未触及的无关文件)。📝 附注
本仓库贡献者请知悉:隐藏菜单栏 ≠ 删除菜单,role 快捷键依赖已安装的应用菜单;dark 模式选择器须用
html.dark(同元素)而非.dark html(后代),dark类挂在<html>上。🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Style