@bevel-software/platform-core-frontend 0.7.5 → 0.8.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.
Files changed (113) hide show
  1. package/LICENSE +202 -202
  2. package/THIRD-PARTY-NOTICES.md +344 -988
  3. package/package.json +5 -5
  4. package/src/core/CoreAppShell.tsx +4 -4
  5. package/src/core/__tests__/ShellRoutes.test.tsx +1 -1
  6. package/src/core/__tests__/bootstrap.test.ts +47 -2
  7. package/src/core/bootstrap.ts +20 -0
  8. package/src/css-side-effect-imports.d.ts +7 -7
  9. package/src/modules/access/__tests__/ManageAccessDialog.placement.test.tsx +1 -1
  10. package/src/modules/access/__tests__/ManageAccessDialog.test.tsx +5 -5
  11. package/src/modules/access/api.ts +5 -5
  12. package/src/modules/access/components/ManageAccessDialog.tsx +21 -20
  13. package/src/modules/admin/__tests__/AdminRolesPage.suggest.test.tsx +1 -1
  14. package/src/modules/admin/components/AdminRolesPage.tsx +1 -1
  15. package/src/modules/change-requests/__tests__/useFileOnBranch.test.tsx +2 -2
  16. package/src/modules/change-requests/components/ChangeRequestDialog.tsx +1 -1
  17. package/src/modules/change-requests/hooks/useApplyChangeRequest.ts +1 -1
  18. package/src/modules/layout/__tests__/SidebarFrameResponsive.test.tsx +4 -4
  19. package/src/modules/layout/__tests__/SidebarToggle.test.tsx +4 -4
  20. package/src/modules/layout/__tests__/breakpoints.test.ts +1 -1
  21. package/src/modules/layout/components/SidebarFrame.tsx +2 -2
  22. package/src/modules/library/__tests__/{AddToGroupDialog.test.tsx → AddToPluginDialog.test.tsx} +34 -34
  23. package/src/modules/library/__tests__/LibraryCard.test.tsx +30 -11
  24. package/src/modules/library/__tests__/LibraryRoutes.test.tsx +84 -59
  25. package/src/modules/library/__tests__/LibrarySidebarMenu.test.tsx +51 -51
  26. package/src/modules/library/__tests__/{LockedGroupView.test.tsx → LockedPluginView.test.tsx} +33 -33
  27. package/src/modules/library/__tests__/McpServerSection.test.tsx +138 -0
  28. package/src/modules/library/__tests__/{NewGroupDialog.test.tsx → NewPluginDialog.test.tsx} +22 -22
  29. package/src/modules/library/__tests__/PersonalAddDialog.test.tsx +7 -7
  30. package/src/modules/library/__tests__/PluginExtras.test.tsx +131 -0
  31. package/src/modules/library/__tests__/{GroupJoinRequests.test.tsx → PluginJoinRequests.test.tsx} +24 -24
  32. package/src/modules/library/__tests__/{GroupPage.test.tsx → PluginPage.test.tsx} +101 -101
  33. package/src/modules/library/__tests__/{GroupsIndexPage.test.tsx → PluginsIndexPage.test.tsx} +57 -57
  34. package/src/modules/library/__tests__/{GroupsSidebar.contextmenu.test.tsx → PluginsSidebar.contextmenu.test.tsx} +31 -31
  35. package/src/modules/library/__tests__/{GroupsSidebar.locked.test.tsx → PluginsSidebar.locked.test.tsx} +28 -28
  36. package/src/modules/library/__tests__/{GroupsSidebar.test.tsx → PluginsSidebar.test.tsx} +39 -39
  37. package/src/modules/library/__tests__/{GroupsSidebarMenu.test.tsx → PluginsSidebarMenu.test.tsx} +18 -18
  38. package/src/modules/library/__tests__/SkillPage.test.tsx +8 -8
  39. package/src/modules/library/__tests__/ToolConnectionSection.test.tsx +2 -2
  40. package/src/modules/library/__tests__/ToolPage.test.tsx +41 -12
  41. package/src/modules/library/__tests__/ToolSharePanel.test.tsx +1 -1
  42. package/src/modules/library/__tests__/WorkspaceItemRoute.test.tsx +57 -57
  43. package/src/modules/library/__tests__/auth-harness.tsx +4 -4
  44. package/src/modules/library/__tests__/status.test.ts +19 -19
  45. package/src/modules/library/__tests__/tools.api.test.ts +70 -0
  46. package/src/modules/library/__tests__/useToolPage.test.tsx +4 -4
  47. package/src/modules/library/components/AccessRequestsBanner.tsx +8 -8
  48. package/src/modules/library/components/{AddToGroupDialog.tsx → AddToPluginDialog.tsx} +11 -11
  49. package/src/modules/library/components/ChangeRequestDock.tsx +1 -1
  50. package/src/modules/library/components/{DeleteGroupDialog.tsx → DeletePluginDialog.tsx} +9 -9
  51. package/src/modules/library/components/LibraryCard.tsx +26 -2
  52. package/src/modules/library/components/LibraryLayout.tsx +70 -70
  53. package/src/modules/library/components/LibraryPage.tsx +8 -8
  54. package/src/modules/library/components/LockGlyph.tsx +1 -1
  55. package/src/modules/library/components/{LockedGroupView.tsx → LockedPluginView.tsx} +35 -35
  56. package/src/modules/library/components/{ManagedGroupRequests.tsx → ManagedPluginRequests.tsx} +13 -13
  57. package/src/modules/library/components/{NewGroupDialog.tsx → NewPluginDialog.tsx} +24 -24
  58. package/src/modules/library/components/NewSkillPanel.tsx +5 -5
  59. package/src/modules/library/components/PageActions.tsx +3 -3
  60. package/src/modules/library/components/PersonalAddDialog.tsx +5 -5
  61. package/src/modules/library/components/{PersonalGroupPage.tsx → PersonalPluginPage.tsx} +17 -17
  62. package/src/modules/library/components/PluginExtras.tsx +195 -0
  63. package/src/modules/library/components/{GroupIndexRow.tsx → PluginIndexRow.tsx} +6 -6
  64. package/src/modules/library/components/{GroupJoinRequests.tsx → PluginJoinRequests.tsx} +12 -12
  65. package/src/modules/library/components/{GroupPage.tsx → PluginPage.tsx} +72 -69
  66. package/src/modules/library/components/{GroupsIndexPage.tsx → PluginsIndexPage.tsx} +46 -46
  67. package/src/modules/library/components/{GroupsSidebar.tsx → PluginsSidebar.tsx} +55 -55
  68. package/src/modules/library/components/{GroupsSidebarMenu.tsx → PluginsSidebarMenu.tsx} +15 -15
  69. package/src/modules/library/components/{group-page-parts.tsx → plugin-page-parts.tsx} +35 -24
  70. package/src/modules/library/components/skill-page/SkillPage.tsx +12 -12
  71. package/src/modules/library/components/tool-page/McpServerSection.tsx +380 -0
  72. package/src/modules/library/components/tool-page/ToolPage.tsx +22 -5
  73. package/src/modules/library/hooks/useJoinRequests.ts +8 -8
  74. package/src/modules/library/routes/LibraryRoutes.tsx +30 -17
  75. package/src/modules/library/routes/WorkspaceItemRoute.tsx +24 -24
  76. package/src/modules/library/routes/library-paths.ts +36 -36
  77. package/src/modules/library/services/library.api.ts +9 -9
  78. package/src/modules/library/services/{groups.api.ts → plugins.api.ts} +43 -43
  79. package/src/modules/library/services/tools.api.ts +54 -0
  80. package/src/modules/library/state/library-data.tsx +46 -46
  81. package/src/modules/library/utils/names.ts +1 -1
  82. package/src/modules/library/utils/{personal-group.ts → personal-plugin.ts} +8 -8
  83. package/src/modules/library/utils/{group-summary.ts → plugin-summary.ts} +14 -14
  84. package/src/modules/library/utils/status.ts +17 -17
  85. package/src/modules/onboarding/__tests__/onboarding.test.tsx +86 -8
  86. package/src/modules/onboarding/agent-clients.ts +18 -14
  87. package/src/modules/onboarding/components/WelcomePage.tsx +19 -8
  88. package/src/modules/review/components/MarkdownDiffViewer.tsx +1 -1
  89. package/src/modules/review/components/ReviewPanel.tsx +11 -11
  90. package/src/modules/review/components/__tests__/{isGroupItemPath.test.ts → isPluginItemPath.test.ts} +24 -24
  91. package/src/modules/secrets-vault/components/ToolSecretsPanel.tsx +3 -3
  92. package/src/modules/secrets-vault/components/__tests__/SecretsPage.test.tsx +1 -1
  93. package/src/modules/settings/components/SettingsLayout.tsx +1 -1
  94. package/src/modules/settings/components/SettingsNav.tsx +5 -5
  95. package/src/modules/toolbar/components/ExternalAgentAccessPage.tsx +29 -107
  96. package/src/modules/toolbar/components/__tests__/AppSwitcher.test.tsx +1 -1
  97. package/src/modules/toolbar/components/__tests__/ExternalAgentAccessPage.test.tsx +228 -0
  98. package/src/modules/toolbar/components/__tests__/Toolbar.test.tsx +3 -3
  99. package/src/modules/workspace/components/FileExplorer.tsx +12 -12
  100. package/src/modules/workspace/components/__tests__/FileExplorer.test.tsx +14 -14
  101. package/src/modules/workspace/components/renderers/ToolRenderer.tsx +7 -2
  102. package/src/modules/workspace/utils/__tests__/diff.test.ts +1 -1
  103. package/src/modules/workspace/utils/fileTree.ts +3 -3
  104. package/src/shared/mcp/ClaudeInstallLink.tsx +88 -0
  105. package/src/shared/mcp/ConnectionInstructions.tsx +51 -0
  106. package/src/shared/mcp/CopyBlock.tsx +42 -0
  107. package/src/shared/mcp/__tests__/ClaudeInstallLink.test.tsx +40 -0
  108. package/src/shared/mcp/__tests__/connect-snippets.test.ts +431 -0
  109. package/src/shared/mcp/__tests__/useCopyFeedback.test.ts +112 -0
  110. package/src/shared/mcp/connect-snippets.ts +353 -0
  111. package/src/shared/mcp/index.ts +28 -0
  112. package/src/shared/mcp/useCopyFeedback.ts +46 -0
  113. package/src/test-setup.ts +11 -0
@@ -3,23 +3,23 @@ import { render, screen, fireEvent, waitFor } from '@testing-library/react';
3
3
  import { MemoryRouter, Route, Routes, useLocation } from 'react-router-dom';
4
4
  import type { LibraryData } from '../hooks/useLibraryData';
5
5
  import type { ToolSecrets } from '../../secrets-vault/services/tool-secrets.api';
6
- import type { GroupSummary } from '../services/groups.api';
6
+ import type { PluginSummary } from '../services/plugins.api';
7
7
 
8
8
  /**
9
- * The all-groups index: which section a group lands in, what each row says, and
9
+ * The all-plugins index: which section a plugin lands in, what each row says, and
10
10
  * where it goes. The locked section is the reason this page exists, so most of
11
- * what is asserted here is about groups the caller cannot enter.
11
+ * what is asserted here is about plugins the caller cannot enter.
12
12
  */
13
13
 
14
14
  const dataMock = vi.hoisted(() => ({ useLibraryData: vi.fn() }));
15
15
  vi.mock('../hooks/useLibraryData', () => ({ useLibraryData: dataMock.useLibraryData }));
16
16
 
17
- const groupsMock = vi.hoisted(() => ({ listGroups: vi.fn(), listJoinRequests: vi.fn() }));
18
- vi.mock('../services/groups.api', () => ({
19
- listGroups: groupsMock.listGroups,
17
+ const pluginsMock = vi.hoisted(() => ({ listPlugins: vi.fn(), listJoinRequests: vi.fn() }));
18
+ vi.mock('../services/plugins.api', () => ({
19
+ listPlugins: pluginsMock.listPlugins,
20
20
  // The page carries the managers' join-request banners now — it is where the
21
21
  // Library lands, so it is where an unanswered request is certain to be seen.
22
- listJoinRequests: groupsMock.listJoinRequests,
22
+ listJoinRequests: pluginsMock.listJoinRequests,
23
23
  reconcileJoinRequest: vi.fn(),
24
24
  }));
25
25
 
@@ -28,13 +28,13 @@ import {
28
28
  WorkspaceContext,
29
29
  type WorkspaceContextValue,
30
30
  } from '../../workspace/state/workspace.context';
31
- import { GroupsIndexPage } from '../components/GroupsIndexPage';
31
+ import { PluginsIndexPage } from '../components/PluginsIndexPage';
32
32
  import { withAuth, TEST_PERSONAL_GROUP } from './auth-harness';
33
33
 
34
34
  const tool = (over: Partial<ToolSecrets> = {}): ToolSecrets => ({
35
35
  slug: 'heyreach',
36
36
  name: 'heyreach',
37
- path: 'Groups/GTM/heyreach.tool',
37
+ path: 'Plugins/GTM/heyreach.tool',
38
38
  type: 'inline',
39
39
  setup: null,
40
40
  canWrite: false,
@@ -46,13 +46,13 @@ const CATALOG: LibraryData = {
46
46
  loading: false,
47
47
  error: null,
48
48
  skills: [
49
- { name: 'outreach', description: '', path: 'Groups/GTM/outreach' },
49
+ { name: 'outreach', description: '', path: 'Plugins/GTM/outreach' },
50
50
  { name: 'scratch', description: '', path: 'Skills/scratch' },
51
51
  ],
52
52
  pendingSkills: [],
53
53
  tools: [
54
54
  tool(),
55
- // An ungrouped sign-in — `Tools/slack.tool` is two segments, so no group.
55
+ // An ungrouped sign-in — `Tools/slack.tool` is two segments, so no plugin.
56
56
  tool({
57
57
  slug: 'slack',
58
58
  name: 'slack',
@@ -76,9 +76,9 @@ const CATALOG: LibraryData = {
76
76
  reload: vi.fn(),
77
77
  };
78
78
 
79
- const summary = (over: Partial<GroupSummary> = {}): GroupSummary => ({
79
+ const summary = (over: Partial<PluginSummary> = {}): PluginSummary => ({
80
80
  name: 'GTM',
81
- folders: ['Groups/GTM'],
81
+ folders: ['Plugins/GTM'],
82
82
  canRead: true,
83
83
  canWrite: false,
84
84
  isOwner: false,
@@ -110,7 +110,7 @@ function renderIndex() {
110
110
  <WorkspaceContext.Provider value={WORKSPACE}>
111
111
  <LibraryProvider>
112
112
  <Routes>
113
- <Route path="/skills-and-tools" element={<GroupsIndexPage />} />
113
+ <Route path="/skills-and-tools" element={<PluginsIndexPage />} />
114
114
  <Route path="*" element={<div />} />
115
115
  </Routes>
116
116
  <LocationProbe />
@@ -124,27 +124,27 @@ function renderIndex() {
124
124
  const href = () => screen.getByLabelText('href').textContent;
125
125
  const row = (name: RegExp | string) => screen.getByRole('button', { name });
126
126
 
127
- describe('GroupsIndexPage', () => {
127
+ describe('PluginsIndexPage', () => {
128
128
  beforeEach(() => {
129
129
  dataMock.useLibraryData.mockReturnValue(CATALOG);
130
- groupsMock.listGroups.mockResolvedValue([summary()]);
131
- groupsMock.listJoinRequests.mockResolvedValue([]);
130
+ pluginsMock.listPlugins.mockResolvedValue([summary()]);
131
+ pluginsMock.listJoinRequests.mockResolvedValue([]);
132
132
  });
133
133
 
134
134
  it('names itself and its two sections', async () => {
135
135
  renderIndex();
136
- expect(await screen.findByRole('heading', { name: 'All groups', level: 1 })).toBeInTheDocument();
136
+ expect(await screen.findByRole('heading', { name: 'All plugins', level: 1 })).toBeInTheDocument();
137
137
  expect(
138
- screen.getByText('A group carries skills and tools for the people in it.'),
138
+ screen.getByText('A plugin carries skills and tools for the people in it.'),
139
139
  ).toBeInTheDocument();
140
140
  expect(screen.getByRole('heading', { name: 'Yours' })).toBeInTheDocument();
141
- expect(await screen.findByRole('heading', { name: "Groups you're in" })).toBeInTheDocument();
141
+ expect(await screen.findByRole('heading', { name: "Your plugins" })).toBeInTheDocument();
142
142
  });
143
143
 
144
- it("offers the caller's own group under Yours, and opens it", async () => {
144
+ it("offers the caller's own plugin under Yours, and opens it", async () => {
145
145
  renderIndex();
146
146
  expect(
147
- await screen.findByText('Your sign-ins and the skills no group carries'),
147
+ await screen.findByText('Your sign-ins and the skills no plugin carries'),
148
148
  ).toBeInTheDocument();
149
149
  // The lens is gone from this page — it lives in the sidebar.
150
150
  expect(screen.queryByText('The skills you answer for')).not.toBeInTheDocument();
@@ -152,38 +152,38 @@ describe('GroupsIndexPage', () => {
152
152
  await waitFor(() => expect(href()).toBe('/skills-and-tools/yours'));
153
153
  });
154
154
 
155
- it("keeps the caller's own group listed even when nothing sits outside a group", async () => {
155
+ it("keeps the caller's own plugin listed even when nothing sits outside a plugin", async () => {
156
156
  dataMock.useLibraryData.mockReturnValue({
157
157
  ...CATALOG,
158
- skills: [{ name: 'outreach', description: '', path: 'Groups/GTM/outreach' }],
158
+ skills: [{ name: 'outreach', description: '', path: 'Plugins/GTM/outreach' }],
159
159
  tools: [tool()],
160
160
  });
161
161
  renderIndex();
162
- await screen.findByRole('heading', { name: 'All groups', level: 1 });
162
+ await screen.findByRole('heading', { name: 'All plugins', level: 1 });
163
163
  expect(screen.getByRole('button', { name: new RegExp(`^${TEST_PERSONAL_GROUP}`) })).toBeInTheDocument();
164
- // And never the lens: "Owned by me" is a view across groups, not a group.
164
+ // And never the lens: "Owned by me" is a view across plugins, not a plugin.
165
165
  expect(screen.queryByRole('button', { name: /^Owned by me/ })).not.toBeInTheDocument();
166
166
  });
167
167
 
168
- it("puts a readable group under Groups you're in, with its run-by line and totals", async () => {
168
+ it("puts a readable plugin under Your plugins, with its run-by line and totals", async () => {
169
169
  renderIndex();
170
170
  const gtm = await screen.findByRole('button', { name: /^GTM/ });
171
171
  expect(gtm).toHaveAccessibleName('GTM Run by Olga Ivanova 4 skills · 2 tools');
172
172
  fireEvent.click(gtm);
173
- await waitFor(() => expect(href()).toBe('/skills-and-tools/groups/GTM'));
173
+ await waitFor(() => expect(href()).toBe('/skills-and-tools/plugins/GTM'));
174
174
  });
175
175
 
176
- it('marks a group the caller can change with an Owner badge', async () => {
177
- groupsMock.listGroups.mockResolvedValue([summary({ canWrite: true })]);
176
+ it('marks a plugin the caller can change with an Owner badge', async () => {
177
+ pluginsMock.listPlugins.mockResolvedValue([summary({ canWrite: true })]);
178
178
  renderIndex();
179
179
  expect(await screen.findByRole('button', { name: /^GTM Owner/ })).toBeInTheDocument();
180
180
  });
181
181
 
182
- it('shows the amber count when a group has integrations to set up', async () => {
183
- groupsMock.listGroups.mockResolvedValue([
182
+ it('shows the amber count when a plugin has integrations to set up', async () => {
183
+ pluginsMock.listPlugins.mockResolvedValue([
184
184
  summary({
185
185
  name: 'Yours',
186
- folders: ['Groups/Yours'],
186
+ folders: ['Plugins/Yours'],
187
187
  }),
188
188
  summary(),
189
189
  ]);
@@ -208,22 +208,22 @@ describe('GroupsIndexPage', () => {
208
208
  expect(await screen.findByRole('button', { name: /^GTM .* 1$/ })).toBeInTheDocument();
209
209
  });
210
210
 
211
- it('lists a DISCOVERABLE locked group under Ask to join, Locked or Requested', async () => {
212
- groupsMock.listGroups.mockResolvedValue([
211
+ it('lists a DISCOVERABLE locked plugin under Request access, Locked or Requested', async () => {
212
+ pluginsMock.listPlugins.mockResolvedValue([
213
213
  summary(),
214
- summary({ name: 'Finance', folders: ['Groups/Finance'], canRead: false, canWrite: false }),
214
+ summary({ name: 'Finance', folders: ['Plugins/Finance'], canRead: false, canWrite: false }),
215
215
  ]);
216
216
  renderIndex();
217
- expect(await screen.findByRole('heading', { name: 'Ask to join' })).toBeInTheDocument();
217
+ expect(await screen.findByRole('heading', { name: 'Request access' })).toBeInTheDocument();
218
218
  expect(screen.getByRole('button', { name: /^Finance/ })).toBeInTheDocument();
219
219
  expect(screen.getByTitle('Locked')).toBeInTheDocument();
220
220
 
221
221
  // Once the caller's join request is open, the chip says THAT instead —
222
222
  // the one thing the row can tell you that you did not already know.
223
- groupsMock.listGroups.mockResolvedValue([
223
+ pluginsMock.listPlugins.mockResolvedValue([
224
224
  summary({
225
225
  name: 'Finance',
226
- folders: ['Groups/Finance'],
226
+ folders: ['Plugins/Finance'],
227
227
  canRead: false,
228
228
  canWrite: false,
229
229
  hasRequested: true,
@@ -234,50 +234,50 @@ describe('GroupsIndexPage', () => {
234
234
  expect(await screen.findByTitle('Requested')).toBeInTheDocument();
235
235
  });
236
236
 
237
- it('never lists a group the endpoint omitted (fail-closed: absent = invisible)', async () => {
238
- // The backend only returns accessible groups, and this page adds nothing
239
- // on top: a group the caller cannot access has no row, no name, no counts.
240
- groupsMock.listGroups.mockResolvedValue([summary()]);
237
+ it('never lists a plugin the endpoint omitted (fail-closed: absent = invisible)', async () => {
238
+ // The backend only returns accessible plugins, and this page adds nothing
239
+ // on top: a plugin the caller cannot access has no row, no name, no counts.
240
+ pluginsMock.listPlugins.mockResolvedValue([summary()]);
241
241
  renderIndex();
242
242
  await screen.findByRole('button', { name: /^GTM/ });
243
243
  expect(screen.queryByRole('button', { name: /^Finance/ })).not.toBeInTheDocument();
244
- expect(screen.queryByRole('heading', { name: 'Ask to join' })).not.toBeInTheDocument();
244
+ expect(screen.queryByRole('heading', { name: 'Request access' })).not.toBeInTheDocument();
245
245
  });
246
246
 
247
- it('lists a group an item grant reaches inside, even without a summary', async () => {
247
+ it('lists a plugin an item grant reaches inside, even without a summary', async () => {
248
248
  dataMock.useLibraryData.mockReturnValue({
249
249
  ...CATALOG,
250
- skills: [{ name: 'budget', description: '', path: 'Groups/Finance/budget' }],
250
+ skills: [{ name: 'budget', description: '', path: 'Plugins/Finance/budget' }],
251
251
  });
252
252
  renderIndex();
253
253
  expect(await screen.findByRole('button', { name: /^Finance/ })).toBeInTheDocument();
254
254
  });
255
255
 
256
- it('lists a catalog-derived group with counts alone when no summary vouches for it', async () => {
257
- groupsMock.listGroups.mockResolvedValue([]);
256
+ it('lists a catalog-derived plugin with counts alone when no summary vouches for it', async () => {
257
+ pluginsMock.listPlugins.mockResolvedValue([]);
258
258
  renderIndex();
259
- // One skill and one tool in Groups/GTM, and nothing claiming to know who
259
+ // One skill and one tool in Plugins/GTM, and nothing claiming to know who
260
260
  // runs it — so the row states what it can count, not what it cannot.
261
261
  expect(await screen.findByRole('button', { name: 'GTM 1 skills · 1 tools' })).toBeInTheDocument();
262
262
  });
263
263
 
264
- it('offers a retry when the groups endpoint fails, and keeps Yours', async () => {
265
- groupsMock.listGroups.mockRejectedValue(new Error("Couldn't load groups."));
264
+ it('offers a retry when the plugins endpoint fails, and keeps Yours', async () => {
265
+ pluginsMock.listPlugins.mockRejectedValue(new Error("Couldn't load plugins."));
266
266
  renderIndex();
267
267
  const banner = await screen.findByRole('alert');
268
- expect(banner).toHaveTextContent("Couldn't load groups.");
268
+ expect(banner).toHaveTextContent("Couldn't load plugins.");
269
269
  expect(screen.getByRole('button', { name: new RegExp(`^${TEST_PERSONAL_GROUP}`) })).toBeInTheDocument();
270
- expect(screen.queryByRole('heading', { name: "Groups you're in" })).not.toBeInTheDocument();
270
+ expect(screen.queryByRole('heading', { name: "Your plugins" })).not.toBeInTheDocument();
271
271
 
272
- groupsMock.listGroups.mockResolvedValue([summary()]);
272
+ pluginsMock.listPlugins.mockResolvedValue([summary()]);
273
273
  fireEvent.click(screen.getByRole('button', { name: 'Try again' }));
274
274
  expect(await screen.findByRole('button', { name: /^GTM/ })).toBeInTheDocument();
275
275
  });
276
276
 
277
- it('says it is loading before the first group index arrives', () => {
278
- groupsMock.listGroups.mockReturnValue(new Promise(() => {}));
277
+ it('says it is loading before the first plugin index arrives', () => {
278
+ pluginsMock.listPlugins.mockReturnValue(new Promise(() => {}));
279
279
  renderIndex();
280
- expect(screen.getByText('Loading groups…')).toBeInTheDocument();
280
+ expect(screen.getByText('Loading plugins…')).toBeInTheDocument();
281
281
  expect(screen.getByRole('button', { name: new RegExp(`^${TEST_PERSONAL_GROUP}`) })).toBeInTheDocument();
282
282
  });
283
283
  });
@@ -1,6 +1,6 @@
1
1
  import { describe, it, expect, vi } from 'vitest';
2
2
  import { render, screen, fireEvent, createEvent } from '@testing-library/react';
3
- import { GroupsSidebar, type GroupsSidebarProps } from '../components/GroupsSidebar';
3
+ import { PluginsSidebar, type PluginsSidebarProps } from '../components/PluginsSidebar';
4
4
 
5
5
  /**
6
6
  * Right-click in the Library nav, which has to answer the gesture the way
@@ -10,50 +10,50 @@ import { GroupsSidebar, type GroupsSidebarProps } from '../components/GroupsSide
10
10
  * The sidebar itself only REPORTS the click: it suppresses the browser menu,
11
11
  * reads the pointer and the row synchronously, and hands both up. Everything
12
12
  * about which verbs are true for a given row lives in `LibraryLayout`, because
13
- * that is where the group summaries are — so that is where those assertions
13
+ * that is where the plugin summaries are — so that is where those assertions
14
14
  * live too.
15
15
  */
16
16
 
17
- function renderSidebar(over: Partial<GroupsSidebarProps> = {}) {
17
+ function renderSidebar(over: Partial<PluginsSidebarProps> = {}) {
18
18
  const onContextMenu = vi.fn();
19
19
  const onSelect = vi.fn();
20
- const props: GroupsSidebarProps = {
20
+ const props: PluginsSidebarProps = {
21
21
  filter: { kind: 'all' },
22
22
  onSelect,
23
- groups: [
24
- { group: 'Engineering', count: 4, attention: 0 },
25
- { group: 'GTM', count: 3, attention: 2 },
23
+ plugins: [
24
+ { plugin: 'Engineering', count: 4, attention: 0 },
25
+ { plugin: 'GTM', count: 3, attention: 2 },
26
26
  ],
27
- lockedGroups: ['Finance'],
27
+ lockedPlugins: ['Finance'],
28
28
  ownedCount: 2,
29
29
  ownedAttention: 0,
30
- personalGroupLabel: "Juan's Group",
30
+ personalPluginLabel: "Juan's Plugin",
31
31
  ungroupedCount: 1,
32
32
  attentionCount: 2,
33
33
  onFinishSetup: vi.fn(),
34
- onCreateGroup: vi.fn(),
35
- groupsIndexActive: false,
36
- onOpenGroupsIndex: vi.fn(),
34
+ onCreatePlugin: vi.fn(),
35
+ pluginsIndexActive: false,
36
+ onOpenPluginsIndex: vi.fn(),
37
37
  onContextMenu,
38
38
  ...over,
39
39
  };
40
- render(<GroupsSidebar {...props} />);
40
+ render(<PluginsSidebar {...props} />);
41
41
  return { onContextMenu, onSelect };
42
42
  }
43
43
 
44
- const nav = () => screen.getByRole('navigation', { name: 'Library groups' });
44
+ const nav = () => screen.getByRole('navigation', { name: 'Library plugins' });
45
45
  const rightClick = (el: Element, at = { clientX: 120, clientY: 240 }) =>
46
46
  fireEvent.contextMenu(el, at);
47
47
 
48
- describe('GroupsSidebar: right-click', () => {
49
- it('reports a group row with its filter, its name and the pointer', () => {
48
+ describe('PluginsSidebar: right-click', () => {
49
+ it('reports a plugin row with its filter, its name and the pointer', () => {
50
50
  const { onContextMenu } = renderSidebar();
51
51
  const gtm = screen.getByRole('button', { name: /^GTM/ });
52
52
  rightClick(gtm, { clientX: 88, clientY: 310 });
53
53
 
54
54
  expect(onContextMenu).toHaveBeenCalledTimes(1);
55
55
  expect(onContextMenu).toHaveBeenCalledWith({
56
- filter: { kind: 'group', group: 'GTM' },
56
+ filter: { kind: 'group', plugin: 'GTM' },
57
57
  label: 'GTM',
58
58
  x: 88,
59
59
  y: 310,
@@ -70,24 +70,24 @@ describe('GroupsSidebar: right-click', () => {
70
70
  label: 'Owned by me',
71
71
  });
72
72
 
73
- rightClick(screen.getByRole('button', { name: /^Juan's Group/ }));
73
+ rightClick(screen.getByRole('button', { name: /^Juan's Plugin/ }));
74
74
  expect(onContextMenu.mock.calls[1][0]).toMatchObject({
75
75
  filter: { kind: 'ungrouped' },
76
- label: "Juan's Group",
76
+ label: "Juan's Plugin",
77
77
  });
78
78
  });
79
79
 
80
80
  /**
81
81
  * A locked row emits the same `{ kind: 'group' }` target a readable one does,
82
- * for the same reason its CLICK does: a group you are not in is still a place.
82
+ * for the same reason its CLICK does: a plugin you are not in is still a place.
83
83
  * The label drops the "(locked)" suffix — that is the accessible name, not the
84
- * group's name, and the menu titles itself with the latter.
84
+ * plugin's name, and the menu titles itself with the latter.
85
85
  */
86
- it('reports a locked row exactly like a readable group', () => {
86
+ it('reports a locked row exactly like a readable plugin', () => {
87
87
  const { onContextMenu } = renderSidebar();
88
88
  rightClick(screen.getByRole('button', { name: 'Finance (locked)' }));
89
89
  expect(onContextMenu.mock.calls[0][0]).toMatchObject({
90
- filter: { kind: 'group', group: 'Finance' },
90
+ filter: { kind: 'group', plugin: 'Finance' },
91
91
  label: 'Finance',
92
92
  });
93
93
  });
@@ -95,16 +95,16 @@ describe('GroupsSidebar: right-click', () => {
95
95
  /**
96
96
  * The home row has no `LibraryFilter` behind it — the index lists places, not
97
97
  * a slice of the catalog — so it reports `null` and gets the nav's own menu:
98
- * create a group, and none of the verbs that need a folder to point at.
98
+ * create a plugin, and none of the verbs that need a folder to point at.
99
99
  */
100
- it('reports the All groups row with no filter, but with its own row and name', () => {
100
+ it('reports the All plugins row with no filter, but with its own row and name', () => {
101
101
  const { onContextMenu } = renderSidebar();
102
- const home = screen.getByRole('button', { name: 'All groups' });
102
+ const home = screen.getByRole('button', { name: 'All plugins' });
103
103
  rightClick(home);
104
104
  expect(onContextMenu).toHaveBeenCalledTimes(1);
105
105
  expect(onContextMenu.mock.calls[0][0]).toMatchObject({
106
106
  filter: null,
107
- label: 'All groups',
107
+ label: 'All plugins',
108
108
  row: home,
109
109
  });
110
110
  });
@@ -123,14 +123,14 @@ describe('GroupsSidebar: right-click', () => {
123
123
 
124
124
  /**
125
125
  * The nav wraps every row, so without `stopPropagation` a right-click on a
126
- * group would report the group AND then the empty space — and the layout
126
+ * plugin would report the plugin AND then the empty space — and the layout
127
127
  * would render the empty-space menu, since the last call wins.
128
128
  */
129
129
  it('does not also report the nav when the click landed on a row', () => {
130
130
  const { onContextMenu } = renderSidebar();
131
131
  rightClick(screen.getByRole('button', { name: /^Engineering/ }));
132
132
  expect(onContextMenu).toHaveBeenCalledTimes(1);
133
- expect(onContextMenu.mock.calls[0][0].filter).toEqual({ kind: 'group', group: 'Engineering' });
133
+ expect(onContextMenu.mock.calls[0][0].filter).toEqual({ kind: 'group', plugin: 'Engineering' });
134
134
  });
135
135
 
136
136
  it('suppresses the browser menu when the click is being handled', () => {
@@ -156,12 +156,12 @@ describe('GroupsSidebar: right-click', () => {
156
156
  it('still navigates on a left click. The menu changes nothing about selection', () => {
157
157
  const { onSelect, onContextMenu } = renderSidebar();
158
158
  fireEvent.click(screen.getByRole('button', { name: /^GTM/ }));
159
- expect(onSelect).toHaveBeenCalledWith({ kind: 'group', group: 'GTM' });
159
+ expect(onSelect).toHaveBeenCalledWith({ kind: 'group', plugin: 'GTM' });
160
160
  expect(onContextMenu).not.toHaveBeenCalled();
161
161
  });
162
162
 
163
163
  it('marks the current row from the target it navigates to', () => {
164
- renderSidebar({ filter: { kind: 'group', group: 'GTM' } });
164
+ renderSidebar({ filter: { kind: 'group', plugin: 'GTM' } });
165
165
  expect(screen.getByRole('button', { name: /^GTM/ })).toHaveAttribute('aria-current', 'true');
166
166
  expect(screen.getByRole('button', { name: /^Engineering/ })).toHaveAttribute(
167
167
  'aria-current',
@@ -1,47 +1,47 @@
1
1
  import { describe, it, expect, vi } from 'vitest';
2
2
  import { render, screen, fireEvent, within } from '@testing-library/react';
3
- import { GroupsSidebar, type GroupsSidebarProps } from '../components/GroupsSidebar';
3
+ import { PluginsSidebar, type PluginsSidebarProps } from '../components/PluginsSidebar';
4
4
 
5
5
  /**
6
- * The locked half of the nav: groups the caller cannot read still appear, below
6
+ * The locked half of the nav: plugins the caller cannot read still appear, below
7
7
  * a break, with a lock where a count would be.
8
8
  *
9
9
  * Locked selection is a URL like any other — a locked row emits the SAME
10
- * `{ kind: 'group' }` intent as a readable one, and the group page decides which
11
- * view the caller gets. That is deliberate: one route per group means a locked
12
- * group can be linked to and bookmarked, and unlocking one changes nothing about
10
+ * `{ kind: 'group' }` intent as a readable one, and the plugin page decides which
11
+ * view the caller gets. That is deliberate: one route per plugin means a locked
12
+ * plugin can be linked to and bookmarked, and unlocking one changes nothing about
13
13
  * where it lives.
14
14
  */
15
15
 
16
- function renderSidebar(over: Partial<GroupsSidebarProps> = {}) {
16
+ function renderSidebar(over: Partial<PluginsSidebarProps> = {}) {
17
17
  const onSelect = vi.fn();
18
- const props: GroupsSidebarProps = {
18
+ const props: PluginsSidebarProps = {
19
19
  filter: { kind: 'all' },
20
20
  onSelect,
21
- groups: [
22
- { group: 'Engineering', count: 4, attention: 0 },
23
- { group: 'GTM', count: 3, attention: 2 },
21
+ plugins: [
22
+ { plugin: 'Engineering', count: 4, attention: 0 },
23
+ { plugin: 'GTM', count: 3, attention: 2 },
24
24
  ],
25
- lockedGroups: ['Finance', 'Legal'],
25
+ lockedPlugins: ['Finance', 'Legal'],
26
26
  ownedCount: 2,
27
27
  ownedAttention: 0,
28
- personalGroupLabel: "Juan's Group",
28
+ personalPluginLabel: "Juan's Plugin",
29
29
  ungroupedCount: 1,
30
30
  attentionCount: 2,
31
31
  onFinishSetup: vi.fn(),
32
- onCreateGroup: vi.fn(),
33
- groupsIndexActive: false,
34
- onOpenGroupsIndex: vi.fn(),
32
+ onCreatePlugin: vi.fn(),
33
+ pluginsIndexActive: false,
34
+ onOpenPluginsIndex: vi.fn(),
35
35
 
36
36
  ...over,
37
37
  };
38
- render(<GroupsSidebar {...props} />);
38
+ render(<PluginsSidebar {...props} />);
39
39
  return { onSelect };
40
40
  }
41
41
 
42
- const nav = () => screen.getByRole('navigation', { name: 'Library groups' });
42
+ const nav = () => screen.getByRole('navigation', { name: 'Library plugins' });
43
43
 
44
- describe('GroupsSidebar: locked groups', () => {
44
+ describe('PluginsSidebar: locked plugins', () => {
45
45
  it('names a locked row by its state, with no count in it', () => {
46
46
  renderSidebar();
47
47
  const finance = screen.getByRole('button', { name: 'Finance (locked)' });
@@ -51,18 +51,18 @@ describe('GroupsSidebar: locked groups', () => {
51
51
  expect(finance.textContent).toBe('Finance');
52
52
  });
53
53
 
54
- it('puts the locked rows last, after every group the caller is in', () => {
54
+ it('puts the locked rows last, after every plugin the caller is in', () => {
55
55
  renderSidebar();
56
56
  const labels = within(nav())
57
57
  .getAllByRole('button')
58
58
  .map((b) => b.getAttribute('aria-label') ?? b.textContent);
59
59
  expect(labels).toEqual([
60
- 'All groups',
60
+ 'All plugins',
61
61
  'Everything',
62
62
  'Owned by me2',
63
- 'New group',
64
- // Your own space leads the groups; the ones you cannot enter trail them.
65
- "Juan's Group1",
63
+ 'New plugin',
64
+ // Your own space leads the plugins; the ones you cannot enter trail them.
65
+ "Juan's Plugin1",
66
66
  'Engineering4',
67
67
  'GTM2',
68
68
  'Finance (locked)',
@@ -70,14 +70,14 @@ describe('GroupsSidebar: locked groups', () => {
70
70
  ]);
71
71
  });
72
72
 
73
- it('navigates to the group route on click, exactly like a readable group', () => {
73
+ it('navigates to the plugin route on click, exactly like a readable plugin', () => {
74
74
  const { onSelect } = renderSidebar();
75
75
  fireEvent.click(screen.getByRole('button', { name: 'Finance (locked)' }));
76
- expect(onSelect).toHaveBeenCalledWith({ kind: 'group', group: 'Finance' });
76
+ expect(onSelect).toHaveBeenCalledWith({ kind: 'group', plugin: 'Finance' });
77
77
  });
78
78
 
79
- it('marks the locked row current when its group is the route', () => {
80
- renderSidebar({ filter: { kind: 'group', group: 'Finance' } });
79
+ it('marks the locked row current when its plugin is the route', () => {
80
+ renderSidebar({ filter: { kind: 'group', plugin: 'Finance' } });
81
81
  expect(screen.getByRole('button', { name: 'Finance (locked)' })).toHaveAttribute(
82
82
  'aria-current',
83
83
  'true',
@@ -89,7 +89,7 @@ describe('GroupsSidebar: locked groups', () => {
89
89
  });
90
90
 
91
91
  it('renders no locked section at all when nothing is locked', () => {
92
- renderSidebar({ lockedGroups: [] });
92
+ renderSidebar({ lockedPlugins: [] });
93
93
  expect(screen.queryByRole('button', { name: /\(locked\)$/ })).not.toBeInTheDocument();
94
94
  expect(screen.getByRole('button', { name: /^GTM/ })).toBeInTheDocument();
95
95
  });