Repository navigation
[CP Staging] fix: keep a capped column from claiming width it does not need - #102107
Conversation
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-09-23.at.10.08.10.PM.mov |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@situchan sorry, had to change the approach as the first one broke a few solver tests and would have narrowed capped columns on every dynamic table. Could you please re-test? |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
Reviewed at 🔴 1.
|
|
Tests good. But please check above ^ |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@MelvinBot review |
|
Re-reviewed at 🔴 New: the squeeze can now return a negative widthThe fall-through makes All-integer input, and worst case in the sweep was -216px. Reachability: latent, same shape as the Cheapest fix is to close the bottom of the clamp the same way you closed the top: return Math.min(Math.max(minWidth, minWidth + (desiredWidth - minWidth) * squeezeRatio), maxWidths.at(index) ?? 0);That's a no-op on the real squeeze path ( 🟡
|
| Invariant | Result |
|---|---|
No NaN/Infinity |
✅ 0 violations |
| No overflow when not scrolling | ✅ 6,593 → 0 on integer input vs main; worst case 435px → 0 |
| Scrolling covers the row | ✅ 0 violations |
| Integer widths | ✅ 0 violations for integer availableWidth (hence the Search note above) |
| No negative width | ❌ 0 on main → 89/250k here |
width <= maxWidth |
maxWidth only, from the Math.ceil(minWidth) branches; 0 on integer input |
So the fix does what it set out to do — the overflow that pushed the Assign button out is gone, and it's gone for the whole input space, not just the reported table.
Not verified: the UI. Reproducing it needs a workspace with a direct card feed plus Sage Intacct, which a throwaway test account can't have.
Next Steps: Reply with @MelvinBot <your feedback> to refine this review.
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@MelvinBot review |
|
lmk when this one is ready please |
|
Re-reviewed at ✅ Negative width is goneThe reported input now resolves cleanly: Zero negative widths across 2.4M randomized cases plus an exhaustive 171,875-case integer grid. Clamping Worth knowing: it's provably a no-op on well-formed input. When 🔵 The
|
| Invariant | e12beb1 vs 9af52d2 |
|---|---|
No NaN/non-finite |
equal (0) |
| No negative width | 0 vs 664 |
| No overflow when not scrolling | 4,050 vs 9,138 (main: 15,648) |
Integer widths for integer availableWidth |
equal (0) |
width <= maxWidth |
153,486 vs 197,720 |
| Scrolling covers the row | equal (0) |
width >= caller minWidth |
worse in raw count, but identical on every well-formed input — all differences are minWidth > contentWidth |
Pre-existing, not worth churn: Math.ceil on fractional minimums in the two early-return branches (line 188 and the zero-squeeze guard at line 201) can sum a hair above the row while reporting shouldScrollHorizontally: false. The guard adds one new instance of that pattern, but the total is still well below main (23,799 vs 31,315 per 1.2M well-formed cases), and it needs fractional minimums, which neither hook produces — everything is Math.ceil'd or an integer constant.
Not verified: the UI. Reproducing it needs a workspace with a direct card feed plus Sage Intacct, which a throwaway test account can't have.
Next Steps: Reply with @MelvinBot <your feedback> to refine this review.
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@JS00001 ready for your review. |
| * 3. The columns need more room than the row has, so they are squeezed toward their minimum widths, in proportion to | ||
| * how much room each has to give up. Free-text columns truncate as they shrink. A column holding a known, short set | ||
| * of values has its content width as its minimum, so it keeps every value in full. A table whose content fits but | ||
| * whose capped columns claim more than the row holds is resolved here too. |
There was a problem hiding this comment.
The inline comments are too long. Minify as much as possible
|
Re-reviewed at Two small accuracy points on the new wording, then the same two gaps. 🔵 "ignored" isn't what happens — it's capped
So the value still raises the minimum, just no further than the content. "Capped at the column's content width" would say it. 🔵 The minimum is also capped by
|
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
Final review at Since Evidence
Production inputs are all integers — The Non-blocking follow-ups
What I verified and what I didn'tVerified by running: the repo suite at Also confirmed: no column in the codebase sets Not verified: the UI. Reproducing it needs a workspace with a direct card feed plus a Sage Intacct connection, which a throwaway test account can't have, so I reviewed the layout math instead. Your recording and Next Steps: Reply with |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 lakchote 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! 🧪🧪
|
…umn-overflow [CP Staging] fix: keep a capped column from claiming width it does not need (cherry picked from commit d23683b) (cherry-picked to staging by lakchote)
|
🔁 Filed a Staging retest request for deploy blockers #102102 after this PR was cherry-picked to staging. |
|
🚀 Cherry-picked to staging by https://github.com/lakchote in version: 9.4.92-7 🚀
|
|
No help site changes are required, so I did not create a docs PR. This PR only changes how the table grid resolves its column widths — Nothing a help article documents changed: no new or renamed feature, tab, setting, field, or button, and no change to any workflow a user follows. What I checked
Separately, thanks for picking up the earlier review — the zero-denominator guard, capping
|
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.4.92-8 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Cherry-picked to staging by https://github.com/lakchote in version: 9.4.93-0 🚀
|
|
No help site changes are required, so I did not create a docs PR. This PR only changes internal layout math in the shared Nothing in the diff adds, renames, moves, or removes anything a help article describes:
The user-visible effect is that the Assign button and caret now render inside the table instead of spilling past its right edge. What I checked
I left out the "please review the linked help site PR" line from your template on purpose — there is no linked help site PR to review. Separately, and not caused by this PR: |
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.4.93-3 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Fixed Issues
$ #102102
PROPOSAL:
Tests
Offline tests
QA Steps
Same as tests
Verify that no errors appear in the JS console
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
Monosnap.screencast.2026-09-24.02-30-57.mp4