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

Blocks Layout Navigator #5642

Merged
merged 27 commits into from
Jun 13, 2024
Merged

Blocks Layout Navigator #5642

merged 27 commits into from
Jun 13, 2024

Conversation

sneridagh
Copy link
Member

@sneridagh sneridagh commented Jan 17, 2024

Supersedes: #4745

Screen.Recording.2024-06-10.at.09.45.32.mov

Copy link

netlify bot commented Jan 17, 2024

Deploy Preview for plone-components canceled.

Name Link
🔨 Latest commit b74d0f1
🔍 Latest deploy log https://app.netlify.com/sites/plone-components/deploys/66694bed0aa68d00085eb069

Copy link

netlify bot commented Jan 17, 2024

Deploy Preview for volto canceled.

Name Link
🔨 Latest commit af56e9c
🔍 Latest deploy log https://app.netlify.com/sites/volto/deploys/664653c326cf9700073e5d00

@sneridagh sneridagh linked an issue Jan 17, 2024 that may be closed by this pull request
@tiberiuichim
Copy link
Contributor

May I suggest the following UI changes:

  • Don't name the tab "Layout", as the term is already used in the "Dexterity Layout" feature
  • Hide the block UIDs, show them as a tooltip
  • Allow the block configuration to provide a preview component. For example, for the image block, a preview component could look like (pseudo-code):
Image (...image title or alt)

When hovering over the text, I would get a floating thumbnail of the image.

For the slate text, the preview component could be like:

...cropped text (first two words)

When hovering over the text, I can get a floating preview of the entire text block.

@sneridagh
Copy link
Member Author

@tiberiuichim no worries, still under development, I just updated it. There are a couple of things to polish and others that do not work well. The UI should be far more fancy, for sure. Now it's debugging mode :)

@djay
Copy link
Member

djay commented Jun 6, 2024

@sneridagh I would be inclined to have it more hidden away. Instead of a tab, it could be inside the block tab at the top as a rolldown. So when collapsed it shows the indent and identity of the current block. uncollapsing it lets you see the current block in context of parents and switch to another block.

@djay
Copy link
Member

djay commented Jun 6, 2024

@sneridagh I'm not saying to change how it works. It's great and it's an important part of the decoupled editor.
Im just suggesting making not in another tab and having it be a drop down at the top of the block so it also acts as a single line breadcrumb making it better still.

@sneridagh
Copy link
Member Author

@robgietema I've end up by commenting out the onFocus that was stealing the focus from the slate block on creation.

26b5632

I cannot see any different behavior by removing it, probably I'm missing an edge case. If it's that so, we have to come back to it, but for now, it's good enough for me not to hold it any more.

@sneridagh sneridagh requested a review from a team June 10, 2024 07:54
@davisagli
Copy link
Member

Look at your web stats and tell me what clients are editing your sites 99.9% of the time.

@stevepiercy I would not trust the stats for this on a system that does not work well for editing on mobile. See: https://en.wikipedia.org/wiki/Survivorship_bias

@stevepiercy
Copy link
Collaborator

@davisagli drag and drop on a tiny mobile screen is difficult to use, if not impossible. It's a matter of choosing the right tool for the job. You can choose not to trust the data and insist that DnD be fixed, but then you would spend significant effort on something that is extremely difficult to implement.

@davisagli
Copy link
Member

You can choose not to trust the data and insist that DnD be fixed, but then you would spend significant effort on something that is extremely difficult to implement.

Oh sorry, I jumped into the conversation in the middle and wasn't trying to argue against merging this PR. I think the new navigator is an improvement over the status quo for all screen sizes, both in terms of usability (it's hard to drag large blocks currently) and maintainability.

Co-authored-by: Giulia Ghisini <51911425+giuliaghisini@users.noreply.github.com>
@ichim-david ichim-david self-requested a review June 11, 2024 08:36
Copy link
Member

@ichim-david ichim-david left a comment

Choose a reason for hiding this comment

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

@sneridagh @robgietema there is no drag handle visible on FF and trying to click and drag within the section where the icon should be doesn't do anything.
The Block is highlighted in the order sidebar and in the main section but no drag ability.
drag-handle-ff

This doesn't happen in Edge where the drag handle shows up and you can drag.
drag-handle-edge

@ichim-david
Copy link
Member

@sneridagh besides the missing functionality altogether on FF there has to be some regression introduced recently as it seems that even on Edge and Safari although I can drag and drop it doesn't change the order, have a look at this screen recording.

drag-not-changing.mp4

@ichim-david
Copy link
Member

ichim-david commented Jun 11, 2024

@sneridagh sorry for all of these extra comments, I found out why the drag and drop doesn't work on Edge and Safari,
it happens when you have an unknown block, you cannot do any reordering until that unknown block is removed.

unknown-block.mp4

Don't know if you want to try to treat this or simply add a documentation entry that it won't work until those blocks
are removed.

EDIT: the issue on FF remains even if I am on a page without any unknown blocks

@sneridagh
Copy link
Member Author

@ichim-david thanks for the report.
This is bad news, since Rob is out for the next month.
@plone/volto-team it would be great if someone is up to look into the issues raised. I don't have to tell you how important is this feature to be in core, and what they mean for the user experience.

@sneridagh
Copy link
Member Author

sneridagh commented Jun 11, 2024

@ichim-david I think I quick fixed the FF problem, please take a look.
I guess the "unknown block" can be addressed lately (if we think it's still a relevant issue).

image

@ichim-david
Copy link
Member

@ichim-david I think I quick fixed the FF problem, please take a look. I guess the "unknown block" can be addressed lately (if we think it's still a relevant issue).
image

@sneridagh Confirmed working now on FF. Up to you on how you think we should proceed about the unknown block. For me it's enough to have a doc entry that it doesn't work on pages where you have unknown blocks until you remove them.
We could also give it 1-2 days to see if we can figure out what's the issue there but it might take longer to figure out and we would be ok with this release with info about this limitation.

@ichim-david ichim-david self-requested a review June 11, 2024 10:06
@sneridagh sneridagh merged commit 2d4f5eb into main Jun 13, 2024
70 checks passed
@sneridagh sneridagh deleted the blocks-layout-navigator branch June 13, 2024 09:53
sneridagh added a commit that referenced this pull request Jun 15, 2024
* main: (63 commits)
  Release 18.0.0-alpha.35
  Release @plone/types 1.0.0-alpha.16
  (fix): export getFieldURL from Url.js in helpers (#6100)
  Improve container detection, `config.settings.containerBlockTypes` is no longer needed (#6099)
  Support nested directories in public folder add-on sync folders both … (#6098)
  Release 18.0.0-alpha.34
  Add generated new declarations for a34, just in case (#6097)
  Release @plone/slate 18.0.0-alpha.13
  Release @plone/registry 1.6.0
  Release @plone/types 1.0.0-alpha.15
  Add support for reading the add-ons `tsconfig.json` paths (#6096)
  Fixes #6046 pass proper defaults to align and size fields of Image block (#6093)
  bug fix. relations control panel. Restrict eglible relation targets a… (#6092)
  Fix Uncaught RangeError: date value is not finite in DateTimeFormat.format (#6088)
  Add optional `token` parameter to ploneClient initialization (#6077)
  Blocks Layout Navigator (#5642)
  Fix internalUrl  Widget to Reflect Prop Changes via onChangeBlock (#6036)
  [types] Improve styleClassNameExtenders types, Icon component JSDoc t… (#6095)
  Fix link in pop-up RelationsMatrix.jsx (#6085)
  Fix deselecting lists. (#6080)
  ...
sneridagh added a commit to aryan7081/volto that referenced this pull request Jun 15, 2024
* main: (42 commits)
  Release 18.0.0-alpha.35
  Release @plone/types 1.0.0-alpha.16
  (fix): export getFieldURL from Url.js in helpers (plone#6100)
  Improve container detection, `config.settings.containerBlockTypes` is no longer needed (plone#6099)
  Support nested directories in public folder add-on sync folders both … (plone#6098)
  Release 18.0.0-alpha.34
  Add generated new declarations for a34, just in case (plone#6097)
  Release @plone/slate 18.0.0-alpha.13
  Release @plone/registry 1.6.0
  Release @plone/types 1.0.0-alpha.15
  Add support for reading the add-ons `tsconfig.json` paths (plone#6096)
  Fixes plone#6046 pass proper defaults to align and size fields of Image block (plone#6093)
  bug fix. relations control panel. Restrict eglible relation targets a… (plone#6092)
  Fix Uncaught RangeError: date value is not finite in DateTimeFormat.format (plone#6088)
  Add optional `token` parameter to ploneClient initialization (plone#6077)
  Blocks Layout Navigator (plone#5642)
  Fix internalUrl  Widget to Reflect Prop Changes via onChangeBlock (plone#6036)
  [types] Improve styleClassNameExtenders types, Icon component JSDoc t… (plone#6095)
  Fix link in pop-up RelationsMatrix.jsx (plone#6085)
  Fix deselecting lists. (plone#6080)
  ...
sneridagh added a commit that referenced this pull request Jun 17, 2024
* main: (31 commits)
  Release 18.0.0-alpha.35
  Release @plone/types 1.0.0-alpha.16
  (fix): export getFieldURL from Url.js in helpers (#6100)
  Improve container detection, `config.settings.containerBlockTypes` is no longer needed (#6099)
  Support nested directories in public folder add-on sync folders both … (#6098)
  Release 18.0.0-alpha.34
  Add generated new declarations for a34, just in case (#6097)
  Release @plone/slate 18.0.0-alpha.13
  Release @plone/registry 1.6.0
  Release @plone/types 1.0.0-alpha.15
  Add support for reading the add-ons `tsconfig.json` paths (#6096)
  Fixes #6046 pass proper defaults to align and size fields of Image block (#6093)
  bug fix. relations control panel. Restrict eglible relation targets a… (#6092)
  Fix Uncaught RangeError: date value is not finite in DateTimeFormat.format (#6088)
  Add optional `token` parameter to ploneClient initialization (#6077)
  Blocks Layout Navigator (#5642)
  Fix internalUrl  Widget to Reflect Prop Changes via onChangeBlock (#6036)
  [types] Improve styleClassNameExtenders types, Icon component JSDoc t… (#6095)
  Fix link in pop-up RelationsMatrix.jsx (#6085)
  Fix deselecting lists. (#6080)
  ...
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.

Blocks Navigation Tab
9 participants