@tuturuuu/ui 0.20.1 → 0.21.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 +74 -0
- package/package.json +9 -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/workspace-select-reveal.tsx +46 -0
- package/src/components/ui/custom/workspace-select.tsx +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,79 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.21.0](https://github.com/tutur3u/platform/compare/ui-v0.20.1...ui-v0.21.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
|
+
|
|
3
77
|
## [0.20.1](https://github.com/tutur3u/platform/compare/ui-v0.20.0...ui-v0.20.1) (2026-07-27)
|
|
4
78
|
|
|
5
79
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuturuuu/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.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.5.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.23.0",
|
|
94
94
|
"@tuturuuu/supabase": "0.5.0",
|
|
95
|
-
"@tuturuuu/utils": "0.
|
|
95
|
+
"@tuturuuu/utils": "0.19.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.22.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"
|
|
@@ -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,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) => (
|