feat: Add ManualSendMessageVisible - #97789
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
73b40db to
221232f
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
PR doesn’t need product input as a perf PR. Unassigning and unsubscribing myself. |
|
@LukasMod Test 2, step 11 isn't working on web: Screen.Recording.2026-08-08.at.12.51.33.mov |
|
@Ollyws Could you explain exactly what is wrong in your video? I can’t see any difference in rendering between dev and staging. |
|
Seems like it was a problem on my end, feel free to ignore. |
Reviewer Checklist
Screenshots/Videos |
|
🚧 Julesssss has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/Julesssss in version: 9.4.53-0 🚀
|
|
🤖 No help site changes required — no draft docs PR was created. I reviewed the changes in this PR and they are entirely internal performance instrumentation, with no customer-facing impact. What this PR does: Adds a new observability span Why no docs are needed:
Since no help-site changes are needed, there is no linked help site PR to review. |





Explanation of Change
add
ManualSendMessageVisiblespan (onLayout-anchored) alongsideManualSendMessageWhat changed
Dual-emit: the existing
ManualSendMessagespan is untouched; a newManualSendMessageVisiblespan starts at the same moment with identical attributes and ends at the message'sonLayout(visibility) instead of the passive effect. After a comparison window in Sentry (~2 weeks), the effect-anchored span gets removed andManualSendMessageVisiblebecomes the metric.src/CONST/index.ts— newSPAN_SEND_MESSAGE_VISIBLE: 'ManualSendMessageVisible'.src/pages/inbox/report/ReportActionCompose/useComposerSubmit.ts— starts both spans back-to-back with the same attributes (report_id, message length, source, list weight).src/pages/inbox/report/comment/TextCommentFragment.tsxuseEffectendingManualSendMessagekept verbatim.onLayouthandler endsManualSendMessageVisible: on the existing outer<Text>(text path) and on a new plain<View onLayout>wrapper aroundRenderCommentHTML(HTML path — it has no layout hook of its own).src/hooks/useCancelSendMessageSpanOnSkeleton.ts— skeleton-cancel matches both ops. Prefix cancels (ReportLifecycleHandler,SearchMoneyRequestReportPage) cover the new span automatically sinceManualSendMessageis a prefix ofManualSendMessageVisible.Why
The span claims to measure "message sent → message visible", but its end is anchored in a passive effect.
onLayoutis the codebase convention for paint spans:open_reportwarm ends on the report list'sonLayout(ReportActionsList.tsx),ManualNavigateToReportsFirstPaint/ContentLoadend ononLayout(Search/index.tsx,SearchLoadingSkeleton.tsx), and theVisiblesuffix followsManualSubmitToDestinationVisible. The effect anchor insend-messagewas never a deliberate choice — PR #75551 piggybackedendSpanonto a pre-existinguseEffectthat held the legacyPerformance.markEnd(SEND_MESSAGE)call.Expected numbers
ManualSendMessageVisiblewill report higher durations thanManualSendMessage. That gap is the JS-thread post-commit burst + frame delivery the effect anchor never saw — honest user-perceived latency, not a regression. When the old span is retired, dashboards/alerts need recalibration to the new baseline.Validation plan
ManualSendMessagevsManualSendMessageVisibledistributions per platform for ~2 weeks (same start, same attributes — per-event delta is directly attributable to the anchor).SPAN_SEND_MESSAGEconstant usage inTextCommentFragment/useComposerSubmit, and the extra op check inuseCancelSendMessageSpanOnSkeleton.Risk
Viewwrapper around every HTML-path comment — verified layout-neutral (seeRENDER_COMMENT_HTML_TEST_MESSAGES.md/SEND_MESSAGE_SPAN_QA_TESTS.md).onLayoutalways fires on mount for both paths; skeleton/navigation cancel paths cover both spans.Fixed Issues
$ #97902
PROPOSAL:
Tests
Test 1 — plain text message
plain messageExpected: Message renders as before — alignment, width, spacing unchanged.
Test 2 — formatted (HTML) messages
Send each, compare rendering against staging/production side by side:
*bold* _italic_ ~strike~ normal`inline code` inside a sentence# Heading messagecheck https://staging.new.expensify.com/r/123 inline[labeled link](https://google.com)@<any user login> hello*bold with 😀 emoji* and text*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa*(long unbroken string)hello 😀 worldand😀😀😀(web renders these via the HTML path; native as plain text)Expected: Each message identical to staging/production — message width, code-block width, blockquote left border, mention pill, link styling, emoji size. No horizontal shift or extra vertical spacing.
Test 3 — edit and delete
*edit me*, then edit it to any other text.*delete me*, go offline, delete it.Expected: Edited label appears inline as before; deleted message shows strikethrough style; layout unchanged.
Test 5 — telemetry still fires (dev console, optional)
Expected: Two "Ending span" logs per sent message:
[Sentry][ManualSendMessage_<id>]and[Sentry][ManualSendMessageVisible_<id>], the Visible one with an equal or larger duration.Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari