Skip to content

fix(Realime Composer): Various issues fixes - #41630

Merged
MartinSchoeler merged 7 commits into
poc/real-time-composerfrom
chore/realt-time-composer-review
Jul 30, 2026
Merged

fix(Realime Composer): Various issues fixes #41630
MartinSchoeler merged 7 commits into
poc/real-time-composerfrom
chore/realt-time-composer-review

Conversation

@MartinSchoeler

@MartinSchoeler MartinSchoeler commented Jul 29, 2026

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

Fixes

  • Composer no longer deletes text it cannot style. After every render the composer compares the rendered text against what was typed and, if a single character differs, falls back to the raw text. Any markdown the composer has no renderer for now shows as plain text instead of vanishing. (I-02)
  • Lists, tables, rules, timestamps and images survive typing. - item, 1. item, - [x] task, ---, GFM tables, <t:...> and ![alt](url) are rendered as their literal markup instead of being dropped. (I-02)
  • A single emoji no longer wipes the composer. Typing :smile: or one unicode emoji on an otherwise empty line used to blank the whole box. (I-02)
  • Emoji no longer move the caret. Shortcodes stay as text while typing instead of collapsing into a glyph, so the caret cannot jump mid-word and the sent message contains exactly what was typed. (I-06)
  • Headings keep everything in them. # hi :smile:, # hi *bold* and # hi @user used to lose everything after the plain text. (I-03)
  • Whitespace-only lines keep their spaces. Indentation typed on an empty line is no longer erased by the next render. (I-04)
  • Quote and heading spacing is no longer rewritten. >hi no longer gains a space it never had, and # hi no longer loses one — no phantom characters, no off-by-one caret. (I-05)
  • Removed the link placeholder substitution. Markdown links and URLs render as plain text; *a.com/x* keeps its bold, and typing [[[LINK_0]]] next to a URL no longer duplicates the URL. (I-07, I-01)
  • The composer can actually be disabled. disabled is inert on a contenteditable, so it now toggles contentEditable and is enforced in the keydown and paste handlers. Typing, pasting and pressing Enter are blocked while recording, while uploads are processing, and in channels the user has not joined — matching the classic composer. (I-11)
  • Composer text is hidden while recording audio, so it no longer shows behind the recorder controls. (I-11)
  • Drafts starting without parsing when reloading or swapping channels
  • Missing Drafts for threads
  • Missing placeholder text on composer
  • fix mismatching styles for code, mention, channel mention

Issue(s)

RTC-13
RTC-14
RTC-57
RTC-54
RTC-52
RTC-58
RTC-59
RTC-60
RTC-61
RTC-62
RTC-63
RTC-64
RTC-65
RTC-66
RTC-67
RTC-68
RTC-69
RTC-70
RTC-71

Steps to test or reproduce

Further comments

Review in cubic

Summary by CodeRabbit

  • New Features

    • Rich-text formatting now renders immediately while typing and when restoring drafts.
    • Composer content better preserves text, formatting, links, tables, and other markup during editing.
    • Added safer handling for unsupported or potentially unsafe content.
    • Thread composers now restore the appropriate thread-specific draft.
  • Bug Fixes

    • Improved caret positioning and text preservation during edits.
    • Empty composers remain empty after clearing content.
    • Disabled composers now prevent editing and accurately communicate their state.
    • Improved placeholder and visibility behavior.

@dionisio-bot

dionisio-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bf04e2b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The rich-text composer now preserves source text during markup rendering, restores drafts immediately, normalizes newline behavior, handles lossy parser output safely, selects thread drafts correctly, and exposes explicit disabled and hidden input states.

Changes

Rich-text composer rendering

Layer / File(s) Summary
Source-aware markup rendering
packages/gazzodown-alt/src/*, apps/meteor/app/ui-message/client/messageBox/renderComposerMarkup.tsx
Markup components now receive the original source, recover unsupported nodes through sourceOf, and share inline rendering for formatted content.
Content rendering and text preservation
apps/meteor/app/ui-message/client/messageBox/messageStateHandler.*, apps/meteor/app/ui-message/client/messageBox/renderComposerMarkup.spec.tsx
Composer rendering validates rendered text against the source and escapes raw text when characters are lost or added; tests cover caret offsets and lossy markup.
Draft restoration and text insertion
apps/meteor/app/ui-message/client/messageBox/createRichTextComposerAPI.*
Insertion and draft restoration render markup immediately, preserve selection behavior, normalize trailing newlines, and keep empty drafts empty.
Room composer state and interaction gating
apps/meteor/client/views/room/composer/messageBox/RichTextMessageBox.tsx
Thread and room drafts are selected separately, emoticons are disabled, typing normalizes newlines, and keyboard and paste handling use a shared disabled state.
Editable input accessibility and visibility
packages/ui-composer/src/MessageComposer/RichTextComposerInput.*
The input now supports hidden text, explicit content editability, aria-disabled, and disabled cursor styling with corresponding tests.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RichTextMessageBox
  participant renderComposerContent
  participant renderComposerMarkup
  participant ComposerMarkup
  RichTextMessageBox->>renderComposerContent: composer source and selection
  renderComposerContent->>renderComposerMarkup: parsed source
  renderComposerMarkup->>ComposerMarkup: source context and tokens
  ComposerMarkup-->>renderComposerMarkup: rendered composer markup
  renderComposerMarkup-->>renderComposerContent: HTML output
  renderComposerContent-->>RichTextMessageBox: updated content and selection
Loading

Possibly related PRs

Suggested labels: type: bug

Suggested reviewers: dougfabris, ggazzo, julia​​jfore​​st

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is related to the PR but too vague and generic to convey the main change. Use a concise, specific title that names the primary composer fixes, such as draft restoration, markdown preservation, or disabled-state handling.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (2)
  • RTC-13: Request failed with status code 401
  • RTC-14: Request failed with status code 401

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 37.28814% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.67%. Comparing base (10bdab0) to head (bf04e2b).

Additional details and impacted files

Impacted file tree graph

@@                    Coverage Diff                     @@
##           poc/real-time-composer   #41630      +/-   ##
==========================================================
- Coverage                   68.70%   68.67%   -0.04%     
==========================================================
  Files                        4163     4152      -11     
  Lines                      160745   160551     -194     
  Branches                    28246    28238       -8     
==========================================================
- Hits                       110442   110252     -190     
- Misses                      45127    45128       +1     
+ Partials                     5176     5171       -5     
Flag Coverage Δ
e2e 57.99% <4.44%> (-0.01%) ⬇️
e2e-api 45.59% <ø> (-0.03%) ⬇️
unit 70.76% <91.66%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MartinSchoeler
MartinSchoeler marked this pull request as ready for review July 30, 2026 15:33
@MartinSchoeler
MartinSchoeler requested a review from a team as a code owner July 30, 2026 15:33

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/meteor/client/views/room/composer/messageBox/RichTextMessageBox.tsx`:
- Around line 141-144: Remove the implementation rationale comments at
apps/meteor/client/views/room/composer/messageBox/RichTextMessageBox.tsx:141-144
and :286-287, and at
packages/ui-composer/src/MessageComposer/RichTextComposerInput.tsx:20-21. Leave
the surrounding parser-option, disabled-event, and prop-handling logic
unchanged.

In `@packages/gazzodown-alt/src/ComposerCodeElement.tsx`:
- Around line 7-11: Remove the unthemed mention highlight classes from the
mention rendering flow. Update ComposerCodeElement in
packages/gazzodown-alt/src/ComposerCodeElement.tsx, ComposerMentionChannel in
packages/gazzodown-alt/src/ComposerMentionChannel.tsx, and ComposerMentionUser
in packages/gazzodown-alt/src/ComposerMentionUser.tsx to use only existing
themed classes such as code-colors, preserving the current mention content and
rendering behavior.

In `@packages/gazzodown-alt/src/ComposerMarkup.tsx`:
- Around line 133-134: Update the BIG_EMOJI case in ComposerMarkup to append a
trailing newline to sourceOf(block, source), matching the other block renderers
and preserving line-by-line source reconstruction. Keep the existing
ComposerPlainSpan rendering behavior otherwise unchanged.
- Around line 41-145: Update ComposerMarkup’s block rendering so paragraph and
other block outputs do not add unconditional trailing newlines that duplicate
separate LINE_BREAK blocks. Preserve the exact number of inter-block blank lines
represented by LINE_BREAK tokens, while retaining required separators for
consecutive content blocks and round-tripping input such as “a\n\nb” unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f33c5e39-13ce-4670-992e-d261fd4aabf1

📥 Commits

Reviewing files that changed from the base of the PR and between 10bdab0 and bf04e2b.

📒 Files selected for processing (22)
  • apps/meteor/app/ui-message/client/messageBox/createRichTextComposerAPI.spec.ts
  • apps/meteor/app/ui-message/client/messageBox/createRichTextComposerAPI.ts
  • apps/meteor/app/ui-message/client/messageBox/messageStateHandler.spec.ts
  • apps/meteor/app/ui-message/client/messageBox/messageStateHandler.ts
  • apps/meteor/app/ui-message/client/messageBox/renderComposerMarkup.spec.tsx
  • apps/meteor/app/ui-message/client/messageBox/renderComposerMarkup.tsx
  • apps/meteor/client/views/room/composer/messageBox/RichTextMessageBox.tsx
  • packages/gazzodown-alt/src/ComposerBoldSpan.tsx
  • packages/gazzodown-alt/src/ComposerCodeBlock.tsx
  • packages/gazzodown-alt/src/ComposerCodeElement.tsx
  • packages/gazzodown-alt/src/ComposerEmojiElement.tsx
  • packages/gazzodown-alt/src/ComposerInlineElements.tsx
  • packages/gazzodown-alt/src/ComposerItalicSpan.tsx
  • packages/gazzodown-alt/src/ComposerLinkSpan.tsx
  • packages/gazzodown-alt/src/ComposerMarkup.tsx
  • packages/gazzodown-alt/src/ComposerMarkupContext.ts
  • packages/gazzodown-alt/src/ComposerMentionChannel.tsx
  • packages/gazzodown-alt/src/ComposerMentionUser.tsx
  • packages/gazzodown-alt/src/ComposerStrikeSpan.tsx
  • packages/gazzodown-alt/src/sourceOf.ts
  • packages/ui-composer/src/MessageComposer/RichTextComposerInput.spec.tsx
  • packages/ui-composer/src/MessageComposer/RichTextComposerInput.tsx
💤 Files with no reviewable changes (2)
  • packages/gazzodown-alt/src/ComposerEmojiElement.tsx
  • packages/gazzodown-alt/src/ComposerLinkSpan.tsx
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Hacktron Security Check
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • packages/gazzodown-alt/src/ComposerItalicSpan.tsx
  • packages/gazzodown-alt/src/ComposerMentionUser.tsx
  • packages/ui-composer/src/MessageComposer/RichTextComposerInput.spec.tsx
  • apps/meteor/app/ui-message/client/messageBox/renderComposerMarkup.tsx
  • packages/gazzodown-alt/src/sourceOf.ts
  • packages/gazzodown-alt/src/ComposerBoldSpan.tsx
  • packages/gazzodown-alt/src/ComposerCodeBlock.tsx
  • packages/gazzodown-alt/src/ComposerInlineElements.tsx
  • packages/gazzodown-alt/src/ComposerMarkupContext.ts
  • packages/ui-composer/src/MessageComposer/RichTextComposerInput.tsx
  • packages/gazzodown-alt/src/ComposerCodeElement.tsx
  • apps/meteor/app/ui-message/client/messageBox/messageStateHandler.ts
  • packages/gazzodown-alt/src/ComposerStrikeSpan.tsx
  • apps/meteor/app/ui-message/client/messageBox/createRichTextComposerAPI.ts
  • apps/meteor/app/ui-message/client/messageBox/messageStateHandler.spec.ts
  • apps/meteor/app/ui-message/client/messageBox/createRichTextComposerAPI.spec.ts
  • apps/meteor/app/ui-message/client/messageBox/renderComposerMarkup.spec.tsx
  • packages/gazzodown-alt/src/ComposerMarkup.tsx
  • apps/meteor/client/views/room/composer/messageBox/RichTextMessageBox.tsx
  • packages/gazzodown-alt/src/ComposerMentionChannel.tsx
**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use .spec.ts extension for test files (e.g., login.spec.ts)

Files:

  • apps/meteor/app/ui-message/client/messageBox/messageStateHandler.spec.ts
  • apps/meteor/app/ui-message/client/messageBox/createRichTextComposerAPI.spec.ts
🧠 Learnings (6)
📚 Learning: 2026-03-27T14:52:56.865Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39892
File: apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx:150-155
Timestamp: 2026-03-27T14:52:56.865Z
Learning: In Rocket.Chat, there are two different `ModalBackdrop` components with different prop APIs. During review, confirm the import source: (1) `rocket.chat/fuselage` `ModalBackdrop` uses `ModalBackdropProps` based on `BoxProps` (so it supports `onClick` and other Box/DOM props) and does not have an `onDismiss` prop; (2) `rocket.chat/ui-client` `ModalBackdrop` uses a narrower props interface like `{ children?: ReactNode; onDismiss?: () => void }` and handles Escape keypress and outside mouse-up, and it does not forward arbitrary DOM props such as `onClick`. Flag mismatched props (e.g., `onDismiss` passed to the fuselage component or `onClick` passed to the ui-client component) and ensure the usage matches the correct component being imported.

Applied to files:

  • packages/gazzodown-alt/src/ComposerItalicSpan.tsx
  • packages/gazzodown-alt/src/ComposerMentionUser.tsx
  • packages/ui-composer/src/MessageComposer/RichTextComposerInput.spec.tsx
  • apps/meteor/app/ui-message/client/messageBox/renderComposerMarkup.tsx
  • packages/gazzodown-alt/src/ComposerBoldSpan.tsx
  • packages/gazzodown-alt/src/ComposerCodeBlock.tsx
  • packages/gazzodown-alt/src/ComposerInlineElements.tsx
  • packages/ui-composer/src/MessageComposer/RichTextComposerInput.tsx
  • packages/gazzodown-alt/src/ComposerCodeElement.tsx
  • packages/gazzodown-alt/src/ComposerStrikeSpan.tsx
  • apps/meteor/app/ui-message/client/messageBox/renderComposerMarkup.spec.tsx
  • packages/gazzodown-alt/src/ComposerMarkup.tsx
  • apps/meteor/client/views/room/composer/messageBox/RichTextMessageBox.tsx
  • packages/gazzodown-alt/src/ComposerMentionChannel.tsx
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • packages/gazzodown-alt/src/ComposerItalicSpan.tsx
  • packages/gazzodown-alt/src/ComposerMentionUser.tsx
  • packages/ui-composer/src/MessageComposer/RichTextComposerInput.spec.tsx
  • apps/meteor/app/ui-message/client/messageBox/renderComposerMarkup.tsx
  • packages/gazzodown-alt/src/sourceOf.ts
  • packages/gazzodown-alt/src/ComposerBoldSpan.tsx
  • packages/gazzodown-alt/src/ComposerCodeBlock.tsx
  • packages/gazzodown-alt/src/ComposerInlineElements.tsx
  • packages/gazzodown-alt/src/ComposerMarkupContext.ts
  • packages/ui-composer/src/MessageComposer/RichTextComposerInput.tsx
  • packages/gazzodown-alt/src/ComposerCodeElement.tsx
  • apps/meteor/app/ui-message/client/messageBox/messageStateHandler.ts
  • packages/gazzodown-alt/src/ComposerStrikeSpan.tsx
  • apps/meteor/app/ui-message/client/messageBox/createRichTextComposerAPI.ts
  • apps/meteor/app/ui-message/client/messageBox/messageStateHandler.spec.ts
  • apps/meteor/app/ui-message/client/messageBox/createRichTextComposerAPI.spec.ts
  • apps/meteor/app/ui-message/client/messageBox/renderComposerMarkup.spec.tsx
  • packages/gazzodown-alt/src/ComposerMarkup.tsx
  • apps/meteor/client/views/room/composer/messageBox/RichTextMessageBox.tsx
  • packages/gazzodown-alt/src/ComposerMentionChannel.tsx
📚 Learning: 2026-03-06T18:10:15.268Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68
Timestamp: 2026-03-06T18:10:15.268Z
Learning: In tests (especially those using testing-library/dom/jsdom) for Rocket.Chat components, the HTML <code> element has an implicit ARIA role of 'code'. Therefore, screen.getByRole('code') or screen.findByRole('code') will locate <code> elements even without a role attribute. Do not flag findByRole('code') as invalid in reviews; prefer using the implicit role instead of adding role="code" unless necessary for accessibility.

Applied to files:

  • packages/ui-composer/src/MessageComposer/RichTextComposerInput.spec.tsx
  • apps/meteor/app/ui-message/client/messageBox/messageStateHandler.spec.ts
  • apps/meteor/app/ui-message/client/messageBox/createRichTextComposerAPI.spec.ts
  • apps/meteor/app/ui-message/client/messageBox/renderComposerMarkup.spec.tsx
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • packages/gazzodown-alt/src/sourceOf.ts
  • packages/gazzodown-alt/src/ComposerMarkupContext.ts
  • apps/meteor/app/ui-message/client/messageBox/messageStateHandler.ts
  • apps/meteor/app/ui-message/client/messageBox/createRichTextComposerAPI.ts
  • apps/meteor/app/ui-message/client/messageBox/messageStateHandler.spec.ts
  • apps/meteor/app/ui-message/client/messageBox/createRichTextComposerAPI.spec.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • packages/gazzodown-alt/src/sourceOf.ts
  • packages/gazzodown-alt/src/ComposerMarkupContext.ts
  • apps/meteor/app/ui-message/client/messageBox/messageStateHandler.ts
  • apps/meteor/app/ui-message/client/messageBox/createRichTextComposerAPI.ts
  • apps/meteor/app/ui-message/client/messageBox/messageStateHandler.spec.ts
  • apps/meteor/app/ui-message/client/messageBox/createRichTextComposerAPI.spec.ts
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.

Applied to files:

  • apps/meteor/app/ui-message/client/messageBox/messageStateHandler.spec.ts
  • apps/meteor/app/ui-message/client/messageBox/createRichTextComposerAPI.spec.ts
🪛 ast-grep (0.45.0)
apps/meteor/app/ui-message/client/messageBox/messageStateHandler.ts

[warning] 20-20: Direct HTML content assignment detected. Modifying innerHTML, outerHTML, or using document.write with unsanitized content can lead to XSS vulnerabilities. Use secure alternatives like textContent or sanitize HTML with libraries like DOMPurify.
Context: target.innerHTML = renderComposerMarkup(parse(source, parseOptions), source)
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation

(unsafe-html-content-assignment)


[warning] 25-25: Direct HTML content assignment detected. Modifying innerHTML, outerHTML, or using document.write with unsanitized content can lead to XSS vulnerabilities. Use secure alternatives like textContent or sanitize HTML with libraries like DOMPurify.
Context: target.innerHTML = escapeHTML(text)
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation

(unsafe-html-content-assignment)


[warning] 20-20: Direct modification of innerHTML or outerHTML properties detected. Modifying these properties with unsanitized user input can lead to XSS vulnerabilities. Use safe alternatives or sanitize content first.
Context: target.innerHTML = renderComposerMarkup(parse(source, parseOptions), source)
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation

(dom-content-modification)


[warning] 25-25: Direct modification of innerHTML or outerHTML properties detected. Modifying these properties with unsanitized user input can lead to XSS vulnerabilities. Use safe alternatives or sanitize content first.
Context: target.innerHTML = escapeHTML(text)
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation

(dom-content-modification)

apps/meteor/app/ui-message/client/messageBox/messageStateHandler.spec.ts

[warning] 25-25: Direct modification of innerHTML or outerHTML properties detected. Modifying these properties with unsanitized user input can lead to XSS vulnerabilities. Use safe alternatives or sanitize content first.
Context: document.body.innerHTML = ''
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation

(dom-content-modification)

apps/meteor/app/ui-message/client/messageBox/createRichTextComposerAPI.spec.ts

[warning] 163-163: Direct modification of innerHTML or outerHTML properties detected. Modifying these properties with unsanitized user input can lead to XSS vulnerabilities. Use safe alternatives or sanitize content first.
Context: document.body.innerHTML = ''
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation

(dom-content-modification)

🔇 Additional comments (18)
packages/gazzodown-alt/src/ComposerMarkupContext.ts (1)

3-10: LGTM!

apps/meteor/app/ui-message/client/messageBox/renderComposerMarkup.tsx (1)

6-10: LGTM!

packages/gazzodown-alt/src/ComposerMarkup.tsx (1)

90-127: LGTM on the new UNORDERED_LIST/ORDERED_LIST/TASKS renderers — the intentional prefix-normalization loss (e.g. * bullets → -) is already documented and covered by the "lossy" test suite in renderComposerMarkup.spec.tsx.

packages/gazzodown-alt/src/ComposerCodeBlock.tsx (1)

10-14: LGTM!

Also applies to: 23-27

apps/meteor/app/ui-message/client/messageBox/messageStateHandler.ts (1)

2-8: LGTM! The parse → render → sameText fallback design correctly protects the caret/text (and is safe against injection since renderComposerMarkup output is React-escaped and the fallback path runs through escapeHTML). See related comment on packages/gazzodown-alt/src/ComposerMarkup.tsx (Lines 41-145) regarding a gap this comparison surfaces for blank-line-separated multi-paragraph input.

Also applies to: 12-31

apps/meteor/app/ui-message/client/messageBox/messageStateHandler.spec.ts (1)

1-94: LGTM! Good coverage of the renderer-invocation contract, keep/fallback branches, and the HTML-injection-safety assertion (Lines 83-93).

apps/meteor/app/ui-message/client/messageBox/renderComposerMarkup.spec.tsx (1)

30-89: LGTM! Thorough parametrized coverage of text-exactness, caret round-trip, and the explicitly-documented lossy cases.

apps/meteor/app/ui-message/client/messageBox/createRichTextComposerAPI.ts (1)

56-63: LGTM! Correctly avoids re-rendering an empty composer into a non-empty trailing-newline state.

packages/gazzodown-alt/src/sourceOf.ts (5)

1-16: LGTM!


30-63: LGTM!


76-91: LGTM!


64-74: 🎯 Functional Correctness

No change needed.

The relevant autolink parser paths either preserve the typed label (src === label) or use the // prefix, so the current detection covers the parser-generated plain autolink shapes.


17-25: 🎯 Functional Correctness

No change needed.

Non-unicode emoji nodes are reconstructed from EmojiShortCode as :" + $[0-9a-zA-Z-_+.]+ + ":, so emoji.value.value equals the typed shortcode and won't substitute a resolver/preview form.

packages/gazzodown-alt/src/ComposerInlineElements.tsx (1)

3-62: LGTM!

packages/gazzodown-alt/src/ComposerBoldSpan.tsx (1)

4-19: LGTM!

packages/gazzodown-alt/src/ComposerItalicSpan.tsx (1)

4-18: LGTM!

packages/gazzodown-alt/src/ComposerStrikeSpan.tsx (1)

4-18: LGTM!

apps/meteor/app/ui-message/client/messageBox/createRichTextComposerAPI.spec.ts (1)

7-8: LGTM!

Also applies to: 110-143, 161-188

Comment thread packages/gazzodown-alt/src/ComposerCodeElement.tsx
Comment thread packages/gazzodown-alt/src/ComposerMarkup.tsx
Comment thread packages/gazzodown-alt/src/ComposerMarkup.tsx
@MartinSchoeler
MartinSchoeler merged commit 418d2fe into poc/real-time-composer Jul 30, 2026
54 of 56 checks passed
@MartinSchoeler
MartinSchoeler deleted the chore/realt-time-composer-review branch July 30, 2026 17:16
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.

2 participants