@tuturuuu/ui 0.20.1 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +148 -0
- package/package.json +13 -5
- package/src/components/ui/custom/__tests__/workspace-select-helpers.test.ts +11 -0
- package/src/components/ui/custom/__tests__/workspace-select-reveal.test.tsx +88 -0
- package/src/components/ui/custom/app-error-boundary.test.tsx +40 -0
- package/src/components/ui/custom/app-error-boundary.tsx +176 -0
- package/src/components/ui/custom/workspace-select-reveal.tsx +46 -0
- package/src/components/ui/custom/workspace-select.tsx +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,153 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.22.0](https://github.com/tutur3u/platform/compare/ui-v0.21.0...ui-v0.22.0) (2026-07-27)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **calendar:** redesign workspace sidebar ([194e126](https://github.com/tutur3u/platform/commit/194e1267e573e50416f3866826e2a182b3ff8729))
|
|
9
|
+
* **contacts:** migrate reports + groups and complete the users cutover ([2ee89cd](https://github.com/tutur3u/platform/commit/2ee89cd2257c2a9824df53d4be99436416d85c13))
|
|
10
|
+
* **inventory:** complete Square commerce integration ([fe63eca](https://github.com/tutur3u/platform/commit/fe63eca7d02d94795f93fbbb471069b80c492020))
|
|
11
|
+
* **inventory:** secure Square POS event checkout ([532b463](https://github.com/tutur3u/platform/commit/532b46372116ee0bebfd83ba2af762cc9f668c3c))
|
|
12
|
+
* **landing:** retile the app bento and rebuild the problem section ([c56f42a](https://github.com/tutur3u/platform/commit/c56f42adf754362a269ff08b380db1ee0cf8c6ca))
|
|
13
|
+
* **navigation:** open workspace selector on reveal ([c760d42](https://github.com/tutur3u/platform/commit/c760d42b5e0b8f7bd141e26e2ace956b7f39912e))
|
|
14
|
+
* **offline:** own service worker runtime and refresh dependencies ([ae44477](https://github.com/tutur3u/platform/commit/ae44477603c39f0513244514771653287338a89f))
|
|
15
|
+
* **reports:** add periodic reporting automation ([ec7bd5e](https://github.com/tutur3u/platform/commit/ec7bd5e10abb137e217d1dcf143624530276392f))
|
|
16
|
+
* **satellite:** unify app switcher headers ([411a00c](https://github.com/tutur3u/platform/commit/411a00c9cbb584579e0d8f8e7fa4c2721c414ba3))
|
|
17
|
+
* **storefront:** refine the buyer experience ([45d0e76](https://github.com/tutur3u/platform/commit/45d0e763ff2adc858aa7c76024eb4554879b3977))
|
|
18
|
+
* **tasks:** add autonomous progress intelligence ([ba35df5](https://github.com/tutur3u/platform/commit/ba35df5485fb01e709bf651cc2083b5fa877560f))
|
|
19
|
+
* **tasks:** add leaderboard leave button and per-member sparklines ([5b65238](https://github.com/tutur3u/platform/commit/5b65238c5388345acebacc6cbc612c738cdc3079))
|
|
20
|
+
* **tasks:** make task management autonomous ([431212d](https://github.com/tutur3u/platform/commit/431212d471425aba7fcffdd37d77039d64bec643))
|
|
21
|
+
* **tasks:** promote progress tracking workspace ([058503a](https://github.com/tutur3u/platform/commit/058503a96c8df10725ecd3f88738d574760fc944))
|
|
22
|
+
* **tasks:** revamp progress, goals, analytics & leaderboards with TrackBear parity ([d1bda0e](https://github.com/tutur3u/platform/commit/d1bda0e37a6ed45eb22aaa3bb20c4d62dc41a19f))
|
|
23
|
+
* **tasks:** streamline bulk selection and progress ([3bd2934](https://github.com/tutur3u/platform/commit/3bd2934b3d2dce31b0be8a55ee553069df1f5b5d))
|
|
24
|
+
* **ui:** align landing and locale experience ([aa6e47f](https://github.com/tutur3u/platform/commit/aa6e47f17356ce74111ccf130e8b17071cc7aadf))
|
|
25
|
+
* **web:** improve workspace navigation context ([73959e3](https://github.com/tutur3u/platform/commit/73959e3c6745f60513d23740f30024c5d24e7ee4))
|
|
26
|
+
* **web:** redesign marketing landing page ([13ede78](https://github.com/tutur3u/platform/commit/13ede784ac03af9f25bbb7df61095826c335e002))
|
|
27
|
+
* **web:** refine marketing experience ([c7f1cec](https://github.com/tutur3u/platform/commit/c7f1cec0dd667e6d5f59aaf0bab82069b79c7376))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* **auth:** resume a pending sign-in after switching accounts ([5403718](https://github.com/tutur3u/platform/commit/54037189ee895863eac621239eb54b8ea94c6ed0))
|
|
33
|
+
* **calendar:** restore provider calendar management ([68753a8](https://github.com/tutur3u/platform/commit/68753a865dcc25a35cd53e5fc7ced1913b9a10bb))
|
|
34
|
+
* **chat:** stop Zalo phone sync spam ([b45e778](https://github.com/tutur3u/platform/commit/b45e778693f175b7bafcd00d6b3ec46f079a946c))
|
|
35
|
+
* **ci:** keep task helper collection source-only ([7355a05](https://github.com/tutur3u/platform/commit/7355a05385ccd8d1e2d1bcf6ac15ae5297e057ad))
|
|
36
|
+
* **ci:** resolve shared task helper during e2e collection ([0319a3b](https://github.com/tutur3u/platform/commit/0319a3bd0df12592b823b7cebdff38cea3e50836))
|
|
37
|
+
* **inventory:** correct storefront bundle checkout ([cb9c247](https://github.com/tutur3u/platform/commit/cb9c24740ceb77f9426ba640383a68bd9ed95d2c))
|
|
38
|
+
* **inventory:** polish mobile sales and settings ([59ef49c](https://github.com/tutur3u/platform/commit/59ef49cde2095361e2b13ce36848e1e39f772c18))
|
|
39
|
+
* **mail:** stabilize layout and managed sender identity ([a22205e](https://github.com/tutur3u/platform/commit/a22205e98a8671ffb628586107de09a7ba8dd1c4))
|
|
40
|
+
* **platform:** address attendance and invoice feedback ([8d2a537](https://github.com/tutur3u/platform/commit/8d2a53782d01427839607c7b0d90eaa3ecc5a1d8))
|
|
41
|
+
* **platform:** improve satellite workspace routing ([0c49c48](https://github.com/tutur3u/platform/commit/0c49c4882d26704fb16ba94ee289ab0af7deb4de))
|
|
42
|
+
* **platform:** persist settings dialog state ([04d2128](https://github.com/tutur3u/platform/commit/04d212807b6fabf33f43743c0b779ba9499334ba))
|
|
43
|
+
* resolve code quality findings ([63f10b5](https://github.com/tutur3u/platform/commit/63f10b5ec22a4194f48f448ee2b1b088b5da8f08))
|
|
44
|
+
* **satellite:** harden workspace settings translations ([7315a2d](https://github.com/tutur3u/platform/commit/7315a2da7b75fd1d66c1c89885aaebc857a44a19))
|
|
45
|
+
* **satellite:** restore mobile workspace settings ([e276f40](https://github.com/tutur3u/platform/commit/e276f4006175cfb501410b3875e661d3975c27f2))
|
|
46
|
+
* **satellite:** restore workspace settings access ([6b4c4f9](https://github.com/tutur3u/platform/commit/6b4c4f92b06b5a68d3116b744a1b8fa6dd9668d2))
|
|
47
|
+
* **security:** remediate code scanning findings ([023db2e](https://github.com/tutur3u/platform/commit/023db2edf4b0557be108a9d772cbc7e2223af947))
|
|
48
|
+
* **settings:** harden workspace role management ([0570687](https://github.com/tutur3u/platform/commit/0570687d255698e438d1eb02262ec0fa7c56240f))
|
|
49
|
+
* **settings:** repair satellite workspace management ([63614cd](https://github.com/tutur3u/platform/commit/63614cdd1550cbf7084724dbed728e798b6f979c))
|
|
50
|
+
* **tasks:** polish task card indicators ([d34966f](https://github.com/tutur3u/platform/commit/d34966fe8939dde56990718acada5a7899a990ed))
|
|
51
|
+
* **tasks:** preserve bulk task list rows ([5aac158](https://github.com/tutur3u/platform/commit/5aac158d38969be83499a5fec114197d0378bac7))
|
|
52
|
+
* **tasks:** quiet the description toolbar and name the compact action honestly ([51838a0](https://github.com/tutur3u/platform/commit/51838a08a1875a44cd4c7f539b35203f890e1a39))
|
|
53
|
+
* **tasks:** repair onboarding and external metadata ([e0b62eb](https://github.com/tutur3u/platform/commit/e0b62eb7119155f6e4cad3dc4fb4d0f9820c98e8))
|
|
54
|
+
* **tasks:** repair task media permissions ([28a0bf1](https://github.com/tutur3u/platform/commit/28a0bf1f1ff11359828a335ac81bb20860062942))
|
|
55
|
+
* **tasks:** restore task description on deep-link opens ([56d4efa](https://github.com/tutur3u/platform/commit/56d4efabd2f036e7dae39588d8aed7b129fa9a11))
|
|
56
|
+
* **tasks:** show one skeleton per task dialog open ([944288b](https://github.com/tutur3u/platform/commit/944288bdc869ee80b3cdf537ee10feb17fdada22))
|
|
57
|
+
* **tasks:** show select all for empty lists ([485ccd7](https://github.com/tutur3u/platform/commit/485ccd737d93d63d00cf582871a9055d819ba694))
|
|
58
|
+
* **tasks:** stabilize task card selection layout ([5754a9c](https://github.com/tutur3u/platform/commit/5754a9c9edcc1fdee5fff116cb809d3d2dc2bf8c))
|
|
59
|
+
* **tasks:** stop the task dialog remounting after it opens ([9a423da](https://github.com/tutur3u/platform/commit/9a423daf7e7c1e901a63ddcc1a8a94ddff9192c9))
|
|
60
|
+
* **ui:** make member management mobile responsive ([104c812](https://github.com/tutur3u/platform/commit/104c8120949ef34bfdc48da74fdc0e2d35eb4ce7))
|
|
61
|
+
* **ui:** prevent iOS form focus zoom ([a0e3f3c](https://github.com/tutur3u/platform/commit/a0e3f3cc10e0ef0676714857088ff8d2b826dcd2))
|
|
62
|
+
* **ui:** publish portable vendored dependencies ([99ad359](https://github.com/tutur3u/platform/commit/99ad35903a27b8f9df26f22fc5f1003aed363d6f))
|
|
63
|
+
* **ui:** refine member access settings ([b5b1ebf](https://github.com/tutur3u/platform/commit/b5b1ebf49a4a3b93532da74357899927f6e5d988))
|
|
64
|
+
* **ui:** unify workspace access and sidebar controls ([450183e](https://github.com/tutur3u/platform/commit/450183ef78af8e09a386bebb93be7018379c5152))
|
|
65
|
+
* **web:** harden prerender client boundaries ([ab1596a](https://github.com/tutur3u/platform/commit/ab1596a769e5a6ae43b0247c651ecbecea52d20d))
|
|
66
|
+
* **workspaces:** propagate a workspace rename without a page reload ([cca0b2d](https://github.com/tutur3u/platform/commit/cca0b2d7e14f6d72f1fdda1deaac18aaf07e9eee))
|
|
67
|
+
* **workspaces:** repair shared member administration ([8a1515b](https://github.com/tutur3u/platform/commit/8a1515ba970adbe690b9d92f77a447adb93c339f))
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### Performance Improvements
|
|
71
|
+
|
|
72
|
+
* **inventory:** add event-driven storefront caching ([2f571f4](https://github.com/tutur3u/platform/commit/2f571f4fc534bf5dee0ca36c4310d87b44e6e613))
|
|
73
|
+
* **storefront:** share customer navigation shell ([21cb78d](https://github.com/tutur3u/platform/commit/21cb78db484d1e1fdb9f2469fcac4e3a948bd176))
|
|
74
|
+
* **storefront:** stabilize navigation and cart rendering ([471c6b7](https://github.com/tutur3u/platform/commit/471c6b75abc6a4d69692e868cc1b220785e03262))
|
|
75
|
+
* **web:** reduce dashboard request overhead ([93f4b2b](https://github.com/tutur3u/platform/commit/93f4b2b354286b33c5cf8ff9ee0e54a31b18a022))
|
|
76
|
+
|
|
77
|
+
## [0.21.0](https://github.com/tutur3u/platform/compare/ui-v0.20.1...ui-v0.21.0) (2026-07-27)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
### Features
|
|
81
|
+
|
|
82
|
+
* **calendar:** redesign workspace sidebar ([194e126](https://github.com/tutur3u/platform/commit/194e1267e573e50416f3866826e2a182b3ff8729))
|
|
83
|
+
* **contacts:** migrate reports + groups and complete the users cutover ([2ee89cd](https://github.com/tutur3u/platform/commit/2ee89cd2257c2a9824df53d4be99436416d85c13))
|
|
84
|
+
* **inventory:** complete Square commerce integration ([fe63eca](https://github.com/tutur3u/platform/commit/fe63eca7d02d94795f93fbbb471069b80c492020))
|
|
85
|
+
* **inventory:** secure Square POS event checkout ([532b463](https://github.com/tutur3u/platform/commit/532b46372116ee0bebfd83ba2af762cc9f668c3c))
|
|
86
|
+
* **landing:** retile the app bento and rebuild the problem section ([c56f42a](https://github.com/tutur3u/platform/commit/c56f42adf754362a269ff08b380db1ee0cf8c6ca))
|
|
87
|
+
* **navigation:** open workspace selector on reveal ([c760d42](https://github.com/tutur3u/platform/commit/c760d42b5e0b8f7bd141e26e2ace956b7f39912e))
|
|
88
|
+
* **offline:** own service worker runtime and refresh dependencies ([ae44477](https://github.com/tutur3u/platform/commit/ae44477603c39f0513244514771653287338a89f))
|
|
89
|
+
* **reports:** add periodic reporting automation ([ec7bd5e](https://github.com/tutur3u/platform/commit/ec7bd5e10abb137e217d1dcf143624530276392f))
|
|
90
|
+
* **satellite:** unify app switcher headers ([411a00c](https://github.com/tutur3u/platform/commit/411a00c9cbb584579e0d8f8e7fa4c2721c414ba3))
|
|
91
|
+
* **storefront:** refine the buyer experience ([45d0e76](https://github.com/tutur3u/platform/commit/45d0e763ff2adc858aa7c76024eb4554879b3977))
|
|
92
|
+
* **tasks:** add autonomous progress intelligence ([ba35df5](https://github.com/tutur3u/platform/commit/ba35df5485fb01e709bf651cc2083b5fa877560f))
|
|
93
|
+
* **tasks:** add leaderboard leave button and per-member sparklines ([5b65238](https://github.com/tutur3u/platform/commit/5b65238c5388345acebacc6cbc612c738cdc3079))
|
|
94
|
+
* **tasks:** make task management autonomous ([431212d](https://github.com/tutur3u/platform/commit/431212d471425aba7fcffdd37d77039d64bec643))
|
|
95
|
+
* **tasks:** promote progress tracking workspace ([058503a](https://github.com/tutur3u/platform/commit/058503a96c8df10725ecd3f88738d574760fc944))
|
|
96
|
+
* **tasks:** revamp progress, goals, analytics & leaderboards with TrackBear parity ([d1bda0e](https://github.com/tutur3u/platform/commit/d1bda0e37a6ed45eb22aaa3bb20c4d62dc41a19f))
|
|
97
|
+
* **tasks:** streamline bulk selection and progress ([3bd2934](https://github.com/tutur3u/platform/commit/3bd2934b3d2dce31b0be8a55ee553069df1f5b5d))
|
|
98
|
+
* **ui:** align landing and locale experience ([aa6e47f](https://github.com/tutur3u/platform/commit/aa6e47f17356ce74111ccf130e8b17071cc7aadf))
|
|
99
|
+
* **web:** improve workspace navigation context ([73959e3](https://github.com/tutur3u/platform/commit/73959e3c6745f60513d23740f30024c5d24e7ee4))
|
|
100
|
+
* **web:** redesign marketing landing page ([13ede78](https://github.com/tutur3u/platform/commit/13ede784ac03af9f25bbb7df61095826c335e002))
|
|
101
|
+
* **web:** refine marketing experience ([c7f1cec](https://github.com/tutur3u/platform/commit/c7f1cec0dd667e6d5f59aaf0bab82069b79c7376))
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
### Bug Fixes
|
|
105
|
+
|
|
106
|
+
* **auth:** resume a pending sign-in after switching accounts ([5403718](https://github.com/tutur3u/platform/commit/54037189ee895863eac621239eb54b8ea94c6ed0))
|
|
107
|
+
* **calendar:** restore provider calendar management ([68753a8](https://github.com/tutur3u/platform/commit/68753a865dcc25a35cd53e5fc7ced1913b9a10bb))
|
|
108
|
+
* **chat:** stop Zalo phone sync spam ([b45e778](https://github.com/tutur3u/platform/commit/b45e778693f175b7bafcd00d6b3ec46f079a946c))
|
|
109
|
+
* **ci:** keep task helper collection source-only ([7355a05](https://github.com/tutur3u/platform/commit/7355a05385ccd8d1e2d1bcf6ac15ae5297e057ad))
|
|
110
|
+
* **ci:** resolve shared task helper during e2e collection ([0319a3b](https://github.com/tutur3u/platform/commit/0319a3bd0df12592b823b7cebdff38cea3e50836))
|
|
111
|
+
* **inventory:** correct storefront bundle checkout ([cb9c247](https://github.com/tutur3u/platform/commit/cb9c24740ceb77f9426ba640383a68bd9ed95d2c))
|
|
112
|
+
* **inventory:** polish mobile sales and settings ([59ef49c](https://github.com/tutur3u/platform/commit/59ef49cde2095361e2b13ce36848e1e39f772c18))
|
|
113
|
+
* **mail:** stabilize layout and managed sender identity ([a22205e](https://github.com/tutur3u/platform/commit/a22205e98a8671ffb628586107de09a7ba8dd1c4))
|
|
114
|
+
* **platform:** address attendance and invoice feedback ([8d2a537](https://github.com/tutur3u/platform/commit/8d2a53782d01427839607c7b0d90eaa3ecc5a1d8))
|
|
115
|
+
* **platform:** improve satellite workspace routing ([0c49c48](https://github.com/tutur3u/platform/commit/0c49c4882d26704fb16ba94ee289ab0af7deb4de))
|
|
116
|
+
* **platform:** persist settings dialog state ([04d2128](https://github.com/tutur3u/platform/commit/04d212807b6fabf33f43743c0b779ba9499334ba))
|
|
117
|
+
* resolve code quality findings ([63f10b5](https://github.com/tutur3u/platform/commit/63f10b5ec22a4194f48f448ee2b1b088b5da8f08))
|
|
118
|
+
* **satellite:** harden workspace settings translations ([7315a2d](https://github.com/tutur3u/platform/commit/7315a2da7b75fd1d66c1c89885aaebc857a44a19))
|
|
119
|
+
* **satellite:** restore mobile workspace settings ([e276f40](https://github.com/tutur3u/platform/commit/e276f4006175cfb501410b3875e661d3975c27f2))
|
|
120
|
+
* **satellite:** restore workspace settings access ([6b4c4f9](https://github.com/tutur3u/platform/commit/6b4c4f92b06b5a68d3116b744a1b8fa6dd9668d2))
|
|
121
|
+
* **security:** remediate code scanning findings ([023db2e](https://github.com/tutur3u/platform/commit/023db2edf4b0557be108a9d772cbc7e2223af947))
|
|
122
|
+
* **settings:** harden workspace role management ([0570687](https://github.com/tutur3u/platform/commit/0570687d255698e438d1eb02262ec0fa7c56240f))
|
|
123
|
+
* **settings:** repair satellite workspace management ([63614cd](https://github.com/tutur3u/platform/commit/63614cdd1550cbf7084724dbed728e798b6f979c))
|
|
124
|
+
* **tasks:** polish task card indicators ([d34966f](https://github.com/tutur3u/platform/commit/d34966fe8939dde56990718acada5a7899a990ed))
|
|
125
|
+
* **tasks:** preserve bulk task list rows ([5aac158](https://github.com/tutur3u/platform/commit/5aac158d38969be83499a5fec114197d0378bac7))
|
|
126
|
+
* **tasks:** quiet the description toolbar and name the compact action honestly ([51838a0](https://github.com/tutur3u/platform/commit/51838a08a1875a44cd4c7f539b35203f890e1a39))
|
|
127
|
+
* **tasks:** repair onboarding and external metadata ([e0b62eb](https://github.com/tutur3u/platform/commit/e0b62eb7119155f6e4cad3dc4fb4d0f9820c98e8))
|
|
128
|
+
* **tasks:** repair task media permissions ([28a0bf1](https://github.com/tutur3u/platform/commit/28a0bf1f1ff11359828a335ac81bb20860062942))
|
|
129
|
+
* **tasks:** restore task description on deep-link opens ([56d4efa](https://github.com/tutur3u/platform/commit/56d4efabd2f036e7dae39588d8aed7b129fa9a11))
|
|
130
|
+
* **tasks:** show one skeleton per task dialog open ([944288b](https://github.com/tutur3u/platform/commit/944288bdc869ee80b3cdf537ee10feb17fdada22))
|
|
131
|
+
* **tasks:** show select all for empty lists ([485ccd7](https://github.com/tutur3u/platform/commit/485ccd737d93d63d00cf582871a9055d819ba694))
|
|
132
|
+
* **tasks:** stabilize task card selection layout ([5754a9c](https://github.com/tutur3u/platform/commit/5754a9c9edcc1fdee5fff116cb809d3d2dc2bf8c))
|
|
133
|
+
* **tasks:** stop the task dialog remounting after it opens ([9a423da](https://github.com/tutur3u/platform/commit/9a423daf7e7c1e901a63ddcc1a8a94ddff9192c9))
|
|
134
|
+
* **ui:** make member management mobile responsive ([104c812](https://github.com/tutur3u/platform/commit/104c8120949ef34bfdc48da74fdc0e2d35eb4ce7))
|
|
135
|
+
* **ui:** prevent iOS form focus zoom ([a0e3f3c](https://github.com/tutur3u/platform/commit/a0e3f3cc10e0ef0676714857088ff8d2b826dcd2))
|
|
136
|
+
* **ui:** publish portable vendored dependencies ([99ad359](https://github.com/tutur3u/platform/commit/99ad35903a27b8f9df26f22fc5f1003aed363d6f))
|
|
137
|
+
* **ui:** refine member access settings ([b5b1ebf](https://github.com/tutur3u/platform/commit/b5b1ebf49a4a3b93532da74357899927f6e5d988))
|
|
138
|
+
* **ui:** unify workspace access and sidebar controls ([450183e](https://github.com/tutur3u/platform/commit/450183ef78af8e09a386bebb93be7018379c5152))
|
|
139
|
+
* **web:** harden prerender client boundaries ([ab1596a](https://github.com/tutur3u/platform/commit/ab1596a769e5a6ae43b0247c651ecbecea52d20d))
|
|
140
|
+
* **workspaces:** propagate a workspace rename without a page reload ([cca0b2d](https://github.com/tutur3u/platform/commit/cca0b2d7e14f6d72f1fdda1deaac18aaf07e9eee))
|
|
141
|
+
* **workspaces:** repair shared member administration ([8a1515b](https://github.com/tutur3u/platform/commit/8a1515ba970adbe690b9d92f77a447adb93c339f))
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
### Performance Improvements
|
|
145
|
+
|
|
146
|
+
* **inventory:** add event-driven storefront caching ([2f571f4](https://github.com/tutur3u/platform/commit/2f571f4fc534bf5dee0ca36c4310d87b44e6e613))
|
|
147
|
+
* **storefront:** share customer navigation shell ([21cb78d](https://github.com/tutur3u/platform/commit/21cb78db484d1e1fdb9f2469fcac4e3a948bd176))
|
|
148
|
+
* **storefront:** stabilize navigation and cart rendering ([471c6b7](https://github.com/tutur3u/platform/commit/471c6b75abc6a4d69692e868cc1b220785e03262))
|
|
149
|
+
* **web:** reduce dashboard request overhead ([93f4b2b](https://github.com/tutur3u/platform/commit/93f4b2b354286b33c5cf8ff9ee0e54a31b18a022))
|
|
150
|
+
|
|
3
151
|
## [0.20.1](https://github.com/tutur3u/platform/compare/ui-v0.20.0...ui-v0.20.1) (2026-07-27)
|
|
4
152
|
|
|
5
153
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuturuuu/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -86,13 +86,13 @@
|
|
|
86
86
|
"@tiptap/pm": "3.28.0",
|
|
87
87
|
"@tiptap/react": "3.28.0",
|
|
88
88
|
"@tiptap/starter-kit": "3.28.0",
|
|
89
|
-
"@tuturuuu/ai": "0.
|
|
89
|
+
"@tuturuuu/ai": "0.6.0",
|
|
90
90
|
"@tuturuuu/apis": "0.10.0",
|
|
91
91
|
"@tuturuuu/hooks": "0.1.0",
|
|
92
92
|
"@tuturuuu/icons": "0.1.0",
|
|
93
|
-
"@tuturuuu/internal-api": "0.
|
|
93
|
+
"@tuturuuu/internal-api": "0.24.0",
|
|
94
94
|
"@tuturuuu/supabase": "0.5.0",
|
|
95
|
-
"@tuturuuu/utils": "0.
|
|
95
|
+
"@tuturuuu/utils": "0.20.0",
|
|
96
96
|
"@types/debug": "^4.1.13",
|
|
97
97
|
"browser-image-compression": "^2.0.2",
|
|
98
98
|
"class-variance-authority": "^0.7.1",
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"@tanstack/react-table": "^8.21.3",
|
|
153
153
|
"@testing-library/jest-dom": "^7.0.0",
|
|
154
154
|
"@testing-library/react": "^16.3.2",
|
|
155
|
-
"@tuturuuu/types": "0.
|
|
155
|
+
"@tuturuuu/types": "0.23.0",
|
|
156
156
|
"@tuturuuu/typescript-config": "0.1.1",
|
|
157
157
|
"@types/html2canvas": "^1.0.0",
|
|
158
158
|
"@types/lodash": "^4.17.24",
|
|
@@ -322,6 +322,10 @@
|
|
|
322
322
|
"types": "./src/components/ui/custom/workspace-select.tsx",
|
|
323
323
|
"import": "./src/components/ui/custom/workspace-select.tsx"
|
|
324
324
|
},
|
|
325
|
+
"./custom/workspace-select-reveal": {
|
|
326
|
+
"types": "./src/components/ui/custom/workspace-select-reveal.tsx",
|
|
327
|
+
"import": "./src/components/ui/custom/workspace-select-reveal.tsx"
|
|
328
|
+
},
|
|
325
329
|
"./custom/notification-popover-client": {
|
|
326
330
|
"types": "./src/components/ui/custom/notification-popover-client.tsx",
|
|
327
331
|
"import": "./src/components/ui/custom/notification-popover-client.tsx"
|
|
@@ -334,6 +338,10 @@
|
|
|
334
338
|
"types": "./src/components/ui/custom/structure.tsx",
|
|
335
339
|
"import": "./src/components/ui/custom/structure.tsx"
|
|
336
340
|
},
|
|
341
|
+
"./custom/app-error-boundary": {
|
|
342
|
+
"types": "./src/components/ui/custom/app-error-boundary.tsx",
|
|
343
|
+
"import": "./src/components/ui/custom/app-error-boundary.tsx"
|
|
344
|
+
},
|
|
337
345
|
"./custom/settings-dialog-shell": {
|
|
338
346
|
"types": "./src/components/ui/custom/settings-dialog-shell.tsx",
|
|
339
347
|
"import": "./src/components/ui/custom/settings-dialog-shell.tsx"
|
|
@@ -85,6 +85,17 @@ describe('mergeWorkspaceSelectWorkspaces', () => {
|
|
|
85
85
|
expect(workspaceSelectSource).toContain('popoverModal = false');
|
|
86
86
|
expect(workspaceSelectSource).toContain('<Popover modal={popoverModal}');
|
|
87
87
|
});
|
|
88
|
+
|
|
89
|
+
it('focuses workspace search as soon as the picker opens', () => {
|
|
90
|
+
const workspaceSelectSource = readFileSync(
|
|
91
|
+
join(process.cwd(), 'src/components/ui/custom/workspace-select.tsx'),
|
|
92
|
+
'utf8'
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
expect(workspaceSelectSource).toContain(
|
|
96
|
+
'<CommandInput autoFocus placeholder="Search workspace..." />'
|
|
97
|
+
);
|
|
98
|
+
});
|
|
88
99
|
});
|
|
89
100
|
|
|
90
101
|
describe('normalizeWorkspaceSwitchPath', () => {
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { describe, expect, it } from 'vitest';
|
|
4
|
+
import {
|
|
5
|
+
useOpenWorkspaceSelectWhenRevealed,
|
|
6
|
+
WorkspaceSelectRevealProvider,
|
|
7
|
+
} from '../workspace-select-reveal';
|
|
8
|
+
|
|
9
|
+
function SelectorHarness({
|
|
10
|
+
hasSelectableWorkspaces,
|
|
11
|
+
}: {
|
|
12
|
+
hasSelectableWorkspaces: boolean;
|
|
13
|
+
}) {
|
|
14
|
+
const [open, setOpen] = useState(false);
|
|
15
|
+
useOpenWorkspaceSelectWhenRevealed(hasSelectableWorkspaces, setOpen);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
<output data-testid="selector-state">{open ? 'open' : 'closed'}</output>
|
|
20
|
+
<button type="button" onClick={() => setOpen(false)}>
|
|
21
|
+
Close selector
|
|
22
|
+
</button>
|
|
23
|
+
<button type="button" onClick={() => setOpen(true)}>
|
|
24
|
+
Open selector
|
|
25
|
+
</button>
|
|
26
|
+
</>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function TestTree({
|
|
31
|
+
hasSelectableWorkspaces = true,
|
|
32
|
+
revealed,
|
|
33
|
+
}: {
|
|
34
|
+
hasSelectableWorkspaces?: boolean;
|
|
35
|
+
revealed: boolean;
|
|
36
|
+
}) {
|
|
37
|
+
return (
|
|
38
|
+
<WorkspaceSelectRevealProvider revealed={revealed}>
|
|
39
|
+
<SelectorHarness hasSelectableWorkspaces={hasSelectableWorkspaces} />
|
|
40
|
+
</WorkspaceSelectRevealProvider>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
describe('WorkspaceSelectRevealProvider', () => {
|
|
45
|
+
it('opens the selector each time its collapsed sidebar section is revealed', () => {
|
|
46
|
+
const { rerender } = render(<TestTree revealed={false} />);
|
|
47
|
+
|
|
48
|
+
expect(screen.getByTestId('selector-state')).toHaveTextContent('closed');
|
|
49
|
+
|
|
50
|
+
rerender(<TestTree revealed />);
|
|
51
|
+
expect(screen.getByTestId('selector-state')).toHaveTextContent('open');
|
|
52
|
+
|
|
53
|
+
fireEvent.click(screen.getByRole('button', { name: 'Close selector' }));
|
|
54
|
+
expect(screen.getByTestId('selector-state')).toHaveTextContent('closed');
|
|
55
|
+
|
|
56
|
+
rerender(<TestTree revealed />);
|
|
57
|
+
expect(screen.getByTestId('selector-state')).toHaveTextContent('closed');
|
|
58
|
+
|
|
59
|
+
rerender(<TestTree revealed={false} />);
|
|
60
|
+
expect(screen.getByTestId('selector-state')).toHaveTextContent('closed');
|
|
61
|
+
|
|
62
|
+
rerender(<TestTree revealed />);
|
|
63
|
+
expect(screen.getByTestId('selector-state')).toHaveTextContent('open');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('waits for an available workspace before opening', () => {
|
|
67
|
+
const { rerender } = render(
|
|
68
|
+
<TestTree hasSelectableWorkspaces={false} revealed />
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
expect(screen.getByTestId('selector-state')).toHaveTextContent('closed');
|
|
72
|
+
|
|
73
|
+
rerender(<TestTree hasSelectableWorkspaces revealed />);
|
|
74
|
+
expect(screen.getByTestId('selector-state')).toHaveTextContent('open');
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('does not control workspace selectors outside a reveal section', () => {
|
|
78
|
+
const { rerender } = render(
|
|
79
|
+
<SelectorHarness hasSelectableWorkspaces={false} />
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
fireEvent.click(screen.getByRole('button', { name: 'Open selector' }));
|
|
83
|
+
expect(screen.getByTestId('selector-state')).toHaveTextContent('open');
|
|
84
|
+
|
|
85
|
+
rerender(<SelectorHarness hasSelectableWorkspaces />);
|
|
86
|
+
expect(screen.getByTestId('selector-state')).toHaveTextContent('open');
|
|
87
|
+
});
|
|
88
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
2
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
3
|
+
import { AppErrorBoundary } from './app-error-boundary';
|
|
4
|
+
|
|
5
|
+
describe('AppErrorBoundary', () => {
|
|
6
|
+
it('offers recovery actions and renders a safe error reference', () => {
|
|
7
|
+
const reset = vi.fn();
|
|
8
|
+
const error = Object.assign(new Error('sensitive provider response'), {
|
|
9
|
+
digest: 'safe-reference',
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
render(<AppErrorBoundary appName="Calendar" error={error} reset={reset} />);
|
|
13
|
+
|
|
14
|
+
expect(screen.getByText('This view could not load')).toBeInTheDocument();
|
|
15
|
+
expect(screen.getByText('safe-reference')).toBeInTheDocument();
|
|
16
|
+
expect(
|
|
17
|
+
screen.queryByText('sensitive provider response')
|
|
18
|
+
).not.toBeInTheDocument();
|
|
19
|
+
|
|
20
|
+
fireEvent.click(screen.getByRole('button', { name: 'Try again' }));
|
|
21
|
+
expect(reset).toHaveBeenCalledOnce();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('supports the Vietnamese recovery experience', () => {
|
|
25
|
+
render(
|
|
26
|
+
<AppErrorBoundary
|
|
27
|
+
error={new Error('hidden')}
|
|
28
|
+
locale="vi"
|
|
29
|
+
reset={vi.fn()}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
expect(
|
|
34
|
+
screen.getByRole('heading', {
|
|
35
|
+
name: 'Không thể tải giao diện này',
|
|
36
|
+
})
|
|
37
|
+
).toBeInTheDocument();
|
|
38
|
+
expect(screen.getByRole('button', { name: 'Thử lại' })).toBeInTheDocument();
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { AlertTriangle, ArrowLeft, Home, RefreshCcw } from '@tuturuuu/icons';
|
|
4
|
+
import { Button } from '@tuturuuu/ui/button';
|
|
5
|
+
import { cn } from '@tuturuuu/utils/format';
|
|
6
|
+
|
|
7
|
+
type BoundaryError = Error & { digest?: string };
|
|
8
|
+
|
|
9
|
+
interface AppErrorBoundaryProps {
|
|
10
|
+
appName?: string;
|
|
11
|
+
error: BoundaryError;
|
|
12
|
+
global?: boolean;
|
|
13
|
+
homeHref?: string;
|
|
14
|
+
locale?: string;
|
|
15
|
+
reset?: () => void;
|
|
16
|
+
unstable_retry?: () => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const COPY = {
|
|
20
|
+
en: {
|
|
21
|
+
badge: 'Recovery mode',
|
|
22
|
+
back: 'Go back',
|
|
23
|
+
description:
|
|
24
|
+
'Your work is safe. Reload this view to continue, or return to a stable page.',
|
|
25
|
+
details: 'Developer details',
|
|
26
|
+
home: 'Go home',
|
|
27
|
+
reference: 'Error reference',
|
|
28
|
+
retry: 'Try again',
|
|
29
|
+
title: 'This view could not load',
|
|
30
|
+
},
|
|
31
|
+
vi: {
|
|
32
|
+
badge: 'Chế độ khôi phục',
|
|
33
|
+
back: 'Quay lại',
|
|
34
|
+
description:
|
|
35
|
+
'Dữ liệu của bạn vẫn an toàn. Hãy tải lại giao diện này hoặc quay về một trang ổn định.',
|
|
36
|
+
details: 'Chi tiết cho nhà phát triển',
|
|
37
|
+
home: 'Về trang chính',
|
|
38
|
+
reference: 'Mã tham chiếu lỗi',
|
|
39
|
+
retry: 'Thử lại',
|
|
40
|
+
title: 'Không thể tải giao diện này',
|
|
41
|
+
},
|
|
42
|
+
} as const;
|
|
43
|
+
|
|
44
|
+
function resolveLocale(locale?: string) {
|
|
45
|
+
if (locale?.toLowerCase().startsWith('vi')) return 'vi';
|
|
46
|
+
if (locale?.toLowerCase().startsWith('en')) return 'en';
|
|
47
|
+
|
|
48
|
+
if (typeof document !== 'undefined') {
|
|
49
|
+
if (document.documentElement.lang.toLowerCase().startsWith('vi')) {
|
|
50
|
+
return 'vi';
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (typeof window !== 'undefined') {
|
|
55
|
+
const firstSegment = window.location.pathname.split('/').filter(Boolean)[0];
|
|
56
|
+
if (firstSegment === 'vi') return 'vi';
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return 'en';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function RecoveryView({
|
|
63
|
+
appName = 'Tuturuuu',
|
|
64
|
+
error,
|
|
65
|
+
global = false,
|
|
66
|
+
homeHref = '/',
|
|
67
|
+
locale,
|
|
68
|
+
reset,
|
|
69
|
+
unstable_retry,
|
|
70
|
+
}: AppErrorBoundaryProps) {
|
|
71
|
+
const copy = COPY[resolveLocale(locale)];
|
|
72
|
+
const retry = unstable_retry ?? reset;
|
|
73
|
+
const reference = error.digest;
|
|
74
|
+
const isDevelopment = process.env.NODE_ENV === 'development';
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<main
|
|
78
|
+
className={cn(
|
|
79
|
+
'relative isolate grid w-full place-items-center overflow-hidden bg-background px-4 py-10 text-foreground',
|
|
80
|
+
global ? 'min-h-screen' : 'min-h-[min(42rem,75vh)] rounded-2xl border'
|
|
81
|
+
)}
|
|
82
|
+
>
|
|
83
|
+
<div
|
|
84
|
+
className="pointer-events-none absolute inset-0 -z-10 opacity-70"
|
|
85
|
+
aria-hidden="true"
|
|
86
|
+
>
|
|
87
|
+
<div className="absolute -top-24 -left-24 size-72 rounded-full bg-destructive/10 blur-3xl" />
|
|
88
|
+
<div className="absolute -right-24 -bottom-24 size-80 rounded-full bg-primary/10 blur-3xl" />
|
|
89
|
+
<div className="absolute inset-0 bg-[linear-gradient(to_right,color-mix(in_oklab,currentColor_5%,transparent)_1px,transparent_1px),linear-gradient(to_bottom,color-mix(in_oklab,currentColor_5%,transparent)_1px,transparent_1px)] bg-[size:2.75rem_2.75rem] [mask-image:radial-gradient(ellipse_at_center,black,transparent_75%)]" />
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<section className="w-full max-w-xl rounded-3xl border bg-background/90 p-5 shadow-2xl shadow-black/10 backdrop-blur-xl sm:p-8">
|
|
93
|
+
<div className="flex items-start gap-4">
|
|
94
|
+
<div className="grid size-12 shrink-0 place-items-center rounded-2xl border border-destructive/20 bg-destructive/10 text-destructive">
|
|
95
|
+
<AlertTriangle className="size-6" aria-hidden="true" />
|
|
96
|
+
</div>
|
|
97
|
+
<div className="min-w-0">
|
|
98
|
+
<div className="font-medium text-muted-foreground text-xs uppercase tracking-[0.18em]">
|
|
99
|
+
{appName} · {copy.badge}
|
|
100
|
+
</div>
|
|
101
|
+
<h1 className="mt-2 text-balance font-semibold text-2xl tracking-tight sm:text-3xl">
|
|
102
|
+
{copy.title}
|
|
103
|
+
</h1>
|
|
104
|
+
<p className="mt-2 text-pretty text-muted-foreground text-sm leading-6 sm:text-base">
|
|
105
|
+
{copy.description}
|
|
106
|
+
</p>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
{reference ? (
|
|
111
|
+
<div className="mt-6 flex flex-wrap items-center gap-2 rounded-2xl border bg-muted/35 px-3 py-2.5 text-sm">
|
|
112
|
+
<span className="text-muted-foreground">{copy.reference}</span>
|
|
113
|
+
<code className="min-w-0 break-all rounded-md bg-background px-2 py-1 font-mono text-xs">
|
|
114
|
+
{reference}
|
|
115
|
+
</code>
|
|
116
|
+
</div>
|
|
117
|
+
) : null}
|
|
118
|
+
|
|
119
|
+
<div className="mt-6 grid gap-2 sm:grid-cols-[1fr_auto_auto]">
|
|
120
|
+
<Button
|
|
121
|
+
className="w-full gap-2"
|
|
122
|
+
onClick={() => retry?.()}
|
|
123
|
+
type="button"
|
|
124
|
+
>
|
|
125
|
+
<RefreshCcw className="size-4" aria-hidden="true" />
|
|
126
|
+
{copy.retry}
|
|
127
|
+
</Button>
|
|
128
|
+
<Button
|
|
129
|
+
className="w-full gap-2"
|
|
130
|
+
onClick={() => window.history.back()}
|
|
131
|
+
type="button"
|
|
132
|
+
variant="outline"
|
|
133
|
+
>
|
|
134
|
+
<ArrowLeft className="size-4" aria-hidden="true" />
|
|
135
|
+
{copy.back}
|
|
136
|
+
</Button>
|
|
137
|
+
<Button asChild className="w-full gap-2" variant="outline">
|
|
138
|
+
<a href={homeHref}>
|
|
139
|
+
<Home className="size-4" aria-hidden="true" />
|
|
140
|
+
{copy.home}
|
|
141
|
+
</a>
|
|
142
|
+
</Button>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
{isDevelopment && error.message ? (
|
|
146
|
+
<details className="mt-5 rounded-2xl border bg-muted/25 p-3 text-sm">
|
|
147
|
+
<summary className="cursor-pointer font-medium">
|
|
148
|
+
{copy.details}
|
|
149
|
+
</summary>
|
|
150
|
+
<pre className="mt-3 max-h-40 overflow-auto whitespace-pre-wrap break-words font-mono text-muted-foreground text-xs">
|
|
151
|
+
{error.message}
|
|
152
|
+
</pre>
|
|
153
|
+
</details>
|
|
154
|
+
) : null}
|
|
155
|
+
</section>
|
|
156
|
+
</main>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export function AppErrorBoundary(props: AppErrorBoundaryProps) {
|
|
161
|
+
return <RecoveryView {...props} />;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export function GlobalAppErrorBoundary(props: AppErrorBoundaryProps) {
|
|
165
|
+
const locale = resolveLocale(props.locale);
|
|
166
|
+
|
|
167
|
+
return (
|
|
168
|
+
<html lang={locale} suppressHydrationWarning>
|
|
169
|
+
<body className="min-h-screen bg-background">
|
|
170
|
+
<RecoveryView {...props} global />
|
|
171
|
+
</body>
|
|
172
|
+
</html>
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export type { AppErrorBoundaryProps, BoundaryError };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
createContext,
|
|
5
|
+
type Dispatch,
|
|
6
|
+
type ReactNode,
|
|
7
|
+
type SetStateAction,
|
|
8
|
+
useContext,
|
|
9
|
+
useEffect,
|
|
10
|
+
} from 'react';
|
|
11
|
+
|
|
12
|
+
const WorkspaceSelectRevealContext = createContext<boolean | null>(null);
|
|
13
|
+
|
|
14
|
+
export function WorkspaceSelectRevealProvider({
|
|
15
|
+
children,
|
|
16
|
+
revealed,
|
|
17
|
+
}: {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
revealed: boolean;
|
|
20
|
+
}) {
|
|
21
|
+
return (
|
|
22
|
+
<WorkspaceSelectRevealContext.Provider value={revealed}>
|
|
23
|
+
{children}
|
|
24
|
+
</WorkspaceSelectRevealContext.Provider>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function useOpenWorkspaceSelectWhenRevealed(
|
|
29
|
+
hasSelectableWorkspaces: boolean,
|
|
30
|
+
setOpen: Dispatch<SetStateAction<boolean>>
|
|
31
|
+
) {
|
|
32
|
+
const revealed = useContext(WorkspaceSelectRevealContext);
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (revealed === null) return;
|
|
36
|
+
|
|
37
|
+
if (!revealed) {
|
|
38
|
+
setOpen(false);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (revealed && hasSelectableWorkspaces) {
|
|
43
|
+
setOpen(true);
|
|
44
|
+
}
|
|
45
|
+
}, [hasSelectableWorkspaces, revealed, setOpen]);
|
|
46
|
+
}
|
|
@@ -72,6 +72,7 @@ import {
|
|
|
72
72
|
mergeWorkspaceSelectWorkspaces,
|
|
73
73
|
normalizeWorkspaceSwitchPath,
|
|
74
74
|
} from './workspace-select-helpers';
|
|
75
|
+
import { useOpenWorkspaceSelectWhenRevealed } from './workspace-select-reveal';
|
|
75
76
|
|
|
76
77
|
const FormSchema = z.object({
|
|
77
78
|
name: z.string().min(1).max(100),
|
|
@@ -449,6 +450,9 @@ export function WorkspaceSelect({
|
|
|
449
450
|
}
|
|
450
451
|
};
|
|
451
452
|
|
|
453
|
+
const hasSelectableWorkspaces = workspaces.length > 0;
|
|
454
|
+
useOpenWorkspaceSelectWhenRevealed(hasSelectableWorkspaces, setOpen);
|
|
455
|
+
|
|
452
456
|
const workspace =
|
|
453
457
|
wsId === PERSONAL_WORKSPACE_SLUG
|
|
454
458
|
? personalWorkspace
|
|
@@ -456,8 +460,6 @@ export function WorkspaceSelect({
|
|
|
456
460
|
guestWorkspaces.find((ws) => ws.id === resolvedWorkspaceId));
|
|
457
461
|
if (!wsId) return <div />;
|
|
458
462
|
|
|
459
|
-
const hasSelectableWorkspaces = workspaces.length > 0;
|
|
460
|
-
|
|
461
463
|
async function onJoinByHandleSubmit(
|
|
462
464
|
formData: z.infer<typeof JoinWorkspaceByHandleFormSchema>
|
|
463
465
|
) {
|
|
@@ -622,7 +624,7 @@ export function WorkspaceSelect({
|
|
|
622
624
|
</PopoverTrigger>
|
|
623
625
|
<PopoverContent className="w-full max-w-[16rem] p-0">
|
|
624
626
|
<Command>
|
|
625
|
-
<CommandInput placeholder="Search workspace..." />
|
|
627
|
+
<CommandInput autoFocus placeholder="Search workspace..." />
|
|
626
628
|
<CommandEmpty>No workspace found.</CommandEmpty>
|
|
627
629
|
<CommandList className="max-h-64">
|
|
628
630
|
{groups.map((group) => (
|