-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: use translate to center the resize handle #35665
Conversation
WalkthroughThe recent changes to the Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10368860102. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- app/client/src/layoutSystems/anvil/sectionSpaceDistributor/SpaceDistributionHandle.tsx (3 hunks)
- app/client/src/layoutSystems/anvil/sectionSpaceDistributor/utils/spaceDistributionEditorUtils.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- app/client/src/layoutSystems/anvil/sectionSpaceDistributor/utils/spaceDistributionEditorUtils.ts
Additional comments not posted (3)
app/client/src/layoutSystems/anvil/sectionSpaceDistributor/SpaceDistributionHandle.tsx (3)
32-34
: Great use oftransform: translateX(-50%)
for centering!This approach is excellent for handling sub-pixel rendering issues and simplifies the centering logic, making it more robust.
71-71
: The position calculation is clear and concise!The updated logic for calculating the handle's left position is straightforward and effectively addresses the pixel snapping issue.
97-97
: The left position calculation is well-aligned with the objectives!Subtracting half the zone gap ensures the handle is centered between zones, consistent with the overall improvements in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please make a video about what changed?
@@ -56,6 +56,7 @@ const getElementsBoundingBoxValue = (ele: HTMLElement) => { | |||
export const getAnvilZoneBoundaryOffset = (zoneId: string) => { | |||
const zoneDom = document.getElementById(getAnvilWidgetDOMId(zoneId)); | |||
if (zoneDom) { | |||
// (TODO: Anvil): Why is 2 added here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is useless. Who knows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea but wanted to keep a track on this.
Deploy-Preview-URL: https://ce-35665.dp.appsmith.com |
@KelvinOm added before/after images. |
Fixes #35232
Because of how sub-pixels are handled in browsers, the resize handle was previously looking more inclined towards right. By using translate instead adjusting the width in left property, the issue seems to be resolved.
Before:
After:
Summary by CodeRabbit
New Features
Documentation
translateX
for centering.Bug Fixes
Warning
Tests have not run on the HEAD 801900e yet
Tue, 13 Aug 2024 12:05:21 UTC