-
Notifications
You must be signed in to change notification settings - Fork 292
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
feat(RichTextEditor): enhanced look, link/quote/code block buttons [WPB-15264] #18643
Conversation
…redundant shiftKey check
…k node management
…ut for better usability
…k state management
…e url sanitization logic
…link node handling logic
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #18643 +/- ##
==========================================
- Coverage 46.22% 45.96% -0.26%
==========================================
Files 880 894 +14
Lines 27109 27347 +238
Branches 6118 6170 +52
==========================================
+ Hits 12532 12571 +39
- Misses 13017 13213 +196
- Partials 1560 1563 +3 |
src/script/components/InputBar/components/InputBarControls/ControlButtons.tsx
Outdated
Show resolved
Hide resolved
src/script/components/InputBar/components/InputBarControls/ControlButtons.tsx
Outdated
Show resolved
Hide resolved
src/script/components/InputBar/components/InputBarControls/ControlButtons.tsx
Outdated
Show resolved
Hide resolved
src/script/components/InputBar/components/InputBarControls/ControlButtons.tsx
Outdated
Show resolved
Hide resolved
src/script/components/InputBar/components/InputBarControls/GiphyButton/GiphyButton.tsx
Outdated
Show resolved
Hide resolved
...onents/InputBar/components/RichTextEditor/components/FormatToolbar/LinkDialog/LinkDialog.tsx
Show resolved
Hide resolved
...onents/InputBar/components/RichTextEditor/components/FormatToolbar/LinkDialog/LinkDialog.tsx
Outdated
Show resolved
Hide resolved
… values for isEditing
...ents/RichTextEditor/components/FormatToolbar/useLinkState/getSelectedNode/getSelectedNode.ts
Outdated
Show resolved
Hide resolved
...ents/RichTextEditor/components/FormatToolbar/useLinkState/getSelectedNode/getSelectedNode.ts
Outdated
Show resolved
Hide resolved
src/script/components/InputBar/components/RichTextEditor/plugins/PastePlugin/PastePlugin.tsx
Outdated
Show resolved
Hide resolved
…ng selection properties
…ted content based on preview mode
src/script/components/InputBar/components/InputBarControls/ControlButtons.tsx
Outdated
Show resolved
Hide resolved
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 👍
Added few suggestion.
src/script/components/InputBar/components/InputBarControls/ControlButtons.tsx
Outdated
Show resolved
Hide resolved
})} | ||
type="button" | ||
onClick={onClick} | ||
title={isActive ? t('tooltipConversationHideFormatting') : t('tooltipConversationShowFormatting')} | ||
aria-label={isActive ? t('tooltipConversationHideFormatting') : t('tooltipConversationShowFormatting')} | ||
data-uie-name="format-text" | ||
> | ||
<Icon.MarkdownIcon /> | ||
<Icon.MarkdownIcon width={14} height={14} /> |
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.
Should we make the icon size responsive using a relative unit (rem)?
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.
Not really, I don't see a reason to do that
</div> | ||
<form css={formStyles} onSubmit={handleSubmit} noValidate> | ||
<Input | ||
ref={textInputRef} |
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.
Is it possible to use callback here to avoid timeout in in useEffect?
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 so, the timeout is actually needed there, I added a comment next to it why it's there
value={formData.text} | ||
markInvalid={isSubmitted && !!errors.text} | ||
onChange={event => handleInputChange({event, field: 'text'})} | ||
error={!!isSubmitted && !!errors.text ? <ErrorMessage>{errors.text}</ErrorMessage> : undefined} |
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.
Is this possible?
error={!!isSubmitted && !!errors.text ? <ErrorMessage>{errors.text}</ErrorMessage> : undefined} | |
error={!!isSubmitted && !!errors.text && <ErrorMessage>{errors.text}</ErrorMessage>} |
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 would need to refactor it somehow because it's throwing an error:
Type 'false | Element' is not assignable to type 'ReactElement<any, string | JSXElementConstructor<any>> | undefined'.
Type 'boolean' is not assignable to type 'ReactElement<any, string | JSXElementConstructor<any>>'.
It's reasonable, when !!isSubmitted && !!errors.url
will be false:
- When isSubmitted is false
- When errors.url is undefined/null/empty
Quality Gate passedIssues Measures |
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 🚀
Description
What's changed:
Adding link:
adding-link.mov
Editing link:
editing-link.mov
Auto link:
auto-link.mov
Link validation:
link-validation.mov
Inserting blockquote and code blocks:
blockquote-code-block.mov
Theme changes & edit a message:
theme.mov
Checklist