Skip to content

feat: add option to disable message preprocessing in the internal appconfiguration#21275

Open
MohamadJaara wants to merge 1 commit into
devfrom
mo/feat/add-option-to-disable-message-preprocessing
Open

feat: add option to disable message preprocessing in the internal appconfiguration#21275
MohamadJaara wants to merge 1 commit into
devfrom
mo/feat/add-option-to-disable-message-preprocessing

Conversation

@MohamadJaara
Copy link
Copy Markdown
Member

Adds an internal developer-menu flag to disable message preprocessing and markdown preview behavior in the composer.

The current preprocessing can alter messages in ways that make composing feel unpredictable, especially when typing or pasting exact text/code or URLs. This flag is a temporary bandage so messages can be sent closer to what was typed while we sort out the underlying composer/preprocessing behavior properly.

Notes

  • Keeps mentions and link previews working.
  • Disables markdown/format preprocessing in the input.
  • Sends raw text without automatic trimming when enabled.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 9, 2026

Codecov Report

❌ Patch coverage is 35.18519% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.94%. Comparing base (c5dd9d8) to head (5f5ffc7).

Files with missing lines Patch % Lines
...gins/PlainTextPastePlugin/PlainTextPastePlugin.tsx 6.66% 14 Missing ⚠️
.../script/components/ConfigToolbar/ConfigToolbar.tsx 0.00% 5 Missing ⚠️
...r/InputBarEditor/RichTextEditor/RichTextEditor.tsx 50.00% 1 Missing and 3 partials ⚠️
...p/src/script/util/debugMessagePreprocessingUtil.ts 62.50% 3 Missing ⚠️
...webapp/src/script/components/InputBar/InputBar.tsx 77.77% 1 Missing and 1 partial ⚠️
...BarEditor/RichTextEditor/utils/transformMessage.ts 33.33% 2 Missing ⚠️
...Editor/RichTextEditor/utils/useEditorDraftState.ts 33.33% 0 Missing and 2 partials ⚠️
apps/webapp/src/script/util/debugUtil.ts 0.00% 2 Missing ⚠️
...seMessageHandling/useMessageSend/useMessageSend.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #21275      +/-   ##
==========================================
- Coverage   44.95%   44.94%   -0.02%     
==========================================
  Files        1705     1707       +2     
  Lines       44906    44951      +45     
  Branches     9399     9413      +14     
==========================================
+ Hits        20187    20201      +14     
- Misses      22423    22449      +26     
- Partials     2296     2301       +5     
Flag Coverage Δ
app_webapp 43.07% <35.18%> (-0.02%) ⬇️
lib_api_client 51.72% <ø> (ø)
lib_core 58.81% <ø> (ø)

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

Files with missing lines Coverage Δ
...ponents/InputBar/InputBarEditor/InputBarEditor.tsx 100.00% <ø> (ø)
.../InputBar/useMessageHandling/useMessageHandling.ts 39.65% <ø> (ø)
...seMessageHandling/useMessageSend/useMessageSend.ts 23.88% <0.00%> (+0.35%) ⬆️
...webapp/src/script/components/InputBar/InputBar.tsx 61.42% <77.77%> (+3.36%) ⬆️
...BarEditor/RichTextEditor/utils/transformMessage.ts 40.00% <33.33%> (-10.00%) ⬇️
...Editor/RichTextEditor/utils/useEditorDraftState.ts 73.33% <33.33%> (-12.39%) ⬇️
apps/webapp/src/script/util/debugUtil.ts 0.00% <0.00%> (ø)
...p/src/script/util/debugMessagePreprocessingUtil.ts 62.50% <62.50%> (ø)
...r/InputBarEditor/RichTextEditor/RichTextEditor.tsx 64.28% <50.00%> (-6.55%) ⬇️
.../script/components/ConfigToolbar/ConfigToolbar.tsx 0.00% <0.00%> (ø)
... and 1 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.

@MohamadJaara MohamadJaara force-pushed the mo/feat/add-option-to-disable-message-preprocessing branch from 4cd860a to 5f5ffc7 Compare May 9, 2026 09:37
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 9, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

🔗 Download Full Report Artifact

🧪 Playwright Test Summary

  • Passed: 14
  • Failed: 0
  • Skipped: 0
  • 🔁 Flaky: 1
  • 📊 Total: 15
  • Total Runtime: 103.5s (~ 1 min 44 sec)
specs/CriticalFlow/oneOnOneCall-TC-8754.spec.ts (❌ 0 failed, ⚠️ 1 flaky)
  • ⚠️ 1:1 Video call with device switch and screenshare (tags: TC-8754, crit-flow-web)


const renderMessagePreprocessingSwitch = () => {
return (
<div style={{marginBottom: '10px'}}>
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.

We can move the CSS to configToolbar.styles.ts

{!disableMessagePreprocessing && (
<PastePlugin getMentionCandidates={getMentionCandidates} isPreviewMode={showMarkdownPreview} />
)}
{disableMessagePreprocessing && <PlainTextPastePlugin />}
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.

Suggested change
{disableMessagePreprocessing && <PlainTextPastePlugin />}
{disableMessagePreprocessing ? (<PlainTextPastePlugin />) : (
<PastePlugin getMentionCandidates={getMentionCandidates} isPreviewMode={showMarkdownPreview} />
)}


useEffect(() => {
const handleMessagePreprocessingChange = (event: Event) => {
setDisableMessagePreprocessing((event as CustomEvent<boolean>).detail ?? isMessagePreprocessingDisabled());
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.

Suggested change
setDisableMessagePreprocessing((event as CustomEvent<boolean>).detail ?? isMessagePreprocessingDisabled());
const isDisabled =
event instanceof CustomEvent && is.boolean(event.detail)
? event.detail
: isMessagePreprocessingDisabled();
setDisableMessagePreprocessing(isDisabled);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants