widgets:new_document: add swap button to dims#4138
Open
xaiki wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a feature to swap width and height dimensions in the 'New Document' dialog. It adds a SwapDimensions message variant, implements the swap logic using std::mem::swap, and adds an IconButton to the UI. The reviewer suggested disabling the swap button when the 'Infinite Canvas' option is enabled to maintain consistency with other dimension controls.
add a button to swap dimensions, essentially changing between portrait and landscape mode much more easily [edit] disabled when infinite is selected. Signed-off-by: Niv Sardi <xaiki@evilgiggle.com>
Contributor
There was a problem hiding this comment.
1 issue found across 2 files
Confidence score: 4/5
- This PR looks safe to merge with minimal risk: the reported issue is moderate-low severity (4/10) and appears limited to UI behavior consistency rather than a core functional break.
- In
editor/src/messages/dialog/new_document_dialog/new_document_dialog_message_handler.rs, the swap action remains enabled in Infinite Canvas mode even though width/heightNumberInputcontrols are disabled, which can create confusing or non-applicable interactions for users. - Pay close attention to
editor/src/messages/dialog/new_document_dialog/new_document_dialog_message_handler.rs- ensure the swap button is disabled when Infinite Canvas is selected to match the existing control-state logic.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="editor/src/messages/dialog/new_document_dialog/new_document_dialog_message_handler.rs">
<violation number="1" location="editor/src/messages/dialog/new_document_dialog/new_document_dialog_message_handler.rs:138">
P2: The swap button should be disabled when 'Infinite Canvas' is selected, matching the behavior of the width/height `NumberInput` controls which are disabled in that mode. Swapping dimensions is not applicable for infinite canvas.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
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.
add a button to swap dimensions, essentially changing between portrait and landscape mode much more easily
Code written in cursor, less than 40 lines and carefully reviewed.
description written by human.
tested and working.