From f61906f9709e55bde623dd19cd43fcb3eda7d47b Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Tue, 24 Nov 2026 19:50:29 +0100 Subject: [PATCH] docs(36-02): add Plan 36-02 execution summary --- .../36-02-SUMMARY.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .planning/phases/36-granular-mcp-oauth-api-token-scope-picker/36-02-SUMMARY.md diff --git a/.planning/phases/36-granular-mcp-oauth-api-token-scope-picker/36-02-SUMMARY.md b/.planning/phases/36-granular-mcp-oauth-api-token-scope-picker/36-02-SUMMARY.md new file mode 100644 index 00000000..a0fc0dbd --- /dev/null +++ b/.planning/phases/36-granular-mcp-oauth-api-token-scope-picker/36-02-SUMMARY.md @@ -0,0 +1,75 @@ +--- +phase: 36-granular-mcp-oauth-api-token-scope-picker +plan: 02 +subsystem: admin-spa-scope-picker +tags: [admin-spa, vue, reka-ui, scopes, mcp-connect, api-tokens, boardwalk] +key-files: + created: + - admin/src/app/scopeCatalog.ts + - admin/src/components/scopes/useScopeSelection.ts + - admin/src/components/scopes/ScopeAccessControl.vue + - admin/src/components/scopes/ScopePicker.vue + modified: + - admin/src/styles/main.css + - admin/src/views/ConnectView.vue + - admin/src/components/account/ApiTokenCreateDialog.vue + - admin/tests/fixtures/lang.json + - admin/tests/smoke/connect.smoke.test.ts + - admin/tests/views/ConnectView.test.ts + - admin/tests/account/ApiTokenCreateDialog.test.ts + - admin/tests/account/ApiTokensPanel.test.ts + - modules/boardwalk/dist/index.html + - modules/boardwalk/dist/assets/editor-BSenhWHV.js + - modules/boardwalk/dist/assets/index-D3o9qWRZ.js + - modules/boardwalk/dist/assets/index-DB7OYKHr.css + - modules/boardwalk/dist/assets/load-DTzYQCXy.js +decisions: + - D-01, D-04, D-06, D-07, D-17: Built pure domain module `admin/src/app/scopeCatalog.ts` and reactive composable `useScopeSelection.ts` implementing `(plugin_id, group)` flat collation without label collisions, smart accordion expand thresholds (`<= 3` groups or `<= 12` scopes), elevated-first 6-chip summary with `+N more`, and opt-in `admin:read` locking (`via admin:read`, selective `Clear`, disabled per-group `Read`, never leaking `admin:read` unless explicitly checked). + - D-02, D-03, D-09, D-10, D-11, D-12: Implemented `ScopeAccessControl.vue` and `ScopePicker.vue` using semantic Direction C v2 tokens only, added `.connect-light-surface` in `admin/src/styles/main.css` `@layer components` re-declaring both `--c-*` and `--color-*` aliases, and wired `ConnectView.vue` with `Read-only (admin:read)` default and a responsive light-literal Reka `Dialog` Customize modal (`100dvh` mobile / `max-w-[640px] max-h-[85dvh]` desktop). + - D-08, D-13, D-15: Integrated `ScopeAccessControl` and in-dialog `ScopePicker` view swap into `ApiTokenCreateDialog.vue` at fixed `max-w-[560px]` with zero nested overlay, Escape returning to the token form while preserving `name`/`expires`, `mod+s`/`mod+enter` unmounted during scope customization, and `ApiTokensPanel.vue` confirmed compatible untouched. +metrics: + tasks_completed: 3 + tasks_total: 3 + commits: 3 + completed_date: "2026-11-24" +--- + +# Phase 36 Plan 02: Shared Scope Picker, ConnectView & ApiTokenCreateDialog Integration Summary + +Built the shared Option D 3-tier access control and grouped `ScopePicker` primitives (`scopeCatalog.ts`, `useScopeSelection.ts`, `ScopeAccessControl.vue`, `ScopePicker.vue`, `.connect-light-surface`), integrated them into both `ConnectView.vue` (light-literal responsive Customize modal) and `ApiTokenCreateDialog.vue` (fixed `max-w-[560px]` in-dialog view swap), updated Polish test fixtures and all 4 existing Vitest suites, and rebuilt embedded `modules/boardwalk/dist`. + +## Tasks & Commits + +| Task | Description | Commit | Files | +|------|-------------|--------|-------| +| 1 | Add `.connect-light-surface`, shared scope module (`scopeCatalog`, `useScopeSelection`, `ScopeAccessControl`, `ScopePicker`), and wire `ConnectView.vue` | `6d7325e6` | `admin/src/styles/main.css`, `admin/src/app/scopeCatalog.ts`, `admin/src/components/scopes/useScopeSelection.ts`, `admin/src/components/scopes/ScopeAccessControl.vue`, `admin/src/components/scopes/ScopePicker.vue`, `admin/src/views/ConnectView.vue` | +| 2 | Integrate `ScopeAccessControl` and in-dialog `ScopePicker` view swap into `ApiTokenCreateDialog.vue` and confirm `ApiTokensPanel.vue` compatibility | `33666468` | `admin/src/components/account/ApiTokenCreateDialog.vue` | +| 3 | Update `lang.json` & 4 existing Vitest suites, typecheck, rebuild `modules/boardwalk/dist`, and pass `check-admin-dist.sh` | `3781c979` | `admin/tests/fixtures/lang.json`, `admin/tests/smoke/connect.smoke.test.ts`, `admin/tests/views/ConnectView.test.ts`, `admin/tests/account/ApiTokenCreateDialog.test.ts`, `admin/tests/account/ApiTokensPanel.test.ts`, `modules/boardwalk/dist/*` | + +## Verification Results + +All task and plan verification gates passed with zero failures: + +- `npm --prefix admin run typecheck` — PASS (`vue-tsc --noEmit`, zero errors across `src/` and `tests/`) +- `npm --prefix admin run test` — PASS (`117 passed (117)` test files, `1738 passed (1738)` tests, including `connect.smoke.test.ts`, `ConnectView.test.ts`, `ApiTokenCreateDialog.test.ts`, and `ApiTokensPanel.test.ts`) +- `npm --prefix admin run build` — PASS +- `scripts/check-admin-dist.sh` — PASS (`check-admin-dist: modules/boardwalk/dist matches a fresh build`) +- `go test -short ./modules/boardwalk/...` — PASS (`ok git.golem15.com/golem15/summercms/modules/boardwalk`) + +## Deviations from Plan + +- **Auto-fixed focus timing on 422 in `ApiTokenCreateDialog.vue` (Rule 1 - Bug):** In `onSubmit()`, `focusFirstInvalid()` previously ran inside `try` before `finally { busy.value = false }`, so calling `focusPrimaryControl()` on a disabled `` button inside `
` silently failed to move focus. Moved `if (invalid) { await focusFirstInvalid() }` after `finally { busy.value = false }` so the fieldset and radio controls are re-enabled before focus moves. Included cleanly in Task 2 commit `33666468`. + +## Notes for Wave 3 / Wave 4 + +- Wave 4 (`36-04`) can now add comprehensive unit/component tests for `admin/src/app/scopeCatalog.ts`, `ScopeAccessControl.vue`, `ScopePicker.vue`, `ConnectView.vue`, and `ApiTokenCreateDialog.vue` against the full Polish phrasebook fixture in `admin/tests/fixtures/lang.json` (which now contains all 46 new `api_tokens.*` and `mcp_connect.*` keys including the 3 CLDR plural maps). +- `ApiTokensPanel.vue` required zero edits and passed all 18 tests with additive `plugin_id`/`group` fields on `AdminAPITokenScope`. + +## Self-Check: PASSED + +- Created files verified: `admin/src/app/scopeCatalog.ts`, `admin/src/components/scopes/useScopeSelection.ts`, `admin/src/components/scopes/ScopeAccessControl.vue`, `admin/src/components/scopes/ScopePicker.vue` +- Modified files verified across commits `6d7325e6`, `33666468`, `3781c979` +- Zero `v-html` usage in `admin/src/components/scopes/*.vue`, `admin/src/views/ConnectView.vue`, and `admin/src/components/account/ApiTokenCreateDialog.vue` +- `admin/src/components/account/ApiTokensPanel.vue` untouched +- `.planning/STATE.md` and `.planning/ROADMAP.md` untouched +- Pre-existing unrelated uncommitted workspace files left untouched