-
-
Notifications
You must be signed in to change notification settings - Fork 740
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
Linked headlines refactor #4287
Conversation
✅ Deploy Preview for volto canceled.
|
Passing run #5717 ↗︎
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
This just needs a towncrier news item, can be added collectively in #3540. |
@ksuess I remember you asked for moving the "slug icon" to the right just like mdn docs. Would you mind reviewing this PR then? |
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 is great, I would take it as it is.
But an opt-out (no chain icon on hover) would be handsome.
transform: rotate(45deg); | ||
visibility: hidden; | ||
} | ||
} | ||
} |
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.
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.
@ksuess it's relatively difficult to make the link icon properly wrap with the text, so if it's multiple lines, it doesn't behave well. But my css knowledge may be limited, maybe there's a hack to do it
aria-hidden="true" | ||
tabIndex={-1} | ||
href={`#${slug}`} | ||
> | ||
<svg | ||
{...linkSVG.attributes} | ||
dangerouslySetInnerHTML={{ __html: linkSVG.content }} | ||
width="2em" |
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.
overriden by less CSS: "width="2em""
"no chain icon on hover" - hm.. I don't see a reason why users will don't need it. @ksuess Could you give an example of sites where there is no link icon on hover but are anchors. Maybe I can just make that icon configurable? So a "#" in place of a chain icon. |
Sorry, what I mean instead is: In my opinion, "linked headlines" should be optional. Or at least opting out should be possible. I understand that this topic should go in a main issue, but I am confused where the current main development happens. Feel free to move this comment to where it belongs, thank you. |
I also think it should be optional, not sure if "opt-in" or "opt-out"... I can certainly think it sites that do not need it (brochure, etc). |
@sneridagh Now that I started to implement this, I'm a bit puzzled having both "copy to clipboard" and "scroll to anchor" events triggering on clicking anchor icon. @albertcasado when an anchor is at the bottom of the page, clicking on it scrolls to that anchor. Could triggering a toast simultaneously annoy a user? 🤔 |
@sneridagh I have pushed the changelog. Would you mind reviewing it, please? |
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.
I made a few suggestions and questions for your consideration.
docs/source/configuration/volto-slate/configuration-settings.md
Outdated
Show resolved
Hide resolved
docs/source/configuration/volto-slate/configuration-settings.md
Outdated
Show resolved
Hide resolved
@stevepiercy I resolved your comments in de9e57f. Could you please have a look? Thanks! |
@stevepiercy @sneridagh Anyways, what do you think of this opinion, As a user? Can we disable toast and instead show a copied "SVG" near the anchor. Current scenario Screen.Recording.2023-06-09.at.8.57.08.PM.mov |
For code blocks in docs, we have this interface, which is nice. It has both the universal icon for copy, plus translatable text. You can play with it at the permalink: https://6.docs.plone.org/volto/configuration/how-to.html#extending-configuration-in-a-project Screen.Recording.2023-06-09.at.11.41.29.PM.movI think the toast at the bottom is too much and disconnected from the click on large screens. |
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.
I approve docs and naming conventions. A maintainer should review source code, too. Thank you!
Thank you @stevepiercy . |
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.
src/components/manage/Blocks/ToC/variations/DefaultTocRenderer.jsx
Outdated
Show resolved
Hide resolved
@nileshgulia1 I think it would be nice to have it closer to where the user clicks, but I am not sure how to guarantee that there is space to show it. The toast is okay and has the benefit of (hopefully) following existing practices for a11y rather than needing to make sure something new is accessible...I would keep the toast for now and come back to it as a future improvement. |
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.
LGTM now
<UniveralLink/>
in linked heading anchor since we are now using Links generated byreact-router-hashlink
.