Skip to content

Limit custom status text to 30 characters - #35034

Merged
dbkr merged 5 commits into
element-hq:developfrom
Tyagiquamar:tyagiquamar-fix-space-notification-settings-35017
Sep 16, 2026
Merged

dbkr merged 5 commits into
element-hq:developfrom
Tyagiquamar:tyagiquamar-fix-space-notification-settings-35017

Conversation

@Tyagiquamar

Copy link
Copy Markdown
Contributor

Fixes #34983

The custom status editor did not enforce the product's 30-character limit. Add the native maxLength constraint and a regression test.

@Tyagiquamar
Tyagiquamar requested a review from a team as a code owner September 10, 2026 13:59
@github-actions github-actions Bot added the Z-Community-PR Issue is solved by a community member's PR label Sep 10, 2026

@Half-Shot Half-Shot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We probably also want to have limits on the rendering side, so clients can't send more than 30 characters to us. I suspect just having it ellipsis is fine.

@CLAassistant

CLAassistant commented Sep 10, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@t3chguy

t3chguy commented Sep 11, 2026

Copy link
Copy Markdown
Member

I think the MSC should be updated first

@dbkr dbkr added the T-Defect label Sep 15, 2026
@dbkr

dbkr commented Sep 15, 2026

Copy link
Copy Markdown
Member

I've added 30 characters as a guideline max length (matrix-org/matrix-spec-proposals@13b108d): @t3chguy does that seem okay to you?

@dbkr

dbkr commented Sep 15, 2026

Copy link
Copy Markdown
Member

This probably isn't a great way to do this as at least chrome's maxLength appears to be by bytes rather than graphemes, so if you pick the wrong characters, the max length actually looks like this:

Screenshot 2026-09-15 at 13 12 54

Comment thread packages/shared-components/src/status/CustomStatusView.test.tsx Outdated
Native input maxLength counts UTF-16 code units, so emoji was clipped.
Limit composed and received status text by grapheme cluster instead.
Comment thread packages/shared-components/src/core/userStatus.test.ts Outdated
Comment thread packages/shared-components/src/core/userStatus.test.ts Outdated
Comment thread apps/web/src/utils/userStatus.ts Outdated
Keep the grapheme-aware input limit and 256-byte protocol cap.
Drop display-time ellipsis so that can be done with CSS later.
@dbkr
dbkr added this pull request to the merge queue Sep 16, 2026
Merged via the queue into element-hq:develop with commit b5fce7f Sep 16, 2026
59 of 61 checks passed

This branch was successfully deployed

3 active deployments
EndToEndTests — b4c60015 Deployed Sep 16, 2026 by github-actions[bot]
Netlify — b4c60015 Deployed Sep 16, 2026 by github-actions[bot]
SharedComponentStorybook — b4c60015 Deployed Sep 16, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-Defect Z-Community-PR Issue is solved by a community member's PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom status text is not limited to 30 characters

5 participants