@bevel-software/platform-core-frontend 0.25.2 → 0.27.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/package.json +2 -2
- package/src/core/CoreAppShell.tsx +87 -25
- package/src/core/ProductName.tsx +49 -0
- package/src/core/__tests__/ShellRoutes.test.tsx +22 -0
- package/src/core/__tests__/core-contributions.test.ts +16 -0
- package/src/core/core-contributions.ts +17 -0
- package/src/core/registry.ts +51 -1
- package/src/index.css +23 -5
- package/src/index.ts +5 -0
- package/src/modules/access/__tests__/ManageAccessDialog.proposal.test.tsx +1 -1
- package/src/modules/access/components/ManageAccessDialog.tsx +1 -1
- package/src/modules/admin/__tests__/RolesCorruptedBanner.test.tsx +70 -0
- package/src/modules/admin/components/RolesCorruptedBanner.tsx +9 -4
- package/src/modules/auth/components/LoginScreen.tsx +4 -1
- package/src/modules/auth/services/account.api.ts +28 -1
- package/src/modules/auth/services/sso.ts +1 -2
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.sync-banner.test.tsx +176 -0
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.unreadable.test.tsx +68 -0
- package/src/modules/change-requests/__tests__/ChangeRequestLink.test.tsx +182 -0
- package/src/modules/change-requests/__tests__/FileChangeBoxes.test.tsx +1 -1
- package/src/modules/change-requests/__tests__/readFileOnBranch.test.ts +79 -0
- package/src/modules/change-requests/components/ChangeBox.tsx +6 -1
- package/src/modules/change-requests/components/ChangeRequestDialog.tsx +45 -15
- package/src/modules/change-requests/components/ChangeRequestLink.tsx +151 -0
- package/src/modules/change-requests/components/CrFileTree.tsx +2 -1
- package/src/modules/change-requests/components/FileChangeBoxes.tsx +4 -2
- package/src/modules/change-requests/hooks/useApplyChangeRequest.ts +6 -3
- package/src/modules/change-requests/services/change-requests.api.ts +15 -2
- package/src/modules/change-requests/utils/readFailure.ts +22 -0
- package/src/modules/embed/__tests__/EmbedLinkPage.test.tsx +74 -0
- package/src/modules/embed/__tests__/EmbedView.test.tsx +473 -0
- package/src/modules/embed/__tests__/embed-config.test.ts +128 -0
- package/src/modules/embed/__tests__/embed-host.test.ts +111 -0
- package/src/modules/embed/__tests__/mcp-app-view.test.ts +295 -0
- package/src/modules/embed/__tests__/mount.test.tsx +157 -0
- package/src/modules/embed/components/EmbedLinkPage.tsx +109 -0
- package/src/modules/embed/components/EmbedView.tsx +545 -0
- package/src/modules/embed/embed-config.ts +132 -0
- package/src/modules/embed/embed-host.ts +120 -0
- package/src/modules/embed/mount.tsx +80 -0
- package/src/modules/embed/services/embed-token.ts +22 -0
- package/src/modules/embed/services/embed.api.ts +158 -0
- package/src/modules/git/__tests__/BranchSwitcher.test.tsx +202 -4
- package/src/modules/git/__tests__/GitSyncFailedBanner.test.tsx +59 -1
- package/src/modules/git/__tests__/PullNeededBanner.test.tsx +39 -22
- package/src/modules/git/__tests__/useAutoPullUpdates.test.tsx +7 -2
- package/src/modules/git/branch-delete-menu-item.tsx +24 -0
- package/src/modules/git/components/BranchSwitcher.tsx +29 -5
- package/src/modules/git/components/GitSyncFailedBanner.tsx +53 -15
- package/src/modules/git/components/HistoryVersionPreview.tsx +5 -3
- package/src/modules/git/components/PullNeededBanner.tsx +15 -49
- package/src/modules/git/hooks/useAutoPullUpdates.ts +9 -5
- package/src/modules/git/index.ts +15 -0
- package/src/modules/git/services/__tests__/error-messages.test.ts +67 -0
- package/src/modules/git/services/__tests__/pull-failure.test.ts +36 -0
- package/src/modules/git/services/error-messages.ts +58 -1
- package/src/modules/git/services/pull-failure.ts +68 -0
- package/src/modules/git/state/branch-delete-confirm.ts +46 -0
- package/src/modules/layout/__tests__/HeaderAlignment.test.tsx +1 -0
- package/src/modules/layout/__tests__/breakpoints.test.ts +7 -1
- package/src/modules/layout/breakpoints.ts +8 -0
- package/src/modules/library/__tests__/PluginExtras.test.tsx +9 -9
- package/src/modules/library/__tests__/PluginPage.test.tsx +8 -1
- package/src/modules/library/__tests__/SkillsTree.test.tsx +13 -4
- package/src/modules/library/__tests__/ToolPage.test.tsx +53 -0
- package/src/modules/library/components/LibraryPage.tsx +22 -0
- package/src/modules/library/components/PluginExtras.tsx +23 -6
- package/src/modules/library/components/PluginPage.tsx +6 -1
- package/src/modules/library/components/tool-page/ToolPage.tsx +45 -1
- package/src/modules/library/routes/LibraryRoutes.tsx +8 -7
- package/src/modules/library/services/plugins.api.ts +4 -1
- package/src/modules/library/services/tools.api.ts +27 -0
- package/src/modules/library/state/plugins-revision.ts +28 -0
- package/src/modules/onboarding/__tests__/agent-connection-api.test.ts +55 -0
- package/src/modules/onboarding/__tests__/creator-welcome.test.tsx +87 -82
- package/src/modules/onboarding/__tests__/first-page-prompt.test.ts +109 -0
- package/src/modules/onboarding/__tests__/get-started-column.test.tsx +1001 -0
- package/src/modules/onboarding/__tests__/invite-dialog.test.tsx +392 -0
- package/src/modules/onboarding/__tests__/onboarding.test.tsx +226 -193
- package/src/modules/onboarding/__tests__/starter-pack-card.test.tsx +136 -0
- package/src/modules/onboarding/components/CreatorWelcomePage.tsx +7 -11
- package/src/modules/onboarding/components/EmailChipsInput.tsx +138 -0
- package/src/modules/onboarding/components/GetStartedColumn.tsx +651 -0
- package/src/modules/onboarding/components/InviteButton.tsx +35 -0
- package/src/modules/onboarding/components/InviteDialog.tsx +424 -0
- package/src/modules/onboarding/components/RootLanding.tsx +8 -24
- package/src/modules/onboarding/components/StarterPackCard.tsx +98 -0
- package/src/modules/onboarding/components/WelcomePage.tsx +65 -154
- package/src/modules/onboarding/first-page-prompt.ts +89 -0
- package/src/modules/onboarding/invite-emails.ts +175 -0
- package/src/modules/onboarding/services/agent-connection.api.ts +53 -0
- package/src/modules/onboarding/services/starter-packs.api.ts +83 -0
- package/src/modules/onboarding/state/agent-connection.ts +167 -0
- package/src/modules/onboarding/state/invite-dialog.context.ts +32 -0
- package/src/modules/onboarding/state/invite-dialog.tsx +31 -0
- package/src/modules/onboarding/state/onboarding.ts +133 -59
- package/src/modules/onboarding/state/starter-packs.ts +169 -0
- package/src/modules/settings/settings-nav-items.tsx +8 -3
- package/src/modules/setup/__tests__/setup.first-run-storage.test.tsx +389 -0
- package/src/modules/setup/__tests__/setup.github.test.tsx +5 -5
- package/src/modules/setup/__tests__/setup.kept-draft.test.tsx +1 -1
- package/src/modules/setup/__tests__/setup.repository-change.test.tsx +1 -1
- package/src/modules/setup/__tests__/setup.repository.test.tsx +21 -21
- package/src/modules/setup/__tests__/setup.test.tsx +65 -81
- package/src/modules/setup/__tests__/useConnectionProbe.test.tsx +123 -0
- package/src/modules/setup/components/FirstRunStorage.tsx +560 -0
- package/src/modules/setup/components/SetupGate.tsx +46 -1
- package/src/modules/setup/components/SetupScreen.tsx +92 -152
- package/src/modules/setup/hooks/useConnectionProbe.ts +93 -0
- package/src/modules/setup/services/setup.api.ts +3 -3
- package/src/modules/setup/utils/suggested-branch.ts +27 -0
- package/src/modules/toolbar/commands/__tests__/actions.test.tsx +210 -0
- package/src/modules/toolbar/commands/actions.tsx +324 -0
- package/src/modules/toolbar/commands/command-menu.ts +44 -0
- package/src/modules/toolbar/commands/useCommandActions.ts +69 -0
- package/src/modules/toolbar/commands/useCommandShortcuts.ts +121 -0
- package/src/modules/toolbar/components/AppSwitcher.tsx +106 -22
- package/src/modules/toolbar/components/ExternalAgentAccessPage.tsx +1 -1
- package/src/modules/toolbar/components/ProfileMenu.tsx +9 -4
- package/src/modules/toolbar/components/SearchPalette.tsx +540 -0
- package/src/modules/toolbar/components/Toolbar.tsx +10 -0
- package/src/modules/toolbar/components/__tests__/AppSwitcher.test.tsx +187 -54
- package/src/modules/toolbar/components/__tests__/ExternalAgentAccessPage.test.tsx +4 -4
- package/src/modules/toolbar/components/__tests__/ProfileMenu.test.tsx +64 -0
- package/src/modules/toolbar/components/__tests__/SearchPalette.test.tsx +832 -0
- package/src/modules/toolbar/components/__tests__/Toolbar.test.tsx +57 -2
- package/src/modules/toolbar/search/__tests__/rank.test.ts +93 -0
- package/src/modules/toolbar/search/__tests__/sources.test.ts +131 -0
- package/src/modules/toolbar/search/rank.ts +111 -0
- package/src/modules/toolbar/search/sources.ts +169 -0
- package/src/modules/workflow/hooks/useFileLock.ts +10 -7
- package/src/modules/workflow/services/__tests__/lock.api.test.ts +41 -0
- package/src/modules/workflow/services/lock.api.ts +17 -2
- package/src/modules/workspace/__tests__/useWorkspaceState.test.ts +49 -1
- package/src/modules/workspace/components/EditorTabs.tsx +39 -15
- package/src/modules/workspace/components/FileExplorer.tsx +39 -6
- package/src/modules/workspace/components/FilePaneCard.tsx +6 -2
- package/src/modules/workspace/components/FileRoute.tsx +12 -7
- package/src/modules/workspace/components/FileViewer.tsx +271 -74
- package/src/modules/workspace/components/KbPageHeader.tsx +13 -6
- package/src/modules/workspace/components/__tests__/EditorTabs.test.tsx +88 -21
- package/src/modules/workspace/components/__tests__/FileExplorer.test.tsx +101 -11
- package/src/modules/workspace/components/__tests__/FileRoute.test.tsx +23 -3
- package/src/modules/workspace/components/__tests__/FileViewer.test.tsx +330 -6
- package/src/modules/workspace/components/__tests__/KbPageHeader.test.tsx +17 -2
- package/src/modules/workspace/components/renderers/DocxRenderer.tsx +11 -16
- package/src/modules/workspace/components/renderers/DownloadFileButton.tsx +6 -0
- package/src/modules/workspace/components/renderers/EmailRenderer.tsx +23 -21
- package/src/modules/workspace/components/renderers/ImageRenderer.tsx +13 -29
- package/src/modules/workspace/components/renderers/KbMarkdownView.tsx +9 -2
- package/src/modules/workspace/components/renderers/MarkdownRenderer.tsx +8 -0
- package/src/modules/workspace/components/renderers/PdfRenderer.tsx +14 -19
- package/src/modules/workspace/components/renderers/PptxRenderer.tsx +11 -17
- package/src/modules/workspace/components/renderers/ToolRenderer.tsx +35 -7
- package/src/modules/workspace/components/renderers/XlsxRenderer.tsx +11 -17
- package/src/modules/workspace/components/renderers/__tests__/EmailRenderer.links.test.tsx +73 -0
- package/src/modules/workspace/components/renderers/__tests__/ToolRenderer.scaffold.test.tsx +64 -0
- package/src/modules/workspace/components/renderers/__tests__/ToolRenderer.surface.test.tsx +82 -0
- package/src/modules/workspace/components/renderers/__tests__/bridgeHarness.ts +99 -0
- package/src/modules/workspace/components/renderers/__tests__/htmlSandbox.test.ts +129 -35
- package/src/modules/workspace/components/renderers/__tests__/htmlViewsGuide.test.ts +149 -0
- package/src/modules/workspace/components/renderers/__tests__/kbMarkdownLinkPolicy.test.tsx +100 -0
- package/src/modules/workspace/components/renderers/htmlSandbox.ts +76 -20
- package/src/modules/workspace/components/renderers/index.ts +26 -0
- package/src/modules/workspace/components/renderers/kbMarkdownPipeline.tsx +51 -1
- package/src/modules/workspace/components/renderers/rendererRawRead.ts +53 -0
- package/src/modules/workspace/components/renderers/rendererSurface.ts +109 -0
- package/src/modules/workspace/components/renderers/rendererWorkspace.ts +8 -2
- package/src/modules/workspace/hooks/__tests__/useWorkspaceState.test.tsx +126 -21
- package/src/modules/workspace/hooks/useCreatePage.ts +116 -0
- package/src/modules/workspace/hooks/useWorkspaceImageResolver.ts +24 -7
- package/src/modules/workspace/hooks/useWorkspaceState.ts +42 -8
- package/src/modules/workspace/routing/__tests__/kb-routes.test.tsx +10 -0
- package/src/modules/workspace/routing/__tests__/md-links-parity.test.tsx +113 -0
- package/src/modules/workspace/routing/kb-routes.ts +66 -12
- package/src/modules/workspace/state/editable-page.ts +42 -0
- package/src/modules/workspace/state/workspace.context.ts +13 -4
- package/src/modules/workspace/utils/__tests__/display-file-name.test.ts +60 -0
- package/src/modules/workspace/utils/__tests__/fileTree.test.ts +75 -0
- package/src/modules/workspace/utils/__tests__/treeConfirm.test.ts +26 -14
- package/src/modules/workspace/utils/display-file-name.ts +102 -0
- package/src/modules/workspace/utils/fileTree.ts +49 -14
- package/src/modules/workspace/utils/treeConfirm.ts +22 -5
- package/src/shared/__tests__/no-builtin-confirm.test.ts +102 -0
- package/src/shared/components/ConfirmProvider.tsx +156 -0
- package/src/shared/components/Dialog.tsx +7 -0
- package/src/shared/components/__tests__/ConfirmProvider.test.tsx +198 -0
- package/src/shared/components/confirm-context.ts +94 -0
- package/src/shared/components/index.ts +3 -0
- package/src/shared/mcp/__tests__/connect-snippets.test.ts +2 -2
- package/src/shared/mcp/connect-snippets.ts +8 -5
- package/src/modules/onboarding/components/WelcomeRoute.tsx +0 -57
- package/src/modules/onboarding/welcome-state.ts +0 -36
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { FIRST_PAGE_PROMPT, chatGptPromptUrl, claudePromptUrl, firstPagePromptFor, firstPageRoute } from '../first-page-prompt';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The first-page prompt links: the prompt must arrive in the chat exactly as
|
|
6
|
+
* written — every space, colon, comma and apostrophe — and stay short enough
|
|
7
|
+
* to travel in a URL.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
describe('first-page prompt links', () => {
|
|
11
|
+
it('opens a new Claude chat with the prompt as its q parameter, round-tripping exactly', () => {
|
|
12
|
+
const url = new URL(claudePromptUrl(FIRST_PAGE_PROMPT));
|
|
13
|
+
expect(url.origin).toBe('https://claude.ai');
|
|
14
|
+
expect(url.pathname).toBe('/new');
|
|
15
|
+
expect(url.searchParams.get('q')).toBe(FIRST_PAGE_PROMPT);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('opens a new ChatGPT chat the same way', () => {
|
|
19
|
+
const url = new URL(chatGptPromptUrl(FIRST_PAGE_PROMPT));
|
|
20
|
+
expect(url.origin).toBe('https://chatgpt.com');
|
|
21
|
+
expect(url.pathname).toBe('/');
|
|
22
|
+
expect(url.searchParams.get('q')).toBe(FIRST_PAGE_PROMPT);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('percent-encodes everything a query string would otherwise read as structure', () => {
|
|
26
|
+
const tricky = "a & b = c? #1 + 100% it's";
|
|
27
|
+
const claude = claudePromptUrl(tricky);
|
|
28
|
+
expect(claude).toBe(
|
|
29
|
+
'https://claude.ai/new?q=a%20%26%20b%20%3D%20c%3F%20%231%20%2B%20100%25%20it\'s',
|
|
30
|
+
);
|
|
31
|
+
expect(claude).not.toContain(' ');
|
|
32
|
+
expect(new URL(claude).searchParams.get('q')).toBe(tricky);
|
|
33
|
+
expect(new URL(chatGptPromptUrl(tricky)).searchParams.get('q')).toBe(tricky);
|
|
34
|
+
// Nothing after a `#` would ever reach the chat — the fragment stays in the prompt.
|
|
35
|
+
expect(new URL(claude).hash).toBe('');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('keeps the prompt short enough for a link', () => {
|
|
39
|
+
expect(claudePromptUrl(FIRST_PAGE_PROMPT).length).toBeLessThan(400);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Which way in leads is read off the connected agent's name: a link only
|
|
45
|
+
* where the web chat it opens can actually reach the knowledge base.
|
|
46
|
+
*/
|
|
47
|
+
describe('firstPageRoute', () => {
|
|
48
|
+
it.each(['Claude', 'claude', ' CLAUDE ', 'claude.ai', 'Claude Desktop', 'claude-desktop'])(
|
|
49
|
+
'leads with Claude for %j',
|
|
50
|
+
(client) => {
|
|
51
|
+
expect(firstPageRoute(client, 'agent').primary).toBe('claude');
|
|
52
|
+
},
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
it.each(['ChatGPT', 'chatgpt', 'ChatGPT Connector'])('leads with ChatGPT for %j', (client) => {
|
|
56
|
+
expect(firstPageRoute(client, 'agent').primary).toBe('chatgpt');
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it.each(['Claude Code', 'claude code', 'Cursor', 'Windsurf', 'Codex', 'My laptop key', 'Claudette'])(
|
|
60
|
+
'leads with Copy prompt for %j',
|
|
61
|
+
(client) => {
|
|
62
|
+
expect(firstPageRoute(client, 'agent')).toEqual({ primary: 'copy', agentName: client });
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
it('leads with Copy prompt for any agent on the local server, Claude included, naming the agent alone', () => {
|
|
67
|
+
expect(firstPageRoute('Claude Code · local server on LAPTOP-1', 'agent')).toEqual({
|
|
68
|
+
primary: 'copy',
|
|
69
|
+
agentName: 'Claude Code',
|
|
70
|
+
});
|
|
71
|
+
expect(firstPageRoute('Claude Desktop · local server on LAPTOP-1', 'agent')).toEqual({
|
|
72
|
+
primary: 'copy',
|
|
73
|
+
agentName: 'Claude Desktop',
|
|
74
|
+
});
|
|
75
|
+
expect(firstPageRoute('Claude · LOCAL SERVER ON mac.local', 'agent')).toEqual({ primary: 'copy', agentName: 'Claude' });
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('has no name to offer for an unnamed or unknown agent, or none at all', () => {
|
|
79
|
+
expect(firstPageRoute('Unnamed agent', 'agent')).toEqual({ primary: 'copy', agentName: null });
|
|
80
|
+
expect(firstPageRoute('Unknown agent · local server on LAPTOP-1', 'agent')).toEqual({ primary: 'copy', agentName: null });
|
|
81
|
+
expect(firstPageRoute(undefined, 'agent')).toEqual({ primary: 'copy', agentName: null });
|
|
82
|
+
expect(firstPageRoute(null, 'agent')).toEqual({ primary: 'copy', agentName: null });
|
|
83
|
+
expect(firstPageRoute(' ', 'agent')).toEqual({ primary: 'copy', agentName: null });
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it.each(['Claude', 'ChatGPT', 'ChatGPT CLI', 'Claude Desktop', 'My laptop key'])(
|
|
87
|
+
'leads with Copy prompt, naming no agent, for a connection key labelled %j',
|
|
88
|
+
(label) => {
|
|
89
|
+
// A key's label is free text: it names the key, not the app holding it.
|
|
90
|
+
expect(firstPageRoute(label, 'key')).toEqual({ primary: 'copy', agentName: null });
|
|
91
|
+
},
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
it('leads with Copy prompt when the answer does not say which kind of connection it is', () => {
|
|
95
|
+
expect(firstPageRoute('Claude', undefined)).toEqual({ primary: 'copy', agentName: null });
|
|
96
|
+
expect(firstPageRoute('ChatGPT', null)).toEqual({ primary: 'copy', agentName: null });
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
describe('firstPagePromptFor', () => {
|
|
101
|
+
it("is the chosen starter pack's own request, without the YAML block's trailing newline", () => {
|
|
102
|
+
expect(firstPagePromptFor({ firstPagePrompt: 'Fill in the Customers page.\n' })).toBe('Fill in the Customers page.');
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('is the generic request without a pack, or with one that has none to give', () => {
|
|
106
|
+
expect(firstPagePromptFor(null)).toBe(FIRST_PAGE_PROMPT);
|
|
107
|
+
expect(firstPagePromptFor({ firstPagePrompt: ' ' })).toBe(FIRST_PAGE_PROMPT);
|
|
108
|
+
});
|
|
109
|
+
});
|