feat: Add ManualSendMessageVisible - #97789
Draft
LukasMod wants to merge 2 commits into
Draft
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.
|
LukasMod
force-pushed
the
feat/manual-send-message-visible
branch
from
August 4, 2026 12:42
73b40db to
221232f
Compare
Contributor
Author
|
@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". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
$
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