Skip to content

feat: role-based views — launcher home, intro page, inbox, contribution policy, proxy authority - #47

Merged
reoring merged 4 commits into
mainfrom
feat/role-based-views
Nov 19, 2026
Merged

reoring merged 4 commits into
mainfrom
feat/role-based-views

Conversation

@reoring

@reoring reoring commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Why

Craftsman feedback (2026-11-19): users do not know what to do on the console home or on an app page; data under /-/data must not be visible to users; users want to leave feedback as comments; proposals should be open by default to people in the app's department who can build, with acceptance as an app setting.

Design (Japanese, Nexus): features/builder-console/role-based-views/ — domain-model.md, ux-design.md, wireframes.md.

What

Server (cmd/server)

  • domain.Capabilities(actor, app) → app.permissions {use, comment, propose, maintain, data}, one pure function; me.view: user|maker.
  • apps.contribution_scope (off|group|company, default group; migration 010), editable via PATCH /apps/{id}.
  • GET /inbox (pending access requests, unseen feedback for apps I maintain), POST /apps/{id}/comments/seen.
  • console_authority.go replaces draft_reviewers.go and gates the same-origin Platform proxy: improvement drafts need propose (403 contribution_not_accepted when only scope=off blocks), database rows/sql/script/temporary-credentials/changes need data, logs and rollback need maintain. Database→app resolution reads only console apps' own stacks, memoized per request.

Web

  • canEditApp removed; everything reads app.permissions.
  • User view: 3-item nav; launcher home with filter chips, cards open the app; tab-less intro page on every tab URL with 「担当者に伝える」 (existing comments, re-headed) and 「直しを提案する」.
  • Maker view: 「あなたの対応待ち」 (useInbox, single composition point), 「利用者の声」 with 「これを AIで直す」 (editable draft), 「紹介がまだ足りません」, 「利用者にはこう見えます」 (?as=user), settings 「提案の受け付け」.
  • Mock: Editor persona, inbox, seen, propose refusal.

Not in this PR

  • DataPolicy projected to Platform (DataAccessPolicy) so Dashboard/CLI paths are closed too — wave 2, platform repo.
  • company contribution scope is stored/served but not exposed in the settings UI.

Verification

  • go build ./..., go vet ./cmd/server/..., go test ./cmd/server/internal/domain/ ./cmd/server/internal/api/ ok.
  • web: bun run typecheck 0 errors; bun test src 2169 pass / 0 fail; mock stories discover-navigation, build-failure-cause pass.
  • Browser (mock): Viewer home shows only 使えるアプリ with 3-item nav; /sales/planning/hikkoshi/-/data renders the intro page with no tabs and no ログ/イメージ/ポート/version text; Editor sees 「直しを提案する」 on own-group apps and not on scope=off; Owner ?as=user shows the banner; settings toggle persists.
  • Not run: Postgres-backed store tests (no DSN), live Craftsman readback.

Review

Authority change (proxy gating, new permission surface) → needs-human-review; auto-merge not armed.

…on policy, proxy authority

- Server: pure domain.Capabilities (use/comment/propose/maintain/data) returned as app.permissions; me.view user|maker;
  apps.contribution_scope (migration 010, default group) editable via PATCH; GET /inbox (pending access requests,
  unseen feedback) and POST comments/seen; console_authority gates the same-origin Platform proxy:
  improvement drafts need propose (403 contribution_not_accepted when only scope=off blocks), database
  rows/sql/script/credentials/changes need data, logs/rollback need maintain.
- Web: canEditApp removed in favour of app.permissions; user view = 3-item nav, launcher home with filter chips,
  cards open the app; non-maintainers get a tab-less intro page on every tab URL with 担当者に伝える and
  直しを提案する; maintainers get あなたの対応待ち (useInbox), 利用者の声, 紹介がまだ足りません, 利用者にはこう見えます,
  and the 提案の受け付け setting. Mock gains Editor persona, inbox, seen, and the propose refusal.
- Design: nexus features/builder-console/role-based-views (domain-model, ux-design, wireframes).
…story

- Restores the group-page round trip that the launcher home no longer reaches from the home sections.
@reoring reoring added the needs-human-review Waits for a person's review before merge label Nov 19, 2026
…w the launcher home; keepalive on comments/seen

- TestServedOpenAPIEqualsCommittedContract compares the served document with internal/api/openapi.json (SDK compatibility is covered separately).
- Stories: access-request approval reads the inbox row, delete assertions scoped to the app table, migration counts include the Editor persona.
- POST comments/seen uses keepalive so the read receipt survives navigation (was aborted, surfacing as a browser transport error).
…ne else

- A fresh app issued POST comments/seen on overview mount and the request was aborted by navigation; the write was also a no-op.
@reoring
reoring merged commit 17a1c29 into main Nov 19, 2026
6 checks passed
@reoring
reoring deleted the feat/role-based-views branch November 19, 2026 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-human-review Waits for a person's review before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant