Skip to content

Reduce left margin on the multi-expense report view - #97817

Merged
puneetlath merged 2 commits into
mainfrom
claude-reduceReportViewLeftMargin
Aug 19, 2026
Merged

puneetlath merged 2 commits into
mainfrom
claude-reduceReportViewLeftMargin

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

On wide web/desktop views, the report view for an expense report with multiple expenses opens as a "super-wide" sheet anchored to the right edge of the screen. Its width was windowWidth - sideBarWithLHBWidth (320) - navigationTabBarSize (72), which left a ~392px empty margin on the left, pushing table columns like Amount off the right edge and wasting horizontal space.

This change reduces that left margin to 147px so the sheet uses more of the available horizontal space while still reading as a sheet layered over the background (it is not full-screen). A new superWideRHPLeftMargin: 147 variable was added and calculateSuperWideRHPWidth now computes windowWidth - superWideRHPLeftMargin.

Scope is limited to exactly the requested case:

  • Only affects the super-wide RHP, which is used solely for the multi-expense report view (SearchMoneyRequestReportPage / WideRHPReceiptPanel, gated on more than one transaction).
  • Single-expense report/detail views use the separate "wide" width and are unchanged.
  • Narrow/mobile layouts already bypass this function (they render at 100% / the native no-op), so this is inherently wide-screen-only.

Fixed Issues

$ #97810
PROPOSAL:

Tests

  1. On a wide web/desktop viewport, open an expense report that contains more than one expense (the table view with columns like Merchant/Amount).
  2. Verify the report view sheet now leaves only a small (~147px) left margin and uses more horizontal space than before (previously ~392px).
  3. Open a single-expense report/detail view and verify its layout and margin are unchanged.
  4. Verify that no errors appear in the JS console.
  • Verify that no errors appear in the JS console

Offline tests

Same as tests (this is a layout-only change with no network dependency).

QA Steps

Same as tests.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Multi-expense report view — reduced ~147px left margin (measured, sheet edge at x=147):

Multi-expense report table view with reduced ~147px left margin

… screens

Co-authored-by: Shawn Borton <shawnborton@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🚧 shawnborton has triggered a test Expensify/App build. You can view the workflow run here.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

The only failing check is PR Author Checklist / checklist — and there's nothing in the code to fix.

It failed with You completed 0 out of 38 checklist items — i.e. the checkboxes in the PR description's PR Author Checklist are unchecked. Every actual build, test, lint, and typecheck job is passing (the other non-green items — baseline-perf-tests, branch-perf-tests, test (job 8), typecheck — are still pending, not failing).

This is a human-only checklist, so I can't (and shouldn't) tick the boxes on your behalf. To clear it, edit the PR description and check off the author checklist items once you've verified them, and the check will re-run and pass.

@codecov

codecov Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/styles/variables.ts 100.00% <ø> (ø)
...gation/helpers/calculateSuperWideRHPWidth/index.ts 0.00% <0.00%> (ø)
... and 71 files with indirect coverage changes

@github-actions

This comment has been minimized.

@shawnborton

Copy link
Copy Markdown
Contributor

@Expensify/design @Expensify/product @clarajones-expensify can you take this for a spin using the links above and let me know what you think?

This is what it looks like now:
CleanShot 2026-08-04 at 13 34 16@2x

@dannymcclain

Copy link
Copy Markdown
Contributor

It's feeling pretty good to me!

@clarajones-expensify

Copy link
Copy Markdown
Contributor

oooo i really like this @shawnborton !! thank you so much

@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

Definitely feels a bit too big to me, but if people want space then I guess this'll give them that

@shawnborton

Copy link
Copy Markdown
Contributor

@dubielzyk-expensify I'd be down to find a happy medium here! I was almost wondering if we should try to match the width of the LHN when it's collapsed?
CleanShot 2026-08-04 at 20 46 33@2x

@trjExpensify

Copy link
Copy Markdown
Contributor

I like the happy medium!

@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

Yeah that works 👍 I think going from a max-width to full-width with a gap will always cause some weirdness, but it's mostly gonna impact big monitor users. As long as it feels like there's sufficient room to make it look like a sheet and obvious how to navigate back that's fine. Your idea seems solid to me 👍

@shawnborton

Copy link
Copy Markdown
Contributor

@MelvinBot can we try 147px as the left margin instead of 108px? Please implement.

Co-authored-by: Shawn Borton <shawnborton@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

I looked into the failing checks — neither is a code failure, and neither can be fixed by pushing to the branch. Both are human-action gates:

  • checklist (PR Author Checklist) — Failing because 0 out of 38 checklist items are checked. This needs the PR author to fill out the checklist boxes in the PR description; it's not something code can satisfy.
  • Check independent approval — Failing with "does not have enough independent Expensify employee approvals" (approvers: [], independentApprovers: []). This requires an independent Expensify employee to review and approve the PR.

The remaining checks (typecheck, test jobs, perf, builds) were still pending when I looked and aren't failing. The actual diff is sound — it just adds a numeric superWideRHPLeftMargin: 147 constant and swaps it in for sideBarWithLHBWidth + navigationTabBarSize in the RHP width calc, which is type-safe.

To get these green: check the boxes in the author checklist, and have an independent reviewer approve. There's no code change for me to push here.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Re-checked — the picture is unchanged, and there's still no code fix to push. The two failing checks are both human-action gates:

Meanwhile all the code checks that were pending earlier — typecheck, test (jobs 1–8), Bun tests, ESLint, Storybook, check — have now passed. Only the perf tests are still running. The diff (adding superWideRHPLeftMargin: 147 and swapping it into the RHP width calc) is clean.

To turn these green: check the author checklist boxes and get an independent reviewer to approve. Nothing for me to change in code.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Done — updated superWideRHPLeftMargin from 108 → 147 in src/styles/variables.ts:126 and pushed to claude-reduceReportViewLeftMargin.

Verified on a wide web viewport: opened a multi-expense report and measured the super-wide sheet's left edge at x=147px (pixel color-transition from the grey backdrop to the sheet), with no layout breakage. Also updated the PR body/screenshot to reflect the new margin.

Multi-expense report sheet with ~147px left margin (measured at x=147)

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Re-checked — all code checks (typecheck, test jobs 1-8, perf, builds, lint) have now completed and passed. The only two remaining failures are the same human-action gates I flagged earlier, and neither is fixable by pushing code:

  • checklist (PR Author Checklist) — 0 out of 38 items checked. The author needs to fill out the checklist boxes in the PR description.
  • Check independent approval — reviewDecision: REVIEW_REQUIRED with no reviews yet. Needs an independent Expensify employee to review and approve.

There's no code change for me to push. To turn these green: fill out the author checklist and get an independent reviewer to approve.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🚧 shawnborton has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

LGTM 👍

@shawnborton

Copy link
Copy Markdown
Contributor

@MelvinBot please fill out the PR author checklist as best you can, add as many screenshots as you can, and then mark the PR ready for review.

@MelvinBot
MelvinBot marked this pull request as ready for review August 5, 2026 12:32
@MelvinBot
MelvinBot requested review from a team as code owners August 5, 2026 12:32
@melvin-bot
melvin-bot Bot requested review from ikevin127 and removed request for a team August 5, 2026 12:32
@melvin-bot
melvin-bot Bot removed the request for review from a team August 19, 2026 16:13
@melvin-bot

melvin-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

@mananjadhav 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]

@shawnborton

Copy link
Copy Markdown
Contributor

@ZhenjaHorbach sorry for the double ping, can you approve and then hopefully this goes to our internal team after that?

@melvin-bot

melvin-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

We did not find an internal engineer to review this PR, trying to assign a random engineer to #97810 as well as to this PR... Please reach out for help on Slack if no one gets assigned!

@melvin-bot
melvin-bot Bot requested a review from puneetlath August 19, 2026 16:14
@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

It's weird that it didn't work last time 😅

@shawnborton

Copy link
Copy Markdown
Contributor

No idea... but thanks for the approval!

@puneetlath puneetlath closed this Aug 19, 2026
@puneetlath puneetlath reopened this Aug 19, 2026
@puneetlath
puneetlath requested a review from a team as a code owner August 19, 2026 16:54
@melvin-bot
melvin-bot Bot requested review from ikevin127 and puneetlath and removed request for a team August 19, 2026 16:54
@melvin-bot

melvin-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

@ikevin127 @puneetlath One of you needs to 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]

@puneetlath
puneetlath merged commit 34ade80 into main Aug 19, 2026
55 of 87 checks passed
@puneetlath
puneetlath deleted the claude-reduceReportViewLeftMargin branch August 19, 2026 16:56
@github-actions

Copy link
Copy Markdown
Contributor

🚧 puneetlath has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify OSBotify mentioned this pull request Aug 20, 2026
61 tasks done
@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/puneetlath in version: 9.4.57-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 I reviewed the changes in this PR against the help site files under App/docs/articles.

No help site changes are required.

This is a purely visual/layout change: it reduces the empty left margin on the super-wide RHP (the multi-expense report view sheet on wide web/desktop) from ~392px to 147px by adding a superWideRHPLeftMargin variable and using it in calculateSuperWideRHPWidth. It only touches a CSS variable and its calculation — no feature, workflow, setting, tab, label, or user-facing behavior changes.

Why no docs update is needed
  • The help site documents what features do and how to use them (e.g., searching, filtering, and customizing columns in the Spend tab in Using Reports in New Expensify), not the pixel-level margin/width of a sheet.
  • I searched App/docs/articles for report view width, left margin, super-wide, and horizontal-space wording. The only match describes column customization, which is unaffected by this change.
  • The change is inherently wide-screen-only (narrow/mobile bypass this function) and makes the existing view use more horizontal space — the documented steps for viewing and customizing reports remain accurate.

@shawnborton, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review

(Note: since no docs changes are needed, no help site PR was created — there's nothing to mark ready for review.)


view run

@mitarachim

Copy link
Copy Markdown

Deploy Blocker #99035 was identified to be related to this PR.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/Beamanator in version: 9.4.57-3 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

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.