-
Notifications
You must be signed in to change notification settings - Fork 55
[WC-3094] character count on status bar, file upload bug fix, and default fonts #1865
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
base: main
Are you sure you want to change the base?
Conversation
@copilot please add unreleased changelog description |
@copilot please fix lint error that is shown on the check. |
Fixed the lint error in commit 7314aa1. The issue was in the Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
@copilot please rebase and resolve conflict |
I've successfully rebased the branch onto master and resolved the merge conflicts that were encountered:
The rebase was completed in commit b8242ae. The branch is now ready but will need a force push to update the remote branch since the commit history has been rewritten during the rebase process. |
7314aa1
to
a1231fd
Compare
Co-authored-by: gjulivan <[email protected]>
Co-authored-by: gjulivan <[email protected]>
Co-authored-by: gjulivan <[email protected]>
Co-authored-by: gjulivan <[email protected]>
dad9ec5
to
6cde06d
Compare
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.
Pull Request Overview
This PR adds character count functionality to the Rich Text widget's status bar, fixes an image upload bug, and adds default font configuration options. The changes address validation mismatches between user-visible content and HTML storage by providing multiple display options for content length tracking.
Key changes:
- Added character count options to status bar (text-only, HTML-inclusive, and combined views)
- Fixed image dialog prop passing to resolve upload functionality issues
- Added default font family and size configuration properties
Reviewed Changes
Copilot reviewed 11 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
mxTheme.ts | Refactored font constants to instance properties and added methods to update default fonts |
package.xml | Version bump to 4.10.0 |
ImageDialog.tsx | Modified props interface to make enableDefaultUpload optional |
Dialog.tsx | Updated props interface and fixed prop passing to ImageDialog component |
EditorWrapper.tsx | Added character count calculation logic and default font handling |
Editor.tsx | Fixed missing props passed to Dialog component |
useEmbedModal.ts | Removed image-related props from hook parameters |
RichText.spec.tsx | Added unit tests for character count functionality |
RichText.xml | Added new XML properties for status bar content and default fonts |
package.json | Version bump and added new dependency |
CHANGELOG.md | Added unreleased section documenting new features and fixes |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
packages/pluggableWidgets/rich-text-web/src/utils/themes/mxTheme.ts
Outdated
Show resolved
Hide resolved
packages/pluggableWidgets/rich-text-web/src/components/EditorWrapper.tsx
Show resolved
Hide resolved
46a736c
to
4da27e7
Compare
4da27e7
to
414951b
Compare
The Rich Text widget now provides character count options in addition to the existing word count, addressing the validation mismatch between user input and HTML storage.
Problem Solved
Previously, users experienced confusing validation failures when Rich Text content exceeded database attribute limits:
This left users puzzled why their short text was rejected.
Solution
Added a new
statusBarContent
property with four display options:wordCount
- Original word count (default, maintains backward compatibility)characterCount
- Character count of visible text onlycharacterCountHtml
- Character count including HTML markup (matches database storage)both
- Both word count and character countImplementation Details
The feature calculates counts using:
quill.getText().trim().split(/\s+/).length
quill.getText().length
quill.getSemanticHTML().length
Status bar displays are conditionally rendered based on the selected option, with proper pluralization and clear labeling.
Benefits
This resolves the core issue where users couldn't understand validation failures due to the invisible HTML markup added by the rich text editor.
Fixes #1863.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.