fix: restore minimized windows to current workspace - #773
Conversation
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe pull request updates a GitHub Actions workflow condition and modifies a Hyprland window manager key binding. The workflow change alters when pull request creation occurs, while the key binding change replaces simple workspace toggling with dynamic workspace address resolution using command chaining. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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 |
Summary of ChangesHello @shunkakinoki, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the window management keybinds within the Hyprland configuration. The primary goal is to provide a more intuitive and functional way to minimize and restore windows, separating these actions from the 'kill window' command. It introduces a dedicated 'minimize' action that moves windows to a special workspace and a corresponding 'restore' action to bring them back, enhancing the user's control over their workspace layout. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Mesa DescriptionTL;DR
What changed?
Description generated by Mesa. Update settings |
There was a problem hiding this comment.
Code Review
This pull request updates window management keybindings to implement a minimize/restore feature using a special workspace. The Super+W keybind is changed from killing a window to moving it to a 'minimized' workspace, while Super+Shift+W is introduced to restore all minimized windows. The killactive command is moved to Super+Q. The implementation is sound, but I have one suggestion to improve the efficiency of the command that restores windows by using hyprctl --batch.
| # ============================================================================= | ||
| bind = $mod, W, killactive, | ||
| bind = $mod, W, movetoworkspacesilent, special:minimized | ||
| bind = $mod SHIFT, W, exec, hyprctl -j clients | jq -r '.[] | select(.workspace.name == "special:minimized") | .address' | xargs -I{} hyprctl dispatch movetoworkspacesilent e+0,address:{} |
There was a problem hiding this comment.
For better performance, you can use hyprctl --batch to execute all dispatch commands in a single process. The current implementation with xargs -I{} spawns a new hyprctl process for each minimized window, which can be inefficient if many windows are minimized.
By generating all the dispatch commands with jq and piping them to a single hyprctl --batch call, you can achieve the same result more efficiently. hyprctl --batch is designed for this purpose and will read the commands from standard input.
bind = $mod SHIFT, W, exec, hyprctl -j clients | jq -r '.[] | select(.workspace.name == "special:minimized") | "dispatch movetoworkspacesilent e+0,address:" + .address' | hyprctl --batch
Super+Shift+W now moves all minimized windows back to the current workspace instead of toggling a special workspace overlay.
42804a3 to
6441e91
Compare
There was a problem hiding this comment.
Pull request overview
Updates Hyprland window-management keybinds to support a “minimize to special workspace” flow and restore minimized windows back onto the currently active workspace (follow-up to #772’s macOS-style binds).
Changes:
- Change
Super+Wto minimize by moving the focused window tospecial:minimized. - Add
Super+Shift+Wto restore all windows fromspecial:minimizedto the current workspace (without toggling an overlay). - Ensure
Super+Qis the kill-active-window binding.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@config/hyprland/hyprland.conf`:
- Line 264: The bind line invoking hyprctl/jq/xargs can call hyprctl with an
empty address when nothing matches "special:minimized"; update the command that
uses xargs (the line starting with bind = $mod SHIFT, W, exec, hyprctl ...) to
pass the GNU xargs option --no-run-if-empty (or -r) so hyprctl dispatch
movetoworkspacesilent e+0,address:{} is not executed when jq produces no output.
| # ============================================================================= | ||
| bind = $mod, W, movetoworkspacesilent, special:minimized | ||
| bind = $mod SHIFT, W, togglespecialworkspace, minimized | ||
| bind = $mod SHIFT, W, exec, hyprctl -j clients | jq -r '.[] | select(.workspace.name == "special:minimized") | .address' | xargs -I{} hyprctl dispatch movetoworkspacesilent e+0,address:{} |
There was a problem hiding this comment.
Add --no-run-if-empty to avoid a spurious hyprctl call when nothing is minimized.
When no windows are in special:minimized, jq produces no output, but GNU xargs (without -r) still invokes the command once with an empty {}, resulting in an invalid hyprctl dispatch movetoworkspacesilent e+0,address: call. It's harmless (just a stderr error), but easy to avoid.
Proposed fix
-bind = $mod SHIFT, W, exec, hyprctl -j clients | jq -r '.[] | select(.workspace.name == "special:minimized") | .address' | xargs -I{} hyprctl dispatch movetoworkspacesilent e+0,address:{}
+bind = $mod SHIFT, W, exec, hyprctl -j clients | jq -r '.[] | select(.workspace.name == "special:minimized") | .address' | xargs -r -I{} hyprctl dispatch movetoworkspacesilent e+0,address:{}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| bind = $mod SHIFT, W, exec, hyprctl -j clients | jq -r '.[] | select(.workspace.name == "special:minimized") | .address' | xargs -I{} hyprctl dispatch movetoworkspacesilent e+0,address:{} | |
| bind = $mod SHIFT, W, exec, hyprctl -j clients | jq -r '.[] | select(.workspace.name == "special:minimized") | .address' | xargs -r -I{} hyprctl dispatch movetoworkspacesilent e+0,address:{} |
🤖 Prompt for AI Agents
In `@config/hyprland/hyprland.conf` at line 264, The bind line invoking
hyprctl/jq/xargs can call hyprctl with an empty address when nothing matches
"special:minimized"; update the command that uses xargs (the line starting with
bind = $mod SHIFT, W, exec, hyprctl ...) to pass the GNU xargs option
--no-run-if-empty (or -r) so hyprctl dispatch movetoworkspacesilent
e+0,address:{} is not executed when jq produces no output.
Changes
Super+Shift+Wnow moves all minimized windows back to the current workspace instead of toggling a special workspace overlayKeybind summary
Super+W— minimize (hide to special:minimized)Super+Shift+W— restore all minimized windows to current workspaceSuper+Q— kill active windowTesting
Super+W, restore withSuper+Shift+W— windows return to current workspace without overlayGenerated with Claude Code by claude-opus-4-6
Summary by cubic
Super+Shift+W now restores all minimized windows to the current workspace instead of toggling the special:minimized overlay. Super+W still minimizes to special:minimized, Super+Q still kills the active window, and the upgrade workflow now only creates PRs when the event is not pull_request.
Written for commit 94b8096. Summary will update on new commits.