Files
webstudio/apps/builder/app/shared
Ivan Starkov cba00105db Sync pages change (#1856)
## Description

Changed pages synchronisation.

We had following path on link click in canvas:

- We intercept it in handleLinkClick and do publish('switchPage', {});
- We subscribe on 'switchPage' at builder and do navigate(builderPath, {
pageId});
- We subscribe on useSearchParams extract from there pageId and do
selectedPageIdStore.set(pageId)
- On Canvas we subscribe on selectedPageStore and finally render the
page

Now we just change
`selectedPageHashStore`, `selectedPageIdStore` in a single function
`switchPage`
`location.searchParams` used only for initial and popstate
synchronisation.


pageHashStore added for future use, no logic now.



## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-06-26 10:22:13 +04:00
..
2023-05-01 20:13:57 +02:00
2023-02-14 11:15:24 +01:00
2023-06-01 17:59:10 +04:00
2023-06-12 16:10:27 +04:00
2023-02-14 11:15:24 +01:00
2023-03-28 19:47:32 +04:00
2023-05-03 00:00:16 +02:00
2023-06-26 10:22:13 +04:00
2023-06-26 10:22:13 +04:00
2023-06-12 16:10:27 +04:00
2023-06-26 10:22:13 +04:00
2023-02-14 11:15:24 +01:00
2023-04-04 16:12:10 +03:00
2023-06-26 10:22:13 +04:00
2023-04-10 19:43:34 +04:00
2023-05-13 11:52:03 +04:00
2023-05-16 14:34:42 +03:00
2023-05-30 13:42:38 +07:00
2023-06-12 16:10:27 +04:00
2023-04-04 21:17:01 +04:00
2023-04-05 23:38:07 +04:00
2023-02-14 11:15:24 +01:00
2023-02-14 11:15:24 +01:00