Preserve window width ratio on cross-workspace move#365
Conversation
… width when moving window across workspaces moveWindowToWorkspace() was calling initializeNewColumnWidth() which resets the column to the workspace default width. Replace with copyColumnWidthState() to preserve the source column's width proportions, preset index, and full-width state. Fixes #295 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR fixes a bug where windows lost their width when moved to a different workspace on another screen. The moveWindowToWorkspace method now copies the source column's width state to the target column instead of initializing it to defaults. ChangesWindow width preservation on workspace moves
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
|
I also notice when window lost it width when moved between columns |
|
Good catch @Guria — that's a related but separate bug. This PR fixes width loss on cross-workspace moves (
Interestingly, I can open a follow-up PR for the column move case if the maintainer prefers to keep the scope separate, or expand this one. @BarutSRB what's your preference? |
Omni is literally doing what Niri does, as you consume/expel it inherits the width of the column it got expelled from, unless you mean something else? |
|
You're right — I traced this more carefully and the move-left/move-right path ( The one place I do see @Guria — could you clarify what operation triggers the width loss you're seeing? Is it consume/expel (Mod+Shift+Left/Right), or something else like dragging in the overview? |
|
I will monitor it and tell later what exactly confuses me. I have no yet exact steps. Feel free to ignore it for now |
…kspace move (PR BarutSRB#365) Cherry-picked from biswadip-paul PR BarutSRB#365. Uses copyColumnWidthState instead of initializeNewColumnWidth when moving windows between workspaces, preserving the source column's width proportions. Also changed copyColumnWidthState from private to internal for cross-extension access. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
initializeNewColumnWidth()withcopyColumnWidthState()inmoveWindowToWorkspace()Details
When moving a single window to another workspace (including cross-monitor moves),
moveWindowToWorkspace()was callinginitializeNewColumnWidth()which resets the target column to the workspace's default width. This discards any manual resizing the user had done.The fix uses the existing
copyColumnWidthState()helper (already used for same-workspace column moves inmoveColumnTo*operations) to carry over the source column's width state. Note thatmoveColumnToWorkspace()already preserves width correctly since it transfers the entire column without re-initializing.Test plan
Fixes #295
🤖 Generated with Claude Code
Summary by CodeRabbit