feat(web): grouped workspace skills tab (Phase 2)#347
Open
mgoldsborough wants to merge 1 commit into
Open
Conversation
Phase 2 of SKILLS_SURFACE.md. The workspace settings tab at
/w/:slug/settings/skills moves from "one mixed list with a scope
filter" to four grouped sections that match the spec's three-surface
model:
- **Workspace** — editable rows, Create button, full Edit / Delete /
status / move-scope affordances.
- **Inherited from organization** — disabled visual treatment;
selecting opens the body read-only with an "Edit in org settings →"
deep link to /org/skills for org admins.
- **Inherited from bundles** — disabled visual treatment; read-only
with the existing "edit through the bundle's own settings"
explanation.
- **Personal footer** — count of user-tier skills + "Edit in profile
→" link to /profile. Personal skills follow the identity across
workspaces (the runtime invariant); the workspace tab surfaces them
as a count rather than as an authorable section so the mental model
matches the storage location.
Structural changes:
- `SkillsBrowser` accepts a new `surface?: "workspace"` prop. When
set, it fetches every scope in one `skills__list` call, the
renderer partitions in `groupByScope({ excludeUser: true })`, the
scope filter is hidden, the create form is locked to scope
"workspace", and a `PersonalFooter` renders below the list.
- `SkillRow` accepts `inherited?: boolean` for dimmed visual
treatment on org/bundle rows.
- `SkillDetailView` accepts `readOnly` + `inheritedFrom` props; the
previous `isBundle`-only gate broadens to honor whichever scope is
inherited on the current surface.
- The org-admin surface (`lockedScope="org"`) is unchanged — same
single-section view, same forced create scope.
Phase 2 cleanup folded in (spec open question #5): drop the local
`new Set(["admin","owner"])` redeclaration in
`src/tools/platform/skills.ts` in favor of the canonical
`ORG_ADMIN_ROLES` export from `src/identity/types.ts`. The workspace
surface and the server permission gate now agree on the predicate by
import, not by string-match.
Tests:
- New `web/test/SkillsBrowser.workspace.test.tsx` — five behavioral
cases:
1. Scope filter <select> is absent.
2. Sections render in order: workspace, inherited org, inherited
bundles; no user-tier section.
3. Personal footer shows correct count + /profile deep link.
4. Create form locked to scope="workspace" regardless of internal
state — the load-bearing assertion the server's checkPathAccess
can't catch.
5. Initial skills__list is unfiltered (the renderer partitions).
- Phase 1 tests (orgRoleGate, SkillsBrowser.org) continue to pass —
the org surface contract is preserved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 2 of SKILLS_SURFACE.md. The workspace settings tab at `/w/:slug/settings/skills` refactors from "one mixed list with a scope filter" to four grouped sections, each scoped to one writable audience:
Plus the Phase 2 cleanup (spec OQ #5): drop the local `ORG_ADMIN_ROLES` redeclaration in `src/tools/platform/skills.ts` in favor of the canonical export from `src/identity/types.ts`. The two surfaces now agree by import.
Structural changes
Test plan