@app-vitals/agent-lib 1.50.0 → 1.51.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@app-vitals/agent-lib",
3
- "version": "1.50.0",
3
+ "version": "1.51.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/app-vitals/agent.git",
package/web/toolbar.ts CHANGED
@@ -22,11 +22,6 @@ export interface ShipwrightToolbarOptions {
22
22
  readOnly?: boolean;
23
23
  /** Public task board URL, used only in readOnly mode. Defaults to "/public/tasks". */
24
24
  tasksUrl?: string;
25
- /**
26
- * Render the "Account" nav entry (self-serve accounts, admin service only).
27
- * Defaults to false so other services sharing this toolbar never show it.
28
- */
29
- showAccount?: boolean;
30
25
  /**
31
26
  * Render the "Settings" nav entry (links to /admin/settings; shown to
32
27
  * admins and account members). Defaults to false.
@@ -235,7 +230,7 @@ export function renderShipwrightToolbar(
235
230
  <a href="${adminBase}/admin/prs" class="vos-nav-link${active("/admin/prs")}">PRs</a>
236
231
  <a href="${adminBase}/admin/chat" class="vos-nav-link${active("/admin/chat")}">Chat</a>
237
232
  <a href="${adminBase}/admin/queue-activity" class="vos-nav-link${isQueueActivity ? " active" : ""}">Queue &amp; Activity</a>
238
- ${opts.showAccount ? `<a href="${adminBase}/admin/account" class="vos-nav-link${active("/admin/account")}">Account</a>\n ` : ""}${opts.showSettings ? `<a href="${adminBase}/admin/settings" class="vos-nav-link${active("/admin/settings")}">Settings</a>\n ` : ""}<a href="${metricsUrl}" class="vos-nav-link${active(metricsUrl)}">Metrics</a>
233
+ ${opts.showSettings ? `<a href="${adminBase}/admin/settings" class="vos-nav-link${active("/admin/settings")}">Settings</a>\n ` : ""}<a href="${metricsUrl}" class="vos-nav-link${active(metricsUrl)}">Metrics</a>
239
234
  </div>
240
235
  <div class="vos-user">
241
236
  <span class="vos-username">${escapeHtml(userName)}</span>
@@ -207,38 +207,15 @@ describe("renderShipwrightToolbar", () => {
207
207
  });
208
208
  });
209
209
 
210
- describe("renderShipwrightToolbar Account entry (SSP-3.2)", () => {
211
- const base = {
212
- userName: "Alice",
213
- activePath: "/admin/agents",
214
- logoutAction: "/auth/logout",
215
- };
216
-
217
- test("omits the Account link by default so other services never render it", () => {
218
- expect(renderShipwrightToolbar(base)).not.toContain("/admin/account");
219
- });
220
-
221
- test("renders the Account link when showAccount is true", () => {
222
- const html = renderShipwrightToolbar({ ...base, showAccount: true });
223
- expect(html).toContain('href="/admin/account" class="vos-nav-link');
224
- });
225
-
226
- test("highlights Account when it is the active path", () => {
227
- const html = renderShipwrightToolbar({
228
- ...base,
229
- activePath: "/admin/account",
230
- showAccount: true,
231
- });
232
- expect(html).toContain('href="/admin/account" class="vos-nav-link active"');
233
- });
234
-
235
- test("readOnly mode never renders Account even when showAccount is true", () => {
210
+ describe("renderShipwrightToolbar Account entry (SGL-2.3)", () => {
211
+ test("never renders a top-level Account link (Settings covers it)", () => {
236
212
  const html = renderShipwrightToolbar({
237
- ...base,
238
- readOnly: true,
239
- showAccount: true,
213
+ userName: "Alice",
214
+ activePath: "/admin/agents",
215
+ logoutAction: "/auth/logout",
216
+ showSettings: true,
240
217
  });
241
- expect(html).not.toContain("/admin/account");
218
+ expect(html).not.toContain('href="/admin/account"');
242
219
  });
243
220
  });
244
221