fix: Table's last column doesn't resize properly
Description
Last table column will now resize down to a minimum width of 150px
Fixes #15843
Type of change
- Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
- Manually tested
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated |
|---|---|---|---|
| appsmith | ✅ Ready (Inspect) | Visit Preview | Sep 22, 2022 at 6:04AM (UTC) |
Unable to find test scripts. Please add necessary tests to the PR.
@sbalaji1192 Since we don't have a well defined target for cypress to drag and resize a table column we are proceeding with manual testing in this
Dynamic Column Resizing behaviour
- Only the last column’s width is dynamically adjusted just before rendering
- The dynamic resizing effect won’t kick in if more than one column is spilling out.
- Dynamic resizing will downsize the last column to a minimum of COLUMN_MIN_WIDTH (currently 60px)
- The adjusted width of the last column is softly set i.e. this adjusted width does not reflect in columnWidthMap. Hence we are able to retain the original width of the last column be it dynamically down sized or upsized.
- Since we retain the original width of the last column the original width will take effect as soon as this column is reordered to any other position. As a result in this scenario the new last column will now experience the effect of dynamic resizing.
This explains the current behaviour of the column resizing effect. Please take a look at this before we can move further @sbalaji1192 @dilippitchika
@souma-ghosh Please move on with QA. Will review it once its passes the QA cycle
Tested and verified.
/ok-to-test sha=f372d99
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3042913079.
Workflow: Appsmith External Integration Test Workflow.
Commit: f372d99.
PR: 16448.
UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/3042913079.
Commit: ``.
Results: Click to view performance test results
| | Run 1 (ms)| Run 2 (ms)| Run 3 (ms)| Run 4 (ms)| Run 5 (ms)| Minimum (ms)| Median (ms)| Mean (ms)| Range (%) | SD.Sample (%) | SD.Population (%)| | ------------- | ------------- | ------------- | ------------- | ------------- | ------------- | ------------- | ------------- | ------------- | ------------- | ------------- | SELECT_CATEGORY| | | | | | | | | | | | scripting | 377.9 | 357.39 | 383.71 | 334.85 | 334.47 | 334.47| 357.39| 357.66 | 13.77| 6.48 | 5.79| | painting | 5.85 | 4.2 | 9.14 | 3.4 | 3.38 | 3.38| 4.2| 5.19 | 110.98| 46.63 | 41.81| | rendering | 113.36 | 109.87 | 125.23 | 101.48 | 107.4 | 101.48| 109.87| 111.47 | 21.31| 7.92 | 7.09| BIND_TABLE_DATA| | | | | | | | | | | | scripting | 1116.45 | 1190.76 | 1066.1 | 911.82 | 987.34 | 911.82| 1066.1| 1054.49 | 26.45| 10.32 | 9.23| | painting | 28.36 | 19.36 | 24.08 | 18.43 | 22.62 | 18.43| 22.62| 22.57 | 44.00| 17.63 | 15.77| | rendering | 935.65 | 887.78 | 908.43 | 794.84 | 862.63 | 794.84| 887.78| 877.87 | 16.04| 6.11 | 5.46| CLICK_ON_TABLE_ROW| | | | | | | | | | | | scripting | 940.31 | 965.09 | 913.62 | 846.14 | 889.71 | 846.14| 913.62| 910.97 | 13.06| 5.05 | 4.51| | painting | 19.32 | 15.59 | 10.25 | 10.38 | 9.52 | 9.52| 10.38| 13.01 | 75.33| 32.90 | 29.44| | rendering | 326.94 | 325.87 | 327.07 | 309.53 | 325.33 | 309.53| 325.87| 322.95 | 5.43| 2.33 | 2.09| UPDATE_POST_TITLE| | | | | | | | | | | | scripting | 1487.23 | 1431.69 | 1376.81 | 1192.35 | 1386.41 | 1192.35| 1386.41| 1374.9 | 21.45| 8.07 | 7.22| | painting | 17.52 | 23.91 | 17.57 | 13.39 | 17.72 | 13.39| 17.57| 18.02 | 58.38| 20.87 | 18.70| | rendering | 495.01 | 494.28 | 495.85 | 443.58 | 482.59 | 443.58| 494.28| 482.26 | 10.84| 4.62 | 4.13| OPEN_MODAL| | | | | | | | | | | | scripting | 546.45 | 549.75 | 535.8 | 473.82 | 486.02 | 473.82| 535.8| 518.37 | 14.65| 6.89 | 6.17| | painting | 24.1 | 12.27 | 18.04 | 6.81 | 13.98 | 6.81| 13.98| 15.04 | 114.96| 43.02 | 38.50| | rendering | 396 | 416.6 | 403.58 | 353.47 | 388.96 | 353.47| 396| 391.72 | 16.12| 6.05 | 5.41| CLOSE_MODAL| | | | | | | | | | | | scripting | 318.87 | 301.38 | 336.97 | 255.14 | 276.58 | 255.14| 301.38| 297.79 | 27.48| 10.96 | 9.80| | painting | 6.11 | 10.88 | 13.77 | 4.25 | 8.68 | 4.25| 8.68| 8.74 | 108.92| 43.14 | 38.67| | rendering | 358.47 | 369.54 | 396.49 | 332.09 | 351.63 | 332.09| 358.47| 361.64 | 17.81| 6.57 | 5.88| SELECT_WIDGET_MENU_OPEN| | | | | | | | | | | | scripting | 939.84 | 1199.64 | 942.37 | 961.77 | 947.23 | 939.84| 947.23| 998.17 | 26.03| 11.31 | 10.12| | painting | 5.62 | 9.74 | 5.62 | 10.3 | 6.21 | 5.62| 6.21| 7.5 | 62.40| 30.93 | 27.73| | rendering | 631.74 | 830.98 | 603.51 | 639.56 | 635.17 | 603.51| 635.17| 668.19 | 34.04| 13.78 | 12.33| SELECT_WIDGET_SELECT_OPTION| | | | | | | | | | | | scripting | 188.61 | 237.02 | 150.27 | 164.89 | 165.12 | 150.27| 165.12| 181.18 | 47.88| 18.82 | 16.83| | painting | 2.97 | 5.9 | 12.2 | 10.77 | 3.57 | 2.97| 5.9| 7.08 | 130.37| 59.32 | 52.97| | rendering | 328.41 | 359.08 | 312.55 | 312.5 | 315.53 | 312.5| 315.53| 325.61 | 14.31| 6.09 | 5.45|
/ok-to-test sha=f372d99
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3051309893.
Workflow: Appsmith External Integration Test Workflow.
Commit: f372d99.
PR: 16448.
/ok-to-test sha=a38c8fe
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3065772592.
Workflow: Appsmith External Integration Test Workflow.
Commit: a38c8fe.
PR: 16448.
/ok-to-test sha=e1bcfe6
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3081498544.
Workflow: Appsmith External Integration Test Workflow.
Commit: e1bcfe6.
PR: 16448.
/ok-to-test sha=c04150a
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3088031227.
Workflow: Appsmith External Integration Test Workflow.
Commit: c04150a.
PR: 16448.
/ok-to-test sha=ad308bd
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3098530176.
Workflow: Appsmith External Integration Test Workflow.
Commit: ad308bd.
PR: 16448.
/ok-to-test sha=3b22d61
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3103166688.
Workflow: Appsmith External Integration Test Workflow.
Commit: 3b22d61.
PR: 16448.