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

fix: recentered form view #591

Merged
merged 1 commit into from
Apr 4, 2023
Merged

fix: recentered form view #591

merged 1 commit into from
Apr 4, 2023

Conversation

Skaiir
Copy link
Contributor

@Skaiir Skaiir commented Mar 31, 2023

Closes #582

@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Mar 31, 2023
@github-actions github-actions bot temporarily deployed to demo-582-recenter-form-view March 31, 2023 10:42 Destroyed
@github-actions github-actions bot temporarily deployed to demo-582-recenter-form-view March 31, 2023 10:43 Destroyed
@github-actions github-actions bot temporarily deployed to demo-582-recenter-form-view March 31, 2023 10:44 Destroyed
@github-actions github-actions bot temporarily deployed to demo-582-recenter-form-view March 31, 2023 10:51 Destroyed
@Skaiir
Copy link
Contributor Author

Skaiir commented Mar 31, 2023

I've had to skip one of the tests to work. Generally, I think this test will give us problems in the future. @pinussilvestrus I think I'd leave the decision to you on how to handle this one. IMO it's just a really annoying behavior to test, because it's never really clear when those UI frameworks update the DOM, which is even harder to handle considering dragging shuffles everything around. Adding 100 pixels to the x of the drag fixes the test locally for me, but not on ci.

Overall my fix simply takes the drag handle out of the placement hierarchy. I've also removed an override we were doing on the basic carbon grid component which was the cause of this pretty large outer band. Instead, we should configure the padding outside of the carbon grid components if we really want more spacing than carbon provides (which I've done here, added 4px of padding on each side.

The active area of the drag handle can be modified as you guys see fit, @christian-konrad @RomanKostka please view the deployment and let me know if the feel is right. If not, I can always increase the area where the drag handle is active. I can also increase the padding, as my 'fix' definitely reduced the space on each side.

I notice that on the deployment, the handle is not quite centered, this is something we'd have to adjust on the playground styles. But assume it is during testing.

It looks like this on form-js proper:

image

@Skaiir
Copy link
Contributor Author

Skaiir commented Mar 31, 2023

Here is a visual indicator of the active drag area:

image

@Skaiir
Copy link
Contributor Author

Skaiir commented Mar 31, 2023

I notice that the css change made the dragging in of new components a little more finicky, I'll investigate. Still, feel free to review the row dragging in isolation.

@Skaiir Skaiir changed the title fix: recentered form view fix: recentered form view [WIP] Mar 31, 2023
@@ -992,7 +992,7 @@ describe('FormEditor', function() {
});


it('should move row', async function() {
it.skip('should move row', async function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

This becomes laggy due to the absolute positioning now, I think. That's always hard to test, so I got your rationale about this particular test.

In general, I think the dragging tests make sense, as the behavior is predictable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we at least add an comment above the test why we skip it and maybe a note that we could solve it with proper integration testing? Or should we remove it entirely?

Copy link
Contributor

Choose a reason for hiding this comment

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

We can try to move this test o Playwright when I create the setup

@@ -404,11 +409,7 @@
/* row drop preview */
.fjs-children > .gu-transit {
height: 28px !important;
margin-left: 28px !important;
margin-right: -8px !important;
flex: unset !important;
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we have to keep flex: unset, otherwise it will mess up the height of the previews.

image

@Skaiir Skaiir requested a review from RomanKostka April 3, 2023 08:28
Copy link

@RomanKostka RomanKostka left a comment

Choose a reason for hiding this comment

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

looks good.
only the issue with the broken preview we should take a look at.
#591 (comment)

@bpmn-io-tasks bpmn-io-tasks bot added in progress Currently worked on and removed needs review Review pending labels Apr 3, 2023
@github-actions github-actions bot temporarily deployed to demo-582-recenter-form-view April 3, 2023 14:54 Destroyed
@github-actions github-actions bot temporarily deployed to demo-582-recenter-form-view April 4, 2023 11:00 Destroyed
@Skaiir Skaiir requested a review from RomanKostka April 4, 2023 11:55
@Skaiir Skaiir changed the title fix: recentered form view [WIP] fix: recentered form view Apr 4, 2023
Copy link

@RomanKostka RomanKostka left a comment

Choose a reason for hiding this comment

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

recentering looks good 🎉
unfortunately i found some other weird behavior:
the drop is only possible at certain areas

weird-behavior.mov

@Skaiir Skaiir merged commit 2cc91ae into develop Apr 4, 2023
@Skaiir Skaiir deleted the 582-recenter-form-view branch April 4, 2023 13:52
@bpmn-io-tasks bpmn-io-tasks bot removed the in progress Currently worked on label Apr 4, 2023
@pinussilvestrus
Copy link
Contributor

recentering looks good 🎉 unfortunately i found some other weird behavior: the drop is only possible at certain areas

@RomanKostka @Skaiir this is a known bug due to the current way dragula calculates the drop position. This will be fixed via #588 or once we migrate to dragula@2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Horizontally center the form in the editor view
4 participants