Skip to content

feat: compose customer boards and Compact portals (WI-2240) - #520

Merged
stefan-ernst merged 3 commits into
mainfrom
feat/wi-2240-composable-customer-boards
Nov 16, 2026
Merged

stefan-ernst merged 3 commits into
mainfrom
feat/wi-2240-composable-customer-boards

Conversation

@stefan-ernst

@stefan-ernst stefan-ernst commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements WI-2240's composable customer-board and Compact-portal delivery, including the reconciled WI-1662 governance foundations and WI-2194 attachment fix.

  • Keep management inside Channels → Public boards, for delegated board owners and system administrators. Publishing permission does not grant cross-owner administration or source editing.
  • Add atomic revisioned publication/audience editing, generic audit history, retained inventory, named audiences, effective publication locations, owner notices, instance pause, and persistent revoke/unlock controls.
  • Separate collection sources, publication state, standalone availability, and native portal placements. Link/unlink never clones or silently republishes a source.
  • Enforce portal admission ∩ board audience ∩ placement audience for board data, item/comments, and contextual image downloads. Preserve scoped sessions, requester authorization, private comments, and internal attachment visibility.
  • Add opt-in Compact presentation, shared board rendering/header, ordered/default landing, lazy requests/forms/drafts, KB search/articles, profile, approvals and configured reports. Preserve classic settings and existing URLs.
  • Regenerate canonical v2 metadata/OpenAPI and validate generated clients.

GitHub-only authentication, GitHub-organisation policy extensions, cross-site blanket sessions and customer-site product convergence remain explicitly deferred decision work (WI-2251/WI-2252).

Qualification

  • go test ./... in core.
  • Relevant handler/repository/database/v2/HTTP regressions and normal filtered collection/channel/governance service-package suite on SQLite.
  • Publication, placement, governance, upgrade, external projection and signed-audience HTTP coverage on PostgreSQL, run serially.
  • 43 focused frontend tests, bun run check, Svelte type checking, changed-code Go lint.
  • make openapi-v2-check, including generated-client compilation.
  • Chromium: 9 browser journeys plus setup, at both root and /windshift; no skips or retries. Includes delegated Channels and board-toolbar editing, layout round-trip, link/reload/unlink, live revoke, mobile/keyboard boards, request creation/detail/logout, draft resume, KB search/article, report/profile/approval modules, and emailed sign-in return.

Integrated current main in both repositories (core 91a122b4, tests 43eeb135), preserving the incoming operator-control checks alongside the independent public-board pause. Qualification was repeated after integration. Earlier service fixture compilation limitations were resolved by the current-main integration; normal relevant service-package filters now pass on SQLite and PostgreSQL. Concurrent schema-heavy PostgreSQL broad runs exhausted the local database's shared-memory lock budget; serial focused qualification passed. The entire external regression repository was not run and is not claimed green. GitHub CI remains separate from this local qualification.

Companion regression PR

Regression coverage: https://github.com/Windshiftapp/core-tests-internal/pull/55

Matching core/core-tests branch: feat/wi-2240-composable-customer-boards.

Review follow-up

Addressed all three findings in core 85ddc7e9, with regressions in companion c9f35127:

  • Manual/domain-restricted portal admission now requires a customer identity for experience enumeration and every native board/detail/attachment read, even when all organisation policies are public. Anonymous/internal-only callers receive 401; inadmissible customer sessions receive 403. Open/legacy-open admission remains anonymous-compatible.
  • With requests disabled, only the shared item-detail GET can pass the module gate when approvals are enabled, and the existing active-approver/channel/workspace checks still decide access. Owners without an active approval, unrelated customers, request lists, comments and attachments remain denied. Compact also mounts the shared confirmation dialog so approval decisions can complete.
  • Compact resolves KB/profile suffixes after the portal slug, preserving reserved-looking slugs, explicit form targets and module queries.
  • Restricted experience responses retain a customer sign-in path and emailed verification/deep-link return; stale login-status responses cannot replace another portal.

Follow-up qualification passed: core go test ./..., broader relevant SQLite handler/HTTP tests, four focused HTTP cases on PostgreSQL, approval channel/workspace service filters on both engines, 55 frontend tests, frontend check/typecheck, OpenAPI/client checks, and core commit hooks. Chromium passed nine workflow journeys plus setup at both / and /windshift, plus three board/governance journeys and setup at root; no skips/retries. The repository-wide tests no-sleep guard still fails on the pre-existing tests/attachment_upload_db_timeout_test.go:60 (time.Sleep(transfer)), unchanged here; schema and browser-selector guards passed. The entire external suite was not run; CI remains separate.

@stefan-ernst

Copy link
Copy Markdown
Contributor Author

Reviewed b0ad6a21. Three findings; the admission bypass should be fixed before merging.

1. [P1] Anonymous requests bypass portal admission restrictions

internal/handlers/portal_boards.go:64–74

restricted considers only the three organisation policies, and portalAdmission runs only when id > 0. With those policies set to public, a portal configured for manual registration or an email-domain allowlist serves its linked boards anonymously. I reproduced both configurations: an inadmissible customer's cookie gets 403, but removing the cookie gets 200 from both /api/v2/portal/{slug}/experience (including placement IDs) and /boards/{placement_id}. Standalone publication was disabled. Item and attachment routes share this guard.

Require an admitted identity when the portal's admission settings restrict visitors, including when enumerating placements in GetPortalExperience. Add anonymous-denial coverage for manual and domain-restricted portals, alongside admitted-customer success coverage.

2. [P2] Disabling “My requests” also removes approval item context

internal/handlers/customer_access.go:329–330

The new module gate classifies every /requests/{itemId} read as requiring the requests module. However, opening an approval calls that endpoint from portalActivity.svelte.js:293–298 to obtain the request title, description and status. With approvals enabled and requests disabled, that call is rejected before the existing active-approver authorization can run. The UI silently omits portal-approval-item-context while still offering approve/reject controls.

Keep the shared item-context read available to authorized active approvers when approvals are enabled; disabling the request-list module should not force approvers to decide without the request context. This finding is source-traced; the companion browser test exercises only an empty approvals list.

3. [P2] Compact routing interprets portal slugs beginning with kb as the KB module

frontend/src/lib/customer/compactNavigation.js:40–44

route.path.includes('/kb') also matches the slug in /portal/kb-support. It runs before form and query-module handling. Direct execution confirmed that both /portal/kb-support (configured default: requests) and /portal/kb-support/request/17 resolve to knowledge-base. Consequently these portals cannot open request forms, and show “Content unavailable” if KB is disabled. Match the route suffix relative to /portal/{slug}, or use parsed route metadata. The analogous endsWith('/profile') also misclassifies the root of a portal named profile.

Verification

Using the matching companion-test checkout:

../core-tests-pr-55/overlay.sh . -- -tags=test -count=1 -run 'Test(BoardPublicationPortalOnlyLifecycleAndContextIsolation|PortalBoardSignedAudienceIntersectionAndLiveRevocation)$' ./tests/...
# PASS (SQLite)

../core-tests-pr-55/overlay.sh . -- -tags=test -count=1 -run '^TestPR520AnonymousPortalAdmission$' ./tests
# FAIL: local review regression, four anonymous responses were 200 instead of 401;
# the same requests with the inadmissible customer's cookie returned 403.

The navigation reproduction used:

bun -e 'import {compactModules, compactTarget} from "./frontend/src/lib/customer/compactNavigation.js"; const e = {slug:"kb-support", modules:["requests","forms","knowledge-base"], boards:[], default_module:"requests", authenticated:true}; for (const r of [{path:"/portal/kb-support",params:{slug:"kb-support"},query:{}},{path:"/portal/kb-support/request/17",params:{slug:"kb-support",requestTypeId:"17"},query:{}}]) console.log(r.path, compactTarget(e,r,compactModules(e)));'
# Both resolve to { kind: "knowledge-base" }.

Full regression, PostgreSQL and browser suites were not run during this review.

@github-actions

Copy link
Copy Markdown

Size Change: 0 B 🆕

Total Size: 0 B

compressed-size-action

@stefan-ernst

Copy link
Copy Markdown
Contributor Author

Addressed all three findings in 85ddc7e, with companion regressions in c9f35127 (tests PR).

  1. Admission: manual registration/domain restrictions now require customer identity for /experience and every native board/content guard, independently of organisation-policy modes. Anonymous and internal-only sessions get 401 customer_login_required; inadmissible customers get 403 insufficient_permission. Coverage includes experience/board/item/real attachment reads, admitted success, combined restrictions, and open/legacy-open compatibility. The UI retains sign-in and emailed verification/deep-link return without fetching the protected experience first.
  2. Approvals: only GET /requests/{itemId} may pass the module gate with approvals enabled and requests disabled. The request resolver then requires active approver membership in the correct channel/served workspace; ownership alone cannot reopen requests. Lists, comments, attachments, unrelated items/customers and post-decision context remain denied. A real Compact browser approval now opens with title/description/status, survives reload and completes a decision. That test also exposed and fixed Compact's missing shared confirmation dialog.
  3. Routing: KB/profile matching uses only the suffix after /portal/{slug}. Regressions cover kb-support, kb, profile, forms, query targets and real KB/profile suffixes. Browser request/deep-link journeys now run with KB-looking slugs.

Qualification

go test ./...
../core-tests/overlay.sh . -- -tags=test -count=1 -run 'Test(Portal|CustomerAccess|PublicBoard|Board|ManualPortal)' ./internal/handlers ./internal/restapi/v2 ./tests
../core-tests/overlay.sh . -- -tags=test -count=1 -run '^Test(Portal(BoardRequiresAdmittedIdentity|ApprovalContextWithoutRequestsModule|BoardSignedAudienceIntersectionAndLiveRevocation)|BoardPublicationPortalOnlyLifecycleAndContextIsolation)$' ./tests
../core-tests/overlay.sh . -- -tags=test -count=1 -run 'Test(ApprovalQueries|ApprovalDecisionsEnforceChannel|PortalServedWorkspace|PortalServesRequestWorkspace)' ./internal/services
VITEST_RUNTIME=bun ../core-tests/run-overlay-script.sh . scripts/run-frontend-tests.sh src/lib/customer src/lib/pages/PublicBoard.test.js src/lib/stores/portalActivity.test.js src/lib/stores/portalAuth.test.js src/lib/stores/portal.test.js src/lib/api/portal.test.js
E2E_KEEP_ARTIFACTS=1 E2E_SKIP_BROWSER_INSTALL=1 ../core-tests/run-e2e.sh tests/compact-portal-workflows.spec.ts tests/portal-approval-channel-scope.spec.ts
  • Passed the focused HTTP and service filters on SQLite and PostgreSQL (PostgreSQL via TEST_DB_TYPE=postgres and the local DSN); the final strengthened approval assertions were rerun on both engines.
  • 55 frontend tests passed. Frontend checks/typecheck, OpenAPI/client validation and core commit hooks passed.
  • Chromium: nine workflow journeys plus setup passed at / and /windshift, with no skips/retries. The additional composable-boards, board-delegated-management and public-board-attachment-revocation specs passed at root (three journeys plus setup).
  • Test-schema and stable-selector guards passed. The repository-wide no-sleep guard reports the pre-existing, unchanged tests/attachment_upload_db_timeout_test.go:60 (time.Sleep(transfer)). The full external suite was not run; this is not a claim that all CI is green.

@stefan-ernst
stefan-ernst merged commit f4248f4 into main Nov 16, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant