Skip to content
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

Hide safe gaps after drag threshold #4254

Merged
merged 7 commits into from
Sep 29, 2023
Merged

Conversation

ruggi
Copy link
Contributor

@ruggi ruggi commented Sep 28, 2023

Fixes #4253

Problem:

  1. Safe gaps are immediately hidden when an interaction starts, but that can become clunky when i.e. double-clicking a text element to enter edit mode.
  2. Text elements always show safe gaps, but this is not necessarily a good thing (they are below the small element threshold).

Fix:

  1. Hide the safe gaps only after the drag threshold is met
  2. Only show safe gaps for text elements that were resized past their initial max-content dimensions
Screen.Recording.2023-09-28.at.1.19.52.PM.mov

@ruggi ruggi changed the title hide gaps after drag threshold, adjust for text elements Hide safe gaps after drag threshold Sep 28, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 28, 2023

Try me

@relativeci
Copy link

relativeci bot commented Sep 28, 2023

Job #8298: Bundle Size — 62.67MiB (~+0.01%).

bbb6d0f(current) vs 5957b21 master#8294(baseline)

⚠️ Bundle contains 64 duplicate packages

Metrics (2 changes)
                 Current
Job #8298
     Baseline
Job #8294
Initial JS 34.94MiB(~+0.01%) 34.93MiB
Initial CSS 0B 0B
Cache Invalidation 18.35% 0%
Chunks 27 27
Assets 31 31
Modules 3970 3970
Duplicate Modules 422 422
Duplicate Code 30.84% 30.84%
Packages 409 409
Duplicate Packages 64 64
Total size by type (1 change)
                 Current
Job #8298
     Baseline
Job #8294
CSS 0B 0B
Fonts 0B 0B
HTML 11.43KiB 11.43KiB
IMG 0B 0B
JS 62.66MiB (~+0.01%) 62.66MiB
Media 0B 0B
Other 0B 0B

View job #8298 reportView fix/safe-gaps-after-threshold branch activity

@github-actions
Copy link
Contributor

github-actions bot commented Sep 28, 2023

Performance test results:
(Chart1)
(Chart2)

Copy link
Contributor

@balazsbajorics balazsbajorics left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the new behavior! but I wouldn't add hasBeenPastThreshold to the interactionState to avoid inflating it and instead use drag != null.

@ruggi
Copy link
Contributor Author

ruggi commented Sep 29, 2023

I like the new behavior! but I wouldn't add hasBeenPastThreshold to the interactionState to avoid inflating it and instead use drag != null.

oh man, nice! yeah I added that because I did not figure out the != null part, it actually solves it! removed hasBeenPastThreshold in b341491 (#4254)

# Conflicts:
#	editor/src/components/canvas/controls/bounding-box-hooks.ts
@ruggi ruggi merged commit 62eb165 into master Sep 29, 2023
9 checks passed
@ruggi ruggi deleted the fix/safe-gaps-after-threshold branch September 29, 2023 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide safe gaps after drag threshold, text safe gaps only after resize
3 participants