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

Grid View Modal #4153

Merged
merged 22 commits into from
Jan 24, 2020
Merged

Grid View Modal #4153

merged 22 commits into from
Jan 24, 2020

Conversation

swissspidy
Copy link
Collaborator

@swissspidy swissspidy commented Jan 21, 2020

Summary

Implements the reorder grid view using react-modal.

It is still a bit rough and needs some polishing, but generally works.

Fixes #3836.

Checklist

  • My pull request is addressing an open issue (please create one otherwise).
  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

@swissspidy swissspidy added the Stories Stories Editor label Jan 21, 2020
@googlebot googlebot added the cla: yes Signed the Google CLA label Jan 21, 2020
@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no Has not signed the Google CLA and removed cla: yes Signed the Google CLA labels Jan 22, 2020
@swissspidy swissspidy changed the base branch from feature/page-ordering to develop-stories January 22, 2020 08:30
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes Signed the Google CLA and removed cla: no Has not signed the Google CLA labels Jan 22, 2020
@swissspidy swissspidy marked this pull request as ready for review January 22, 2020 11:09
Copy link
Contributor

@miina miina 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 and works well, left some minor comments (in addition to the mentioned SVG-s not being visible when zooming to 80% and the dropzone highlighting not being in the middle)

@swissspidy swissspidy changed the title [WIP] Grid View Modal Grid View Modal Jan 22, 2020
@swissspidy
Copy link
Collaborator Author

@miina Any suggestion for the dropzone highlighting?

I think for true responsiveness we have to use grids here, which makes using a pseudo element a bit unreliable due to unknown width of the gaps.

@miina
Copy link
Contributor

miina commented Jan 22, 2020

@miina Any suggestion for the dropzone highlighting?
I think for true responsiveness we have to use grids here, which makes using a pseudo element a bit unreliable due to unknown width of the gaps.

In this case, isn't the grid-gap set? Could we perhaps pass it as a param to the DropZone?
Originally I was thinking that the DropZone could be used anywhere (e.g. around a Page as well to drop Media or in the Media library to drop Media), and the styling could be passed as attributes from each implementation as necessary.

I'm not sure though, what did you have in mind?

@miina miina mentioned this pull request Jan 23, 2020
3 tasks
@swissspidy
Copy link
Collaborator Author

Right, yeah grid-gap is set. Passing it as a param makes sense. For the carousel it would be the margin, here the grid-gap.

@swissspidy swissspidy requested a review from miina January 24, 2020 09:14
@swissspidy
Copy link
Collaborator Author

@miina Implemented that in b98129d. WDYT?

@miina
Copy link
Contributor

miina commented Jan 24, 2020

@miina Implemented that in b98129d. WDYT?

Seems to work well.

The only thing I'm noticing now is that the highlights seem to be lagging on the grid view, can you also see that? Looking at the code then it seems like the issue is coming from dropZoneProvider where setHoveredDropZone is done even if all the params are the same.

E.g. adding this removes the lagging:

if (
			! hoveredDropZone ||
			hoveredDropZone.node !== foundDropZone.node ||
			position.x !== hoveredDropZone.position.x ||
			position.y !== hoveredDropZone.position.y
		) {
			setHoveredDropZone( {
				node: foundDropZone.node,
				position,
			} );
		}

Although the issue doesn't come from this PR, would you mind adjusting this here, too?

@swissspidy
Copy link
Collaborator Author

Sure thing, done! Definitely improves things.

Copy link
Contributor

@miina miina left a comment

Choose a reason for hiding this comment

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

LGTM

@swissspidy swissspidy merged commit 3b165c4 into develop-stories Jan 24, 2020
@swissspidy swissspidy added AMP Stories (obsolete) and removed Stories Stories Editor labels Feb 18, 2020
@schlessera schlessera deleted the add/grid-view-modal branch November 6, 2020 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Signed the Google CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants