From 46d6e977855ea11c0e38ca982116fb790b984e2d Mon Sep 17 00:00:00 2001 From: Algis Dumbris Date: Sun, 22 Nov 2026 13:56:25 +0200 Subject: [PATCH] Fix Skills review navigation --- README.md | 1 + ROADMAP.md | 1 + docs/development/web-ui-verification.md | 2 +- docs/features/skills.md | 14 +- docs/web-ui/dashboard.md | 4 +- docs/web-ui/server-detail.md | 11 +- e2e/web-ui-sweep/skills-tab.spec.ts | 86 ++++++++++- frontend/src/components/ReviewQueueList.vue | 4 +- .../src/components/skills/SkillDetail.vue | 9 +- .../src/components/skills/SkillsPanel.vue | 139 ++++++++++++------ frontend/src/utils/reviewQueue.ts | 8 +- frontend/src/views/ServerDetail.vue | 28 +++- .../tests/unit/review-queue-skills.spec.ts | 10 +- .../unit/server-detail-skills-tab.spec.ts | 31 ++++ frontend/tests/unit/skills-panel.spec.ts | 99 ++++++++++++- scripts/run-skills-tab-sweep.sh | 3 + specs/125-skills-over-mcp/spec.md | 2 + .../checklists/requirements.md | 24 +++ specs/130-skills-review-ux/plan.md | 69 +++++++++ specs/130-skills-review-ux/quickstart.md | 13 ++ specs/130-skills-review-ux/spec.md | 81 ++++++++++ specs/130-skills-review-ux/tasks.md | 30 ++++ .../verification/report.html | 3 + 23 files changed, 599 insertions(+), 73 deletions(-) create mode 100644 specs/130-skills-review-ux/checklists/requirements.md create mode 100644 specs/130-skills-review-ux/plan.md create mode 100644 specs/130-skills-review-ux/quickstart.md create mode 100644 specs/130-skills-review-ux/spec.md create mode 100644 specs/130-skills-review-ux/tasks.md create mode 100644 specs/130-skills-review-ux/verification/report.html diff --git a/README.md b/README.md index 13ee3d0ab..6048324f2 100644 --- a/README.md +++ b/README.md @@ -392,6 +392,7 @@ curl -k https://localhost:8080/api/v1/status ### Features - [Search & Tool Discovery](https://docs.mcpproxy.app/features/search-discovery/) +- [Skills over MCP](https://docs.mcpproxy.app/features/skills/) · inspect upstream skills and review those awaiting approval in the Web UI. - [Security Quarantine](https://docs.mcpproxy.app/features/security-quarantine/) - [Security Scanner Plugins](https://docs.mcpproxy.app/features/security-scanner-plugins/) - [Docker Security Isolation](https://docs.mcpproxy.app/features/docker-isolation/) diff --git a/ROADMAP.md b/ROADMAP.md index e802b4d26..247f83830 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1443,3 +1443,4 @@ Legend: `shipped` ≥95% checked · `in-flight` 1–94% · `drafted` 0% · `—` | [127-profile-argument-rules](./specs/127-profile-argument-rules/) | — | — | | [128-server-list-outcomes](./specs/128-server-list-outcomes/) | — | — | | [129-per-user-upstream-credentials](./specs/129-per-user-upstream-credentials/) | — | — | +| [130-skills-review-ux](./specs/130-skills-review-ux/) | `shipped` | 9/9 (100%) | diff --git a/docs/development/web-ui-verification.md b/docs/development/web-ui-verification.md index ec7198f79..96aead55b 100644 --- a/docs/development/web-ui-verification.md +++ b/docs/development/web-ui-verification.md @@ -40,7 +40,7 @@ Alongside it, [`e2e/web-ui-sweep/visual-a11y-sweep.spec.ts`](https://github.com/ ./scripts/run-skills-tab-sweep.sh --self-test # no browser: the clean-environment, redaction and DEBUG=1 checks ``` -It builds the frontend and the core from the checkout (or takes `MCPPROXY_BINARY_PATH`, which must embed the frontend) and `cmd/skillsfixture` (or `SKILLS_FIXTURE_BINARY`), starts the fixture and a throwaway core on free loopback ports with a scratch data dir (never `~/.mcpproxy`: the core and the fixture start with a clean environment, `env -i` with only `PATH`, a scratch `HOME` and a scratch `TMPDIR`, so no `MCPPROXY_*` of the operator's reaches them (`MCPPROXY_DATA_DIR` would override the config's `data_dir`, `MCPPROXY_AUDIT_LOG_PATH` would audit into the operator's file), with `--data-dir` naming the scratch dir and a data dir under `$HOME/.mcpproxy` refused; `--self-test` proves decoys for the data dir, audit log, TPA bundle and certs paths are not touched, and that a `DEBUG=1` run, which prints progress lines and never uses xtrace, does not print the API key), `enable_skills: true`, a generated API key and the fixture as a `trust_mode: manual` streamable-http upstream, approves the server, runs the spec, and stops only what it started. The scenarios run in order against fresh state: list, viewer and part-by-part paging, approve, an upstream change to an approved skill while it is open (stale review, re-open, file diff, line diff, approve), an upstream change to a pending skill while it is open (stale review with Approve disabled, re-open), a change refreshed through the REST API that marks the open review stale through the live `skills.changed` event alone, block and unblock, and no page error. The scenarios are one serial group with retries off (a retry would replay against state the first attempt changed). The API key reaches the page through `localStorage`, never a URL, and the spec records no traces. It writes `skills-sweep-results.json` (`checked_commit` = `git rev-parse HEAD` and `working_tree_dirty`, with a dirty tree labelled pre-commit evidence; the fixture command as basename and arguments and its port; each scenario's pass/fail with the first failed attempt's error; and `GET /api/v1/servers//skills` read back after the approve, block and unblock steps: status, blocked, available, current_hash, approved_hash), plus screenshots, and exits non-zero on any failure. Every text file it writes, and every message it prints that can carry a path or a log (including the fixture or core log dumped on a startup failure), has the API key replaced by `***` and local paths by ``, ``, `` or `~` (paths inside the checkout are printed relative to it), the configured binary and browser paths and any other path whose first segment exists on the machine by `/` (text whose root does not exist there, such as a regex literal `/approved/i` or a route `/skills/refresh`, is kept); `--self-test` checks the stdout and stderr of a passing run and of a forced fixture and core startup failure for the key and for absolute paths. The release gate runs it with `--self-test-first` in the advisory `web-ui-sweep` job, recorded as the advisory manifest entry `advisory/skills-tab-sweep`. The committed report is `specs/125-skills-over-mcp/verification/report.html`, written from a clean commit with `--no-screenshots` (no embedded screenshots); the copy with screenshots is for artifacts. +It builds the frontend and the core from the checkout (or takes `MCPPROXY_BINARY_PATH`, which must embed the frontend) and `cmd/skillsfixture` (or `SKILLS_FIXTURE_BINARY`), starts the fixture and a throwaway core on free loopback ports with a scratch data dir (never `~/.mcpproxy`: the core and the fixture start with a clean environment, `env -i` with only `PATH`, a scratch `HOME` and a scratch `TMPDIR`, so no `MCPPROXY_*` of the operator's reaches them (`MCPPROXY_DATA_DIR` would override the config's `data_dir`, `MCPPROXY_AUDIT_LOG_PATH` would audit into the operator's file), with `--data-dir` naming the scratch dir and a data dir under `$HOME/.mcpproxy` refused; `--self-test` proves decoys for the data dir, audit log, TPA bundle and certs paths are not touched, and that a `DEBUG=1` run, which prints progress lines and never uses xtrace, does not print the API key), `enable_skills: true`, a generated API key and the fixture as a `trust_mode: manual` streamable-http upstream, approves the server, runs the spec, and stops only what it started. The scenarios run in order against fresh state: list, viewer and part-by-part paging, approve, an upstream change to an approved skill while it is open (stale review, re-open, file diff, line diff, approve), an upstream change to a pending skill while it is open (stale review with Approve disabled, re-open), a change refreshed through the REST API that marks the open review stale through the live `skills.changed` event alone, block and unblock, reload with no page error, mixed and skill-only Review queue links filtering out the approved skill, immediate desktop detail beside the list, and compact keyboard opening with Back restoring row focus. The scenarios are one serial group with retries off (a retry would replay against state the first attempt changed). The API key reaches the page through `localStorage`, never a URL, and the spec records no traces. It writes `skills-sweep-results.json` (`checked_commit` = `git rev-parse HEAD` and `working_tree_dirty`, with a dirty tree labelled pre-commit evidence; the fixture command as basename and arguments and its port; each scenario's pass/fail with the first failed attempt's error; and `GET /api/v1/servers//skills` read back after the approve, block and unblock steps: status, blocked, available, current_hash, approved_hash), plus screenshots, and exits non-zero on any failure. Every text file it writes, and every message it prints that can carry a path or a log (including the fixture or core log dumped on a startup failure), has the API key replaced by `***` and local paths by ``, ``, `` or `~` (paths inside the checkout are printed relative to it), the configured binary and browser paths and any other path whose first segment exists on the machine by `/` (text whose root does not exist there, such as a regex literal `/approved/i` or a route `/skills/refresh`, is kept); `--self-test` checks the stdout and stderr of a passing run and of a forced fixture and core startup failure for the key and for absolute paths. The release gate runs it with `--self-test-first` in the advisory `web-ui-sweep` job, recorded as the advisory manifest entry `advisory/skills-tab-sweep`. The committed report is `specs/125-skills-over-mcp/verification/report.html`, written from a clean commit with `--no-screenshots` (no embedded screenshots); the copy with screenshots is for artifacts. Manual fallback (to step through by hand): `go run ./cmd/skillsfixture -addr 127.0.0.1:` (three skills; `POST /_fixture/mutate?skill=&file=` with the new bytes and the header `X-Skills-Fixture: mutate` changes one; a request with an `Origin` header or a `Host` other than the listen address is refused), a core with `"enable_skills": true` and the fixture as a `trust_mode: manual` streamable-http upstream at `http://127.0.0.1:/mcp`, `POST /api/v1/servers//security/approve` with `{"force":true}`, then the spec with `MCPPROXY_BASE_URL`, `MCPPROXY_API_KEY`, `SWEEP_SERVER_NAME` and `SKILLS_FIXTURE_URL` set. diff --git a/docs/features/skills.md b/docs/features/skills.md index ae97b8f21..e16c5d5db 100644 --- a/docs/features/skills.md +++ b/docs/features/skills.md @@ -153,11 +153,23 @@ version you opened: a new version that arrives while you review is shown as a stale review with Approve off until you open it, and a skill that changed on the server before the page knew is refused with a notice and the list reloads. See [Server Detail page](../web-ui/server-detail.md#skills-tab). +The tab has **All skills** and **Needs review** filters. Opening the tab directly +shows all skills. A Skills action from the global Review queue opens +`?tab=skills&state=needs-review`, which shows only currently listed, unblocked +skills in Pending or Changed state. The displayed count follows that filtered +list. You can switch to All skills to inspect approved, blocked, or unusable +records. On desktop, selecting a skill shows its card beside the list. On a +compact screen, the card takes the list's place and **Back to skills** returns +to the selected row. Keyboard focus follows the card on open and the row on +return. A refresh retains the open card and the approval version check; if an +action removes that skill from Needs review, the card stays visible until you +go back or choose another skill. + ### Where held skills show up {#held-skills-in-review} A skill that is pending or changed (not blocked, still listed, on an enabled server that is not quarantined and not excluded) is owed a review, and it shows up next to the tool reviews: -- **Review queue** (`GET /api/v1/review`, the Web UI Review queue, `mcpproxy review list`, the macOS Review Queue). A server with held tools keeps its row and gains `skills_pending` / `skills_changed`; a server with only held skills gets a row of kind `skill_review`, and `count` (the sidebar badge) includes it. In the Web UI that row's **Review** opens the server's Skills tab; a tool row with held skills also offers **Skills**. The macOS app has no Skills tab, so its row says "Review in the Web UI" and opens that page in the browser. +- **Review queue** (`GET /api/v1/review`, the Web UI Review queue, `mcpproxy review list`, the macOS Review Queue). A server with held tools keeps its row and gains `skills_pending` / `skills_changed`; a server with only held skills gets a row of kind `skill_review`, and `count` (the sidebar badge) includes it. In the Web UI that row's **Review** opens the server's Skills tab with Needs review active; a tool row with held skills also offers **Skills**, which opens the same filter. The tool row's **Review** still opens tool review. The macOS app has no Skills tab, so its row says "Review in the Web UI" and opens that page in the browser. - **Needs attention** (Home, the header pill, `mcpproxy attention`): one `skill_review` item per state, ranked right after the tool reviews (62 changed, 63 pending), fixed on the server's Skills tab. A quarantined server is only a server review: its skills are not read until it is approved. diff --git a/docs/web-ui/dashboard.md b/docs/web-ui/dashboard.md index a29d38b0e..465741c08 100644 --- a/docs/web-ui/dashboard.md +++ b/docs/web-ui/dashboard.md @@ -48,7 +48,7 @@ The sidebar is grouped by what you are doing: | Protect | Review queue (badge = servers awaiting review), Secrets | | Monitor | Activity, Usage | -Settings, Docs, Feedback and the theme switch sit below the groups. **Clients** is the home for connecting a client later, seeing who is talking to MCPProxy, the **Endpoint & mode** tab and the **Agent tokens** tab. The **Review queue** is where quarantined servers and new or changed tools are reviewed with their full definitions before approval. +Settings, Docs, Feedback and the theme switch sit below the groups. **Clients** is the home for connecting a client later, seeing who is talking to MCPProxy, the **Endpoint & mode** tab and the **Agent tokens** tab. The **Review queue** is where quarantined servers, new or changed tools, and held skills are reviewed with their full definitions before approval. ## The header @@ -87,7 +87,7 @@ Env values and headers whose names look like secrets default to **Secret**, whic ### Review before approval -Quarantined servers wait on the [Review queue](/features/security-quarantine). The review screen lists every tool read-only with its tier, annotations and scan verdict before you approve, and lets you leave tools out. Approving always goes through the scan gate. The queue lists every server that is owed a review, including disabled ones (marked **Disabled**). It opens on **Active blockers** (enabled servers and tool changes that hold a live agent) when there are any, with **All reviews** one click away, plus a search box and a sort menu. The Home attention list covers enabled servers only, so its number can be smaller than the full queue. With [Skills over MCP](/features/skills#held-skills-in-review) on, held skills appear here too (administrators only): a row reads "N skills awaiting review · M changed", and a server whose only owed review is skills links to its Skills tab. +Quarantined servers wait on the [Review queue](/features/security-quarantine). The review screen lists every tool read-only with its tier, annotations and scan verdict before you approve, and lets you leave tools out. Approving always goes through the scan gate. The queue lists every server that is owed a review, including disabled ones (marked **Disabled**). It opens on **Active blockers** (enabled servers and tool changes that hold a live agent) when there are any, with **All reviews** one click away, plus a search box and a sort menu. The Home attention list covers enabled servers only, so its number can be smaller than the full queue. With [Skills over MCP](/features/skills#held-skills-in-review) on, held skills appear here too (administrators only): a row reads "N skills awaiting review · M changed". A skill-only row's **Review** and a mixed row's **Skills** open the server's Skills tab with **Needs review** active, showing only currently listed, unblocked Pending or Changed skills. A mixed row's **Review** still opens tool review. ## Tool Search diff --git a/docs/web-ui/server-detail.md b/docs/web-ui/server-detail.md index 28454cadc..319b0a6fa 100644 --- a/docs/web-ui/server-detail.md +++ b/docs/web-ui/server-detail.md @@ -33,7 +33,16 @@ offered opens the Tools tab instead (and the URL says `?tab=tools`). Changed, Awaiting review or Approved), whether it is offered to agents, its file count and its scan verdict. **Refresh** reads the server's skills again; the list also reloads by itself when a `skills.changed` event arrives for - this server. + this server. **All skills** is the default for a direct tab visit. **Needs + review** shows only Pending or Changed skills that are currently listed and + unblocked, with a count matching the visible rows. Review queue Skills links + open `?tab=skills&state=needs-review`. +- **Selection.** On a desktop screen the selected skill's card opens beside the + list, immediately in view. On a compact screen the card replaces the list; + **Back to skills** returns to the list and restores focus to the selected + row. Focus enters the detail when a skill is opened. If an action removes an + open skill from Needs review, its card stays visible until Back or another + selection. A normal refresh also keeps the card open. - **Files and viewer.** The files of the selected skill with size and digest. A text file opens in a viewer that reads it in 64 KiB parts (**Load more**); once a skill has an approved copy you can switch the viewer between the diff --git a/e2e/web-ui-sweep/skills-tab.spec.ts b/e2e/web-ui-sweep/skills-tab.spec.ts index b993de480..2b5c94f76 100644 --- a/e2e/web-ui-sweep/skills-tab.spec.ts +++ b/e2e/web-ui-sweep/skills-tab.spec.ts @@ -18,7 +18,10 @@ // the open review by the live skills.changed event alone: its stale // banner appears by itself; // 7. block and unblock; -// 8. no uncaught page error anywhere. +// 8. reload through the Skills deep link; +// 9. a skill-only Review queue action opens only held skills; +// 10. selecting a skill puts its detail beside the desktop list; +// 11. compact keyboard selection opens the detail and Back restores row focus. // // Normally run by scripts/run-skills-tab-sweep.sh, which starts everything and // sets the environment (docs/development/web-ui-verification.md): @@ -60,7 +63,7 @@ function url(route: string): string { test.use({ trace: 'off' }) async function shot(page: Page, name: string, focus?: string) { - // The detail pane sits below the list; scroll the part worth seeing into view. + // Bring a specific viewer or diff into view when the scenario needs it. if (focus) await page.locator(focus).first().scrollIntoViewIfNeeded() const body = await page.screenshot({ fullPage: false }) await test.info().attach(`skills-tab-${name}`, { body, contentType: 'image/png' }) @@ -294,3 +297,82 @@ test('the tab survives a reload through ?tab=skills and no page error was thrown await expect(page.locator('[data-test="skills-tab"]')).toHaveClass(/tab-active/) expect(pageErrors, 'uncaught page errors').toEqual([]) }) + +// The manual-trust fixture also has a pending echo tool. Check its mixed +// queue row first, then approve echo to exercise the skill-only row as well. +test('the mixed and skill-only Review queue actions open only held skills', async ({ page }) => { + await page.goto(url('/review')) + const queueRow = page.locator(`[data-test="servers-review-row-${SERVER}"]`) + const skills = queueRow.locator(`[data-test="servers-review-skills-link-${SERVER}"]`) + const review = queueRow.locator(`[data-test="servers-review-link-${SERVER}"]`) + const expectHeldSkills = async () => { + await expect(page).toHaveURL(url(`/servers/${SERVER}?tab=skills&state=needs-review`)) + const filter = page.locator('[data-test="skills-filter-needs-review"]') + await expect(filter).toHaveAttribute('aria-pressed', 'true') + await expect(filter).toHaveText('Needs review (2)') + await expect(row(page, 'with-files')).toBeVisible() + await expect(row(page, 'big')).toBeVisible() + await expect(row(page, 'plain')).toHaveCount(0) + } + + await skills.click() + await expectHeldSkills() + + await page.goto(url('/review')) + await review.click() + await expect(page).toHaveURL(url(`/review/${SERVER}`)) + const echo = page.locator('[data-test="review-tool-echo"]') + await echo.getByRole('button', { name: 'Approve', exact: true }).click() + await expect(echo.locator('[data-test="review-tool-state-echo"]')).toHaveText('Approved') + + await page.goto(url('/review')) + await expect(queueRow).toBeVisible() + await expect(skills).toHaveCount(0) + await review.click() + await expectHeldSkills() + await shot(page, '07-queue-needs-review') +}) + +test('selecting a skill reveals its detail beside the desktop list', async ({ page }) => { + await page.setViewportSize({ width: 1440, height: 900 }) + await page.goto(url(`/servers/${SERVER}?tab=skills`)) + await expect(page.locator('[data-test="skills-filter-all"]')).toHaveAttribute('aria-pressed', 'true') + const list = page.locator('[data-test="skills-list"]') + await row(page, 'with-files').click() + const detail = page.locator('[data-test="skill-detail"]') + const heading = detail.locator('[data-test="skill-name"]') + await expect(heading).toHaveText('with-files') + await expect(heading).toBeInViewport() + const listBox = await list.boundingBox() + const detailBox = await detail.boundingBox() + expect(listBox).not.toBeNull() + expect(detailBox).not.toBeNull() + expect(detailBox!.x, 'detail begins to the right of the list').toBeGreaterThan(listBox!.x + listBox!.width - 2) + await shot(page, '08-desktop-detail') +}) + +test('compact keyboard selection opens detail and Back restores row focus', async ({ page }) => { + await page.setViewportSize({ width: 390, height: 844 }) + await page.goto(url(`/servers/${SERVER}?tab=skills`)) + const selected = row(page, 'with-files') + await expect(selected).toBeVisible() + await selected.focus() + await selected.press('Enter') + + const heading = page.locator('[data-test="skill-name"]') + const back = page.locator('[data-test="skill-back-to-list"]') + await expect(heading).toHaveText('with-files') + await expect(heading).toBeFocused() + await expect(heading).toBeInViewport() + await expect(back).toBeInViewport() + await expect(selected).toBeHidden() + await shot(page, '09-mobile-detail') + + await page.keyboard.press('Shift+Tab') + await expect(back).toBeFocused() + await page.keyboard.press('Enter') + await expect(selected).toBeVisible() + await expect(selected).toBeFocused() + await expect(page.locator('[data-test="skill-detail"]')).toHaveCount(0) + expect(pageErrors, 'uncaught page errors').toEqual([]) +}) diff --git a/frontend/src/components/ReviewQueueList.vue b/frontend/src/components/ReviewQueueList.vue index bc9599816..b2ad9c837 100644 --- a/frontend/src/components/ReviewQueueList.vue +++ b/frontend/src/components/ReviewQueueList.vue @@ -5,14 +5,14 @@ Disabled Quarantined - Skills + Skills Review diff --git a/frontend/src/components/skills/SkillDetail.vue b/frontend/src/components/skills/SkillDetail.vue index 614a02ff2..475a0fd5b 100644 --- a/frontend/src/components/skills/SkillDetail.vue +++ b/frontend/src/components/skills/SkillDetail.vue @@ -2,7 +2,7 @@
-

+

from the server, not verified

@@ -115,6 +115,13 @@ const emit = defineEmits<{ (e: 'content-changed'): void }>() +const heading = ref(null) +function focusHeading() { + heading.value?.focus({ preventScroll: true }) + return heading.value +} +defineExpose({ focusHeading }) + /** Files larger than this (either copy) are not line-diffed in the browser. */ const LINE_DIFF_MAX_BYTES = 256 * 1024 diff --git a/frontend/src/components/skills/SkillsPanel.vue b/frontend/src/components/skills/SkillsPanel.vue index da86d1798..79aa21fc4 100644 --- a/frontend/src/components/skills/SkillsPanel.vue +++ b/frontend/src/components/skills/SkillsPanel.vue @@ -38,62 +38,80 @@

This server does not announce the skills extension.

-

- This server lists no skills. -

-
    -
  • - -
  • -
+
+
+
+ + +
+

+ No skills need review. +

+

+ This server lists no skills. +

+
    +
  • + +
  • +
+
-
- This skill changed while you were reviewing it. Approve is off until you open the new version. - -
-
- The server's skills changed. Approve is off until the list is reloaded. - -
+
+ +
+ This skill changed while you were reviewing it. Approve is off until you open the new version. + +
+
+ The server's skills changed. Approve is off until the list is reloaded. + +
- - + + +
+