Skip to content

feat(ui): BYOK frontend polish — panel tests, UX/a11y, maintainer docs - #681

Merged
JSONbored merged 1 commit into
mainfrom
feat/byok-frontend-polish
Jun 14, 2026
Merged

feat(ui): BYOK frontend polish — panel tests, UX/a11y, maintainer docs#681
JSONbored merged 1 commit into
mainfrom
feat/byok-frontend-polish

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Final round of the BYOK security-audit follow-ups (after #670, #680).

Changes

  • BYOK: frontend tests for the AI review / BYOK panel (stand up a UI test runner) #673 — UI test runner + first component tests. Stands up vitest + @testing-library/react + jsdom in the gittensory-ui workspace (new vitest.config.ts / vitest.setup.ts, test script) and adds:
    • MaintainerPanel role gate — a non-maintainer session renders "Maintainer access required" and the BYOK key field never mounts; a maintainer proceeds to the dashboard; an un-hydrated session shows the loading state.
    • AiReviewSettings — the key field is write-only (type=password) and never hydrates a stored key (the raw key never appears in the DOM); a provider/key mismatch is rejected client-side without any request; a valid key posts then clears the input.
    • Wired ui:test into the CI "UI check" step so these run on every PR.
  • BYOK: AI review panel UX — loading/empty states + a11y (aria-live/aria-busy) #678 — AI review panel UX + a11y. Initial loading state, an empty-state hint when no registered repos are detected, role="status" + aria-live="polite" on the result banner, and aria-busy on the action buttons.
  • BYOK: maintainer-facing documentation (coordinate with #648) #675 — Maintainer-facing BYOK docs (docs/maintainer-byok-ai-review.md): advisory vs consensus layers; BYOK calls the provider directly and bills the maintainer (consensus is always free Workers AI); encrypted/write-only key handling; dashboard vs .gittensory.yml config. Kept out of docs.github-app.tsx to avoid conflicting with the open onboarding-docs PR feat(ui): maintainer onboarding — hero install button + config-as-code docs #648.

Verification

ui:typecheck ✅ · ui:lint ✅ · ui:test ✅ (6 tests) · ui:build ✅ · ui:openapi:check ✅ · actionlint ✅ · npm audit ✅ (0 vulns)

The package-lock.json change is purely additive (jsdom/Testing-Library transitive deps).

Closes #673, #675, #678. Part of #525.

Final round of the BYOK security-audit follow-ups (after #670, #680).

- #673 Stand up a UI test runner (vitest + @testing-library/react + jsdom) in
  the gittensory-ui workspace and add the first component tests: the
  MaintainerPanel role gate (non-maintainer → "Maintainer access required",
  BYOK field never mounts; maintainer → dashboard) and AiReviewSettings (key
  field is write-only/password and never hydrates a stored key; provider/key
  mismatch is rejected client-side without a request; a valid key posts then
  clears). Wired `ui:test` into the CI "UI check" step.

- #678 AI review panel UX + a11y: an initial loading state, an empty-state hint
  when no registered repos are detected, role="status" aria-live on the result
  banner, and aria-busy on the action buttons.

- #675 Maintainer-facing BYOK documentation (docs/maintainer-byok-ai-review.md):
  how the advisory vs consensus layers work, that BYOK calls the provider
  directly and bills the maintainer (consensus always free), encrypted/write-only
  key handling, and dashboard vs .gittensory.yml config. Kept out of
  docs.github-app.tsx to avoid conflicting with the open onboarding-docs PR #648.

Verified: ui:typecheck, ui:lint, ui:test (6 tests), ui:build, ui:openapi:check,
actionlint, npm audit (0 vulns).

Closes #673, #675, #678. Part of #525.
@ghost

ghost commented Jun 14, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #681 is no longer open. No action.

💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

@ghost ghost added the gittensory:reviewed label Jun 14, 2026
@ghost

ghost commented Jun 14, 2026

Copy link
Copy Markdown

gittensory · advisory review

Reviewed 10 changed file(s) — two independent AI reviewers.

Suggested action:Safe to merge — both reviewers found no blocking issues.

Reviewer A · gpt-oss-120b — recommends ✅ merge
The PR adds loading state handling, accessibility improvements, and better UI feedback to the AI review settings panel, introduces a comprehensive test suite for the panel and maintainer access gating, adds vitest configuration, test scripts, and documentation. The changes are clean, well‑scoped, and respect the project's privacy and accessibility standards.

Suggestions

  • Consider adding aria-busy="true" to the Save button when loading is true for consistency with the busy state.
  • Ensure the sr-only utility class is included in the Tailwind config (it usually is by default).
  • Run the new UI tests locally to confirm they pass before the CI runs.

Worth double-checking

  • If repoOptions can be undefined, accessing .length may cause a runtime error.
  • The new ui:test step adds extra CI time; monitor for flaky tests.

Reviewer B · nemotron-3-120b-a12b — recommends ✅ merge
The PR adds unit tests for AI review settings and maintainer panel components, improves UI/UX and accessibility (loading states, live regions, repository hints), and adds comprehensive BYOK documentation. Changes are confined to maintainer-only surfaces (private), preserving the public/private boundary. Test coverage is solid, and CI is updated to run new tests.

Suggestions

  • Consider setting aria-busy={busy || loading} on buttons in ai-review-settings.tsx to better convey busy state during initial load (though buttons are disabled, it's beneficial for screen readers).
  • The hasRepos computation is fine inline, but could be moved above useEffect to avoid trivial recomputation (low impact).

Worth double-checking

  • New tests rely on jsdom setup; ensure vitest.config.ts and vitest.setup.ts are correctly configured for all test environments (low risk given standard setup).
  • Documentation may require updates if BYOK implementation evolves (maintenance concern, not a blocker).

Before = production · After = this PR's preview deploy.

Route Viewport Before After
/ desktop before desktop after desktop
mobile before mobile after mobile

@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 0e27015 Commit Preview URL

Branch Preview URL
Jun 14 2026, 02:12 AM

@JSONbored
JSONbored merged commit 16c1b25 into main Jun 14, 2026
12 checks passed
@JSONbored
JSONbored deleted the feat/byok-frontend-polish branch June 14, 2026 02:14
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

BYOK: frontend tests for the AI review / BYOK panel (stand up a UI test runner)

1 participant