Repository navigation
Fix edit composer height to match the main composer - #99193
Conversation
Co-authored-by: Shawn Borton <shawnborton@users.noreply.github.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
✅ Android test passedRan the testing steps on standalone Android NewDot. The edit composer now renders the same height as the main composer — no visible extra tallness in edit mode. Steps performed:
Verification (pixel-level, not eyeballed): Sampling the composer's green border column at screen center in both screenshots, the pill's top border sat at y≈2146–2148 and bottom border at y≈2269–2271 in both images — a pixel-identical bounding box (~125px tall) in the same absolute position. No height discrepancy, and no JS console errors. EvidenceMain composer at rest after sending a single-line messageEdit composer opened via long-press > Edit comment, showing same height as main composer |
|
🚧 shawnborton has triggered a test Expensify/App build. You can view the workflow run here. |
|
This comment has been minimized.
This comment has been minimized.
|
@MelvinBot please mark the PR as ready for review, fill out PR author checklist as best you can and add screenshots |
|
@Eskalifer1 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
Done,
A few checklist items I left unchecked because they need a human or weren't covered:
Note: I couldn't automate the edit composer interaction on web (the web driver has no hover / Up-arrow primitive), so the web edit-composer evidence relies on your screenshot rather than an automated capture. The Android path was fully automated and pixel-verified. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8003cfdd65
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| // button within the compose box (minHeight componentSizeMedium) instead of adding vertical margin. | ||
| // The extra marginVertical left zero slack once composerSizeButton grew to 40px, which let the edit | ||
| // compose box round up past the main composer's height. See https://github.com/Expensify/App/issues/99143 | ||
| const closeButtonStyles = [styles.composerSizeButton]; |
There was a problem hiding this comment.
Keep the inline cancel button vertically centered
When editing an inline message, the button's wrapper uses justifyContent: 'flex-end' (ReportActionItemMessageEdit.tsx:419), so composerSizeButton.alignSelf only centers the button horizontally within that column and does not center it vertically. Removing the 3px vertical margins leaves the 40px button against the bottom of the 46px content area, placing it 3px below the main composer's action button; preserve equivalent inner spacing without contributing to the compose box's outer height.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
@MelvinBot can you please review this feedback?
There was a problem hiding this comment.
The feedback is correct — this needs a different approach. Removing marginVertical fixes the height, but it drops the cancel (X) button to the bottom of the compose box so it's no longer vertically centered (~3px low), which is what Eskalifer1's screenshot shows.
Why alignSelf doesn't save us here: the cancel button is wrapped in <View style={styles.justifyContentEnd}>. A React Native View defaults to flexDirection: 'column', so on that wrapper justifyContent: 'flex-end' controls the vertical (main) axis and pins the button to the bottom. composerSizeButton's alignSelf: 'center' (styles/index.ts:2558) only affects the horizontal (cross) axis in a column — it never vertically centers. So the code comment I added at MessageEditCancelButton.tsx:33-36 is mistaken on that point. The old marginVertical: 3 was exactly what produced the 3px bottom gap that made the button look centered.
Recommended fix: keep the height win (button footprint drops from 46px → 40px, restoring slack), but move the 3px of vertical spacing off the button and onto the wrapper, where it won't feed the compose box's intrinsic min-height:
- Add
paddingBottom: 3(i.e.composerSizeButton.marginHorizontal) to the cancel wrapper while keepingjustifyContent: 'flex-end'. The wrapper is already height-stretched by the row (alignItems: stretch), so padding doesn't grow the box — its intrinsic content becomes 40 + 3 = 43px, still comfortably under the 46px content area. This restores the 3px gap (centered at single line) and keeps the button bottom-pinned for multiline, consistent with the Submit button'salignSelfEndwrapper.
That preserves the height fix from #99143 without the vertical-centering regression.
For the record: my earlier Android pass verified the compose box height was pixel-identical, but it didn't measure the X button's position within the box — which is why this slipped through.
Want me to implement the paddingBottom change? Reply @MelvinBot implement the paddingBottom fix and I'll push it to this branch.
There was a problem hiding this comment.
@Eskalifer1 can you advise how you would like Melvin to fix this one?
There was a problem hiding this comment.
Done — pushed the paddingBottom fix in 359ca54.
What changed:
- Added a dedicated wrapper style
messageEditCancelButtonWrapper(justifyContent: 'flex-end'+paddingBottom: 3) and applied it to the cancel button wrapper atReportActionItemMessageEdit.tsx:419. - The button keeps its
marginVerticalremoved (height fix intact), and the 3px now lives on the wrapper as padding. Since the wrapper is height-stretched by the row, padding doesn't grow the compose box — intrinsic content is 40 + 3 = 43px, still under the 46px content area — so it restores the 3px gap that centers the X on a single line and stays bottom-pinned for multiline. - Also corrected the now-inaccurate code comment in
MessageEditCancelButton.tsx(it wrongly claimedalignSelfhandled vertical centering).
Checks: ESLint (0 new errors), typecheck (no src errors), oxfmt, and unused-styles all pass. React Compiler introduces no new errors — the pristine base fails with the identical 6 pre-existing ref-access errors, so my change adds none. The Jest suite couldn't bootstrap in this environment (a jest/setup.ts module-resolution failure that hits every test), and the web runtime check was blocked by a stuck/blank browser session — both infra issues, not related to this CSS change.
A reviewer should still eyeball the edit composer on web to confirm the X button now sits centered.
There was a problem hiding this comment.
Hi @shawnborton i will take a look at Monday, maybe i will find better fix, since i think this approach is more like a workaround
|
The two failing checks aren't code issues — they're process gates that only a human reviewer can clear, so there's nothing for me to push a fix for. Every code, build, lint, type, and test check is passing. ✅
Next step: get a reviewer to complete the checklist and approve — both checks will flip green on their own. No branch changes needed. |
|
Same situation as before — the only two failing checks aren't code issues, so there's still nothing to push a fix for. All code, build, lint, type, and test checks are green. ✅
Next step: these clear only through review — a reviewer needs to complete the checklist and approve. Re-running me won't change anything since there's no code fix involved. |
|
Still the same two — and neither is something I can push a fix for. All code, build, lint, type, and test checks are green. ✅
These are human-review gates, not code failures. Get a reviewer to complete the checklist and approve, and both will turn green on their own — no branch changes needed. |
|
Same as my earlier comment — nothing has changed, and there's still no code fix to push. The only two failing checks are human process gates:
Every code, build, lint, type, and test check is passing. ✅ These two will go green once a reviewer completes the checklist and approves — re-running me won't move them. |
|
Nothing to fix here — the only two failing checks are human-review gates, and every code, build, lint, type, and test check is passing. ✅
There's no branch change I can push to clear these. Next step: get a reviewer to complete the checklist and approve — both checks flip green on their own. |
|
Still the same two checks, and they're unchanged since my previous comment — both are human-only process gates, not code-fixable, so there's nothing for me to push:
Every code, build, lint, type, and test check is passing. ✅ The only way to turn these two green is a reviewer completing the checklist and approving — no branch changes will move them. |
|
Same result as before — there's no code fix to push. The only two failing checks are process gates that require a human, and every code, build, lint, type, and test check is passing. ✅
Next step: have a reviewer complete the checklist and approve — both checks flip green automatically. Nothing needs to change on the branch. |
|
Re-checked — same result as before. The only two failing checks are process gates that a human reviewer has to clear, not anything I can fix by pushing code. Every code, build, lint, type, and test check is green. ✅
Next step: have a reviewer complete the checklist and approve — both checks flip green on their own. There's no branch change to push. |
Co-authored-by: Shawn Borton <shawnborton@users.noreply.github.com>
|
Same situation as before — the only two failing checks are process gates, not anything I can fix by pushing code. Every code, build, lint, type, and test check is passing. ✅
There's no code fix to push here — these clear only when a human reviewer completes the checklist and approves. Once that happens, both flip green on their own. |
|
Still nothing code-fixable here — the only two failing checks are human-review gates, and every code, build, lint, type, and test check is passing. ✅
Neither is resolved by pushing to the branch, so there's no fix for me to commit. Once a reviewer completes the checklist and approves, both will turn green on their own. |
|
@MelvinBot Why don't we just remove this line: It fixes the isuue at the root instead of a workaround |
|
That Issue #99143 reproduces on MacOS/Chrome via the keyboard Up arrow = wide layout → The PR fixes exactly that inline path: it drops the cancel button's internal Fair point on line 23 — but it's a separate follow-up, not this fixYou're right that both paths share |
|
@MelvinBot You are not right. This issues is repro only on Here is the code diff: index a589c86699e..032c7b40ac0 100644
--- a/src/pages/inbox/report/ReportActionCompose/ComposerEditingButtons.tsx
+++ b/src/pages/inbox/report/ReportActionCompose/ComposerEditingButtons.tsx
@@ -15,14 +15,15 @@ function ComposerEditingButtons() {
const {deleteDraft} = useComposerEditActions();
- const editingButtonsContainerStyles = [
- styles.dFlex,
- styles.alignItemsCenter,
- styles.flexWrap,
- styles.justifyContentCenter,
- {paddingVertical: styles.composerSizeButton.marginHorizontal},
+ const editingButtonsContainerStyles = [styles.dFlex, styles.alignItemsCenter, styles.flexWrap, styles.justifyContentCenter];
+ const expandCollapseComposerButtonStyles = [
+ styles.flexGrow1,
+ styles.flexShrink0,
+ {marginRight: styles.composerSizeButton.marginHorizontal, marginVertical: styles.composerSizeButton.marginHorizontal},
];
- const expandCollapseComposerButtonStyles = [styles.flexGrow1, styles.flexShrink0, {marginRight: styles.composerSizeButton.marginHorizontal}];With this approach, it seems like everything is working, and I haven't found any problems. Can you check it? |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp99193-android-native.movAndroid: mWeb Chrome99193-android-web.moviOS: HybridApp99193-ios-native.moviOS: mWeb Safari99193-ios-web.movMacOS: Chrome / Safari99193-web.mov |
|
Where the bug actually repros: Issue #99143 was filed against Mac / Chrome, workspace chat in the main inbox, press Up arrow — that's a wide layout. So it does not repro "only" on What you got right: On your diff: it doesn't change the row height — it relocates the 6px rather than removing it. Today the container carries The reason it "works" in your testing is that this PR's actual fix is already doing the job on that path — it removes Net: your diff isn't wrong, but it's a cosmetic relocation of the same 3px, not a different fix — so it isn't needed on top of what's already here. If you specifically want Why the current PR is enough for both paths
I tried to grab a fresh pixel measurement on the |
|
@MelvinBot You are not right. I watched the video, and the bug only occurs when an empty report is open—that’s the The changes I sent you fix the original bug at its root. Root cause: Why moving the spacing fixes it: Container padding applies unconditionally, so it was charged to the height in exactly the state where nothing needed it: one button, already spaced by its own margin. Putting the 3px on the expand button instead makes it conditional on that button existing. In the single-line state there is no expand button, nothing is added, and the column measures 46px, which fits inside the content area and lets minHeight: 48 govern. The editing composer then matches the main composer at 48px. Why the expanded states keep their spacing. Once the expand button does render, the composer has grown past MAX_LINES_SMALL_SCREEN and the text input is what drives the box height. The column is being stretched rather than measured, so the margin no longer contributes height and only does positioning work: it holds the expand button 3px off the top while the cancel button's own margin holds it 3px off the bottom. The general shape of the fix is that spacing which must not count toward a parent's intrinsic height belongs on the child that is conditionally rendered, not on the container that is always there. The cancel button already followed that rule; the expand button now does too. |
|
Issue #99143's own steps are "3. Create an empty report. 4. Open the report." An empty report opens in a right-hand-pane modal, so But the current PR does already fix that in-composer path — because On your diff: it's a correct, valid alternative — it just relocates the same 6px (container So this is a style/ownership call between two working fixes, not a correct-vs-broken one — happy to defer to what Height math for the in-composer (`/e` / narrow) path
Both land the single-line column right at the 46px boundary. If you wanted actual slack rather than sitting on the line, the lever is removing the 6px (not relocating it) — the column would then measure 40px and be floored by Note: I couldn't grab a fresh web capture on the |
| // Drop the extra marginVertical the cancel button used to add: once composerSizeButton grew to 40px it | ||
| // left zero slack, so the edit compose box rounded up past the main composer's height. See | ||
| // https://github.com/Expensify/App/issues/99143. The 3px of vertical spacing now lives on the wrapper's | ||
| // paddingBottom (messageEditCancelButtonWrapper), which keeps the button centered on a single line | ||
| // without feeding the compose box's intrinsic min-height. |
There was a problem hiding this comment.
Happy to remove this comment (the marginVertical explainer block above closeButtonStyles) — but I can't push the change from here.
I can only make code changes when directed by the PR author, an assignee, or an existing co-author, and you're not currently listed as any of those on this PR (author/assignees are MelvinBot + shawnborton). To have me implement this, the PR assignee or author should reply with a request tagging me — or add you as an assignee and then retry.
If you're planning to swap in a cleaner fix on Monday as you mentioned, it may be simplest to drop these comments as part of that change.
There was a problem hiding this comment.
Done — removed the marginVertical explainer comment above closeButtonStyles in MessageEditCancelButton.tsx. The code is unchanged. Pushed in caddb9e.
| // The edit cancel button dropped its marginVertical so the compose box stops rounding up past the | ||
| // main composer (see https://github.com/Expensify/App/issues/99143). Restore the same 3px of inner | ||
| // spacing as paddingBottom here — on the wrapper it keeps the button visually centered on a single | ||
| // line without contributing to the compose box's intrinsic min-height. Matches composerSizeButton.marginHorizontal. |
There was a problem hiding this comment.
Happy to remove this comment (the messageEditCancelButtonWrapper explainer) — but I can't push the change from here.
I can only make code changes when directed by the PR author, an assignee, or an existing co-author, and you're not currently listed as any of those on this PR (author/assignees are MelvinBot + shawnborton). To have me implement this, the PR assignee or author should reply with a request tagging me — or add you as an assignee and then retry.
If you're planning to swap in a cleaner fix on Monday as you mentioned, it may be simplest to drop these comments as part of that change.
There was a problem hiding this comment.
Done — removed the explainer comment inside messageEditCancelButtonWrapper in src/styles/index.ts. The justifyContent/paddingBottom values are unchanged. Pushed in caddb9e.
|
Thanks
Both are safe to remove with no behavior change. I can strip them (and tidy the resulting blank lines) in one commit. I can only make code changes when directed by the PR author, an assignee, or an existing co-author. To have me implement this, the PR assignee or author (e.g. |
Eskalifer1
left a comment
There was a problem hiding this comment.
I have tested and it works well. Agree with Melv analysis here.
@shawnborton Please take a look at this comment
LGTM!
|
@MelvinBot please adjust the comments per @Eskalifer1's suggestions above |
Co-authored-by: Shawn Borton <shawnborton@users.noreply.github.com>
|
Still nothing for me to fix in code. The only failing check is Next step: get an independent reviewer to approve — that check will flip green on its own. No branch changes needed. |
|
Over to you @mollfpr |
|
🚧 shawnborton has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
Tests well on my end 👍 |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 mollfpr 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/mollfpr in version: 9.4.60-0 🚀
|
No help site changes requiredI reviewed the changes in this PR and no updates to Why: This is a purely visual CSS fix. It removes an extra The change touches only styling in three files — @shawnborton, since no docs changes are needed there's no linked help site PR to review. If you disagree and think an article should be updated, let me know which one and I'll draft it. |
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.4.60-2 🚀
Bundle Size Analysis (Sentry): |






Explanation of Change
Deploy blocker: the message edit composer renders slightly taller than the main composer (introduced in 9.4.58, staging-only).
Root cause: PR #98781 grew the shared
composerSizeButtonfrom 32×32 to 40×40. The edit composer's cancel (X) button — unlike the main composer's+button, which is absolutely positioned and contributes no height — sits in normal flow and additionally addsmarginVertical: composerSizeButton.marginHorizontal(3px). Its vertical footprint therefore became40 + 3 + 3 = 46px, which exactly equals the compose box's content area (minHeightcomponentSizeMedium= 48, minus the 2px border). With zero slack, sub-pixel rounding pushes the edit compose box just past 48px, while the main composer stays pinned at 48px. At the old 32px size there was 8px of slack, so production is unaffected.Fix: drop the extra
marginVerticalon the cancel button so its footprint (40px) sits well inside the 46px content area.composerSizeButtonalready hasalignSelf: 'center', so the button stays vertically centered, andminHeight: 48still floors the box — so the edit composer can't become shorter than the main composer either. This is the minimal change that removes the asymmetry the offending PR introduced.Fixed Issues
$ #99143
PROPOSAL:
Tests
Offline tests
N/A — this is a purely presentational (layout/sizing) change with no network dependency.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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
Pixel-level comparison confirmed the composer border box is identical (same top/bottom coordinates, ~125px tall) in both the main and edit composer.
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Edit composer renders at single-line height, matching the main composer.