-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 - Improve Link Entry #2779
FIX - Improve Link Entry #2779
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2779 +/- ##
==========================================
+ Coverage 34.07% 37.76% +3.68%
==========================================
Files 192 199 +7
Lines 5675 6379 +704
Branches 996 1190 +194
==========================================
+ Hits 1934 2409 +475
- Misses 3165 3330 +165
- Partials 576 640 +64
Continue to review full report at Codecov.
|
@@ -40,22 +38,9 @@ const DEFAULT_CONTROLS = [ 'bold', 'italic', 'strikethrough', 'link' ]; | |||
class FormatToolbar extends Component { |
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 guess we could refactor this component to be just a functional component?
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 don't think we can as it needs the lifecycle methods?
I like the fact that we have a unique way of adding links to the components, though, I'm finding that this requries a lot of steps to add the link.
Maybe the options could be triggered by a gear button or something. anyway, a more "designy" feedback would be great. @jasmussen @karmatosed |
The button link is not being saved as expected (check the text mode), Not sure if it's related to this PR. |
the appearing animation is a bit slow IMO, could we increase its speed? |
This isn't the correct text for a Button block?
|
@tg-ephox for some reason, the |
@youknowriad the dialog that pops in allows you to 'un-link', which will result in a anchor tag with no href, maybe this option shouldn't be available for the Button block? |
@youknowriad I found the URL problem for Button, I'd renamed a variable... |
hey @annaephox @karmatosed can I pls get some design feedback on this? |
Hey @tg-ephox : looks really good to me! |
Great job so far! I'm really liking the consistency.
|
blocks/library/button/index.js
Outdated
@@ -75,19 +75,9 @@ registerBlockType( 'core/button', { | |||
onChange={ ( value ) => setAttributes( { text: value } ) } | |||
formattingControls={ [ 'bold', 'italic', 'strikethrough' ] } | |||
keepPlaceholderOnFocus | |||
extraToolbarButtons={ <UrlInputButton showSettings={ false } url={ url } onChange={ updateUrl } /> } |
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.
Why do we need this prop? Can't we just put this putting in the BlockControls
component?
blocks/url-input/button.js
Outdated
const EditStep = 'EDIT'; | ||
const SettingsStep = 'SETTINGS'; | ||
|
||
const AllSteps = [ EditStep, SettingsStep, DisplayStep ]; |
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.
We have this unofficial style guideline for uppercasing module constants? Could we uppercase those?
const DISPLAY_STEP
...
blocks/url-input/button.js
Outdated
if ( steps[ currentStep ] === EditStep ) { | ||
return [ | ||
<UrlInput key="urlinput" value={ url || '' } onChange={ this.changeLink } required={ ! isDeleted } />, | ||
<IconButton key="iconbutton" className="blocks-url-input__unlink" icon="dismiss" label={ __( 'Un-link' ) } disabled={ ! url } onClick={ this.deleteLink } />, |
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.
Could we break this line and the above maybe to improve readability?
blocks/url-input/button.js
Outdated
renderStep( steps ) { | ||
const { currentStep, url, isDeleted, opensInNewWindow } = this.state; | ||
|
||
if ( steps[ currentStep ] === EditStep ) { |
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.
Why not a switch?
@annaephox I am not happy merging it in it's current state. The design discussion is here: #2715 |
Thanks for working on this, sorry for coming in with feedback so late. I'm also coming in fresh, so please let me know if some of the following are known issues, or separate from this PR.
Just click twice on the switch.
Two solutions I can see. The easiest one is probably to let the link dialog box sit stacked below the quick toolbar. The other solution is to keep it where it is — i.e cover the quick toolbar. But then we can't have stacked shadows, i.e. the quick toolbar should probably be invisible when the link toolbar is there, and reappear when done. Also, we should make sure they have the same height — right now the link toolbar is slightly taller: Given the discussion ongoing in #2983, perhaps it's best to do as little as possible around this area right now. |
How to setup option: |
I am closing this as we can always iterate but we reached a point here where we weren't progressing. Let's get feedback in testing and take from there. |
Description
Link entry for Paragraph, Cover Image and Button blocks have all been made similar to the Image block (with the addition of animations on entry/exit)
Formatting toolbars for Cover Image and Image have been modified so that they appear in the single toolbar above the block, so that this is consistent between all blocks, previously these were the only toolbars that were centred.
fixes #2715
How Has This Been Tested?
Unit tests, manual browser testing.
Screenshots (jpeg or gifs if applicable):
Types of changes
New feature
Checklist: