Skip to content

feat(ui): add maintainer activation preview card - #3790

Merged
JSONbored merged 1 commit into
mainfrom
worktree-wf_c9b16cbb-862-1
Jul 6, 2026
Merged

feat(ui): add maintainer activation preview card#3790
JSONbored merged 1 commit into
mainfrom
worktree-wf_c9b16cbb-862-1

Conversation

@JSONbored

@JSONbored JSONbored commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Closes the remaining UI gap in one-step maintainer activation / instant-value onboarding #701 ("one-step maintainer activation / instant-value onboarding"). The backend (buildMaintainerActivationPreview in src/services/maintainer-activation.ts, GET /v1/repos/:owner/:repo/activation-preview, POST .../activation) shipped in PR feat(activation): one-step maintainer activation preview + advisory ramp (#701) #708, but there was no UI page or component that called it — only a docs page describing the API in prose.
  • Adds ActivationPreview (apps/gittensory-ui/src/components/site/app-panels/activation-preview.tsx), a new card mounted in the existing maintainer console (MaintainerPanelapps/gittensory-ui/src/components/site/app-panels/maintainer-panel.tsx). On mount it calls GET /v1/repos/:owner/:repo/activation-preview for the selected repo and renders the real returned preview (PRs evaluated, how many would have been flagged, finding-type breakdown, per-PR sample table). A single "Enable advisory mode" button posts POST .../activation and reflects success/failure inline, then reloads the preview so the button state (advisory already enabled vs. not) reflects the live result.
  • Anchored on two existing analogues in the same file (apps/gittensory-ui/src/components/site/app-panels/maintainer-panel.tsx): AiReviewSettings and MaintainerSettings (both repo-picker + apiFetch load/save + inline role="status" message cards), plus OwnerPanel (apps/gittensory-ui/src/components/site/app-panels/owner-panel.tsx) for the useApiResource-style GET-on-mount + StateBoundary loading/error/empty pattern. The repo picker reuses the existing extractPreviewRepoOptions/splitRepoFullName helpers from apps/gittensory-ui/src/lib/maintainer-settings-preview.ts rather than inventing a new one.
  • Design-ambiguity call (conservative, smallest scope): placed the new card as a section inside the existing MaintainerPanel (next to SurfacePreview/MaintainerSettings), rather than a new top-level route — this matches how every other per-repo maintainer surface in this codebase (AI review, repo settings, focus manifest) is already composed as a card within the same console, and keeps the PR to a UI-only diff with no routing changes.

Scope

Validation

  • git diff --check
  • npm run actionlint (no workflow files touched by this PR; not run)
  • npm run typecheck (backend typecheck — no src/** changes in this PR, ran clean as a sanity check)
  • npm run test:coverage (no src/** changes — this is a UI-only PR, so codecov/patch has no obligation here; not run since it is backend-only coverage)
  • npm run test:workers (no Cloudflare Worker changes; not run)
  • npm run build:mcp (no MCP changes; not run)
  • npm run test:mcp-pack (no MCP changes; not run)
  • npm run ui:openapi:check (confirmed no drift — no API/schema changes in this PR)
  • npm run ui:lint — 0 errors, 87 pre-existing warnings unrelated to this diff (verified none are in the changed files)
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate (no dependency changes; not run)
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries — activation-preview.test.tsx covers loaded/error/empty states, the activate success + reload round-trip, the activate-failure inline error path (preview data untouched), the no-registered-repos fallback, and the invalid owner/repo input branch. npm --workspace @jsonbored/gittensory-ui run test → 71/71 passing (9 files, including the new one).

If any required check was skipped, explain why:

  • This PR touches only apps/gittensory-ui/** (no src/**). Codecov's codecov/patch gate only covers src/**, so this diff owes no backend coverage; UI correctness is covered by the new component test file instead. Skipped checks above are backend/MCP/dependency-only gates that have nothing to validate for a UI-only change.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. (No auth/CORS/session code changed; the existing MaintainerPanel role gate is unchanged and continues to gate this new card the same as every other maintainer-only card in the file.)
  • API/OpenAPI/MCP behavior is updated and tested where needed. (No API/OpenAPI changes — this PR only consumes the two routes that already shipped in feat(activation): one-step maintainer activation preview + advisory ramp (#701) #708.)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. The card calls the real activation-preview/activation endpoints via the existing apiFetch helper; loading/error/empty states are driven entirely by the live response, with no mock or demo data path.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. Not satisfied — see UI Evidence section below for why.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs. (No changelog edit, per house rules. docs.self-hosting-configuration.tsx already documents the underlying API in prose and needs no update for this UI-only consumption of it.)

UI Evidence

I could not capture real screenshots in this environment. The new card only renders past the existing MaintainerPanel role gate (a real authenticated session with a maintainer/owner/operator role) and needs live backend data (a registered repo with cached pull requests) to show its loaded state — this sandboxed worktree has no deployed backend, no OAuth session, and no seeded repo/PR data to drive it, and fabricating a screenshot or mock data would violate this repo's no-mock-fallback-data rule. Rather than fabricate a placeholder, I'm flagging this honestly per the task instructions. The component's four real states (loading, error, empty, loaded-with-data) are instead exercised and asserted against in activation-preview.test.tsx via React Testing Library, which is the closest verifiable substitute available here.

Notes

  • Files touched: apps/gittensory-ui/src/components/site/app-panels/activation-preview.tsx (new), apps/gittensory-ui/src/components/site/app-panels/activation-preview.test.tsx (new), apps/gittensory-ui/src/components/site/app-panels/maintainer-panel.tsx (mounts the new card).
  • No src/**, migration, OpenAPI, or Cloudflare-binding changes — nothing to regenerate.

The backend for one-step maintainer activation (buildMaintainerActivationPreview,
GET/POST /v1/repos/:owner/:repo/activation(-preview)) shipped with no UI surface.
Add an ActivationPreview card to the maintainer console that loads the live
repo-specific preview on mount (real loading/error/empty states, no mock data)
and offers a single "Enable advisory mode" action that posts the activation
route and reflects the result inline.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 2c7dec1 Commit Preview URL

Branch Preview URL
Jul 06 2026, 10:08 AM

@JSONbored JSONbored self-assigned this Jul 6, 2026
@JSONbored
JSONbored merged commit c9d62f7 into main Jul 6, 2026
10 checks passed
@JSONbored
JSONbored deleted the worktree-wf_c9b16cbb-862-1 branch July 6, 2026 10:10
@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

one-step maintainer activation / instant-value onboarding

1 participant