Commit f1b4a11
authored
[Fix] MPA page layout (#9479)
## Describe your changes
This PR addresses 2 issues with layout in both MPA v1 and v2 --
* default page layout (centered) is not respected when navigating *from*
a wide layout page
* when a page's layout is dynamic, e.g. changeable based on user
interaction, navigating back to that page does not preserve the last set
layout
The proposed changes now preserve the layouts for each page in an MPA,
by storing the mapping of `page script hash <> layout` in React state on
page change. The layout of the page to be rendered will be looked up in
every new session handling, defaulting to centered.
Demo: https://multipage-layout-fix.streamlit.app/
## GitHub Issue Link
#6237
## Testing Plan
- Explanation of why no additional tests are needed
- Unit Tests (JS and/or Python)
- E2E Tests
- Any manual testing needed?
---
**Contribution License Agreement**
By submitting this pull request you agree that all contributions to this
project are made under the Apache 2.0 license.1 parent 57c5569 commit f1b4a11
File tree
17 files changed
+302
-1
lines changed- e2e_playwright
- __snapshots__/linux/mpa_basics_test
- multipage_apps_v2
- multipage_apps
- pages
- frontend/app/src
17 files changed
+302
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
0 commit comments