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

updated hero heading and subheading character limit to 250 #12575

Merged
merged 4 commits into from
Jul 10, 2024

Conversation

danielfmiranda
Copy link
Collaborator

@danielfmiranda danielfmiranda commented Jul 2, 2024

Description

Related PRs/issues: TP1-842

This PR introduces the following changes:

  • Renames TitleWidget to CharCountWidget to better reflect its broader usage beyond just title fields. This widget displays a character count at the bottom right of CharFields and turns red when the user exceeds the specified limit.
  • Increases the character limit for the hero_heading and hero_subheading fields in the AppInstallPage from 80 to 250.
  • Updates hero_subheading to use the newly renamed CharCountWidget, maintaining a soft character limit of 80.

Screenshots

Before:

Screenshot 2024-07-02 at 13-36-10 Editing App install page RegretsReporter Extension - Wagtail

After:

Screenshot 2024-07-02 at 13-27-06 Editing App install page RegretsReporter Extension - Wagtail

┆Issue is synchronized with this Jira Story

@danielfmiranda danielfmiranda temporarily deployed to foundation-s-tp1-842-ap-c9gaxs July 2, 2024 20:08 Inactive
Copy link
Contributor

@AdalbertoMoz AdalbertoMoz left a comment

Choose a reason for hiding this comment

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

Hey @danielfmiranda , the code looks great! I only have one question to confirm that what I am thinking is correct.

Does a soft character limit mean that we'll display a red character count at the bottom right of the CharFields, but still allow the user to exceed this limit if necessary?

In this case, will the hero_subheading field have a soft character limit of 80 characters but an actual character limit (declared in the model) of 250 characters?

@danielfmiranda
Copy link
Collaborator Author

Hi @AdalbertoMoz, thanks for checking!

You are correct. The maximum character count for the model field is 250 characters, and the CMS will prevent users from entering more than that.

However, with the soft character limit of 80. The number at the bottom right of the hero_subheading field will count down from 80 as the user types. Once they exceed the soft limit of 80, the count will turn red and show a negative number, but the user will still be able to submit successfully.

CharCounterWidget with Limit of 80 and an empty field:
Screenshot 2024-07-02 at 16-31-48 Editing App install page RegretsReporter Extension - Wagtail

CharCounterWidget with Limit of 80 and some text:
Screenshot 2024-07-02 at 16-31-39 Editing App install page RegretsReporter Extension - Wagtail

CharCounterWidget with text over the limit of 80:
Screenshot 2024-07-02 at 16-36-03 Editing App install page RegretsReporter Extension - Wagtail

Copy link
Contributor

@AdalbertoMoz AdalbertoMoz left a comment

Choose a reason for hiding this comment

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

Thanks much for the great explanation @danielfmiranda , awesome work! 👏

Copy link
Contributor

@TheoChevalier TheoChevalier left a comment

Choose a reason for hiding this comment

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

Thank you, working great!

@danielfmiranda danielfmiranda merged commit 068ab0c into main Jul 10, 2024
6 checks passed
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.

3 participants