Skip to content

feat: add external API administrator UI - #809

Merged
dialmaster merged 94 commits into
DialmasterOrg:devfrom
bballdavis:feature/external-api-gui
Nov 24, 2026
Merged

dialmaster merged 94 commits into
DialmasterOrg:devfrom
bballdavis:feature/external-api-gui

Conversation

@bballdavis

@bballdavis bballdavis commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds the administrator UI for the external API runtime merged in #810, on the persistence foundation merged in #750. This branch now includes upstream dev through db872d39; both prerequisite PRs are merged.

  • Settings → API Keys & Bookmarklet gains external key creation, independent request permissions, rating/media policies, workload limits, channel grants, regeneration, and revocation.
  • The Requests page provides filters, pagination, details, and confirmed approval/rejection for video, channel, and deletion requests. It follows background execution automatically; approved/processing requests refresh without requiring another approval.
  • Key creation/editing preserve independent state, wait for grants, discard obsolete reads, prevent duplicate submissions, and retain editable values after failures. Access increases use the application confirmation dialog.
  • External controls and Requests navigation follow the effective server feature flag. Session/no-auth administrator access remains separate from external API-key authentication.
  • Review actions stay visible in cards on mobile, tablet, and narrower desktop layouts; wide screens retain the table.
  • Updates operator documentation and the upstream path-scoped architecture notes. No Plinx roadmap or consumer-specific planning documents are included.

Compatibility and scope

Production backend code, migrations, package manifests, and dependency locks match current upstream dev exactly. The backend diff contains only two supporting test files. No schema changes, duplicate-channel consolidation, or new backend authorization behavior are introduced.

The existing GUI review threads are resolved. This update merges upstream into the existing branch without rewriting its history and resolves the API-key settings and architecture-documentation conflicts.

Validation

Published head: eeba599ae10080d6b38d6b607dc8ab6730d9922d.

  • Backend: 246 suites / 6,846 tests passed.
  • Frontend: 311 suites / 5,660 tests passed, including responsive review-action regressions at 390, 834, and 1280 pixels.
  • MariaDB 10.3 and MySQL 8.0: 29 runtime/migration integration checks passed on each engine using disposable synthetic databases.
  • ESLint, TypeScript, production client build, and static Storybook build passed.
  • All 18 documentation-generator tests and the production documentation build passed.
  • Browser inspection of the built Storybook covered the 390px mobile cards, 834px tablet cards, 1600px desktop table, approval confirmation/cancellation, and external key-creation dialog.

Local backend tests used a canonical temporary directory for an existing macOS symlink-path assertion. Documentation validation ran from an exported checkout without spaces because the existing generator does not decode spaces in its source path. Browser previews use synthetic Storybook fixtures; no live downloads, provisioning, deletion, deployment, or upstream merge occurred.

CI for this published head: all required checks passed, including the aggregate All Checks gate, both database engines, backend/frontend coverage, lint/types, Storybook, documentation, and security. The optional manual review job was skipped. The earlier changes-requested maintainer review still requires renewed approval; resolved inline threads do not replace that approval.

Screenshots

With EXTERNAL_API_ENABLED=true

1-api-keys-page 2-create-external-key-dialog 3-requests-queue 4b-channel-approval-dialog

With EXTERNAL_API_ENABLED=false (the default for existing users)

6-api-keys-external-api-off

@bballdavis
bballdavis force-pushed the feature/external-api-gui branch from c5febdc to 2743176 Compare September 8, 2026 23:23
@bballdavis
bballdavis force-pushed the feature/external-api-gui branch from 2743176 to fb04fad Compare September 8, 2026 23:36
@bballdavis
bballdavis force-pushed the feature/external-api-gui branch from fb04fad to 4961ba0 Compare September 9, 2026 12:50
Comment thread client/src/config/configSchema.ts Resolved
Comment thread client/src/components/ui/select.tsx Resolved
@bballdavis
bballdavis force-pushed the feature/external-api-gui branch 2 times, most recently from ffca52a to dc54292 Compare September 19, 2026 05:05
@bballdavis
bballdavis marked this pull request as ready for review September 19, 2026 05:09
USAGE_GUIDE: restore the single-video note for bookmarklet keys, drop
the legacy wording, and explain that the external keys section and the
Requests page only appear with EXTERNAL_API_ENABLED=true, what the nav
toggle does, and that the queue works without login when
AUTH_ENABLED=false.

CLAUDE.md: replace the thin ExternalRequests one-liner with what each
file owns, add an ApiKeysSection entry, and drop the stray line that
had landed above App.tsx in the frontend list.
Approving now only queues the work; the server's executor moves the
request from approved to processing to a final status, and approving
an approved or processing request again does nothing.

- Only pending requests can be approved, so the "Retry approval" path
  and its locked grant checkbox are gone.
- The queue refreshes itself every 5 seconds while any request on the
  page is approved or processing (not while the tab is hidden), without
  the loading spinner, and an open details dialog follows the refresh.
- The details dialog says whether a request was approved automatically
  or by an administrator.
- The approve dialog says the work runs in the background.
@bballdavis
bballdavis force-pushed the feature/external-api-gui branch from 768d826 to 446058c Compare October 22, 2026 13:37
Resolve API-key settings conflicts while preserving the reviewed UI and upstream runtime. Keep review actions visible on tablet layouts and update documentation for background execution.
@BigFlubba BigFlubba added the enhancement New feature or request label Nov 7, 2026

@dialmaster dialmaster left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is getting close.

I found some new things this round, noted inline. The main ones are:

  • /requests redirects to Settings on a page reload
  • the dialog backdrop change affects every dialog in the app
  • revoked bookmarklet keys show up in the list again
  • "Select all" ignores the channel search

The branch also has a conflict with dev in .claude/rules/external-api.md.

Comment thread client/src/App.tsx Resolved
Comment thread client/src/components/ui/dialog.tsx Resolved
Comment thread docs/AUTHENTICATION.md Resolved
The key editor only sees grants on enabled channels, and saving
replaced the whole grant list. Editing a key while one of its
channels was disabled removed that grant for good, even when only the
rating changed.

Replace only the grants on enabled, non-terminated channels. A grant
on a disabled channel grants nothing while it stays that way and comes
back when the channel is turned on again.
The channel list sorted by uploader alone, so channels with the same
or an empty name could repeat or drop out between pages. The key
editor pages through every channel, and a skipped channel could not
be granted.
externalApiEnabled reads false until /getconfig answers, so reloading
or bookmarking /requests sent you to Settings. The route now waits for
the config to load before choosing.
After one background poll the reload stayed marked silent, so later
filter and page changes showed no spinner or error and left the old
rows under the new filter. A load is now silent only when it reloads
the same query the poll started.
Closing on pointerdown changed every dialog in the app: a right-click
or the start of a touch closed it, and the rest of the tap could land
underneath. The Select isTrusted check already keeps a select trigger
from dismissing its dialog, so go back to dev's click handler.

Also drop the trusted-mousedown test. jsdom cannot make a trusted
event, so it returned before its assertion and checked nothing.
Select all granted every channel in the library even when a search
showed only a few, and clearing it dropped picks hidden by the search.
It now adds or removes only the channels the search shows.
frontend.md asks new code to use the lib/icons aliases rather than
lucide-react. Switch the new Requests and API key files over and add
the Pencil and Radio icons they need.
Dev added read-only status keys while this branch split the settings
into bookmarklet and external key lists, so status keys would have
shown up as external keys. List them with the download keys, label
each key's type, and offer the read-only option and the status summary
address when creating one.

Also address review gaps in the lists:
- hide revoked keys from the bookmarklet list, as dev did, since
  GET /api/keys returns every key ever created;
- keep active external keys listed while the External API is off, so
  they can still be revoked; they count toward the 20-key limit;
- close the regenerate confirmation when regenerating fails, so the
  error behind it is visible.

Update AUTHENTICATION.md, which still described the external API as a
future feature, and note the grant and disabled-API behavior in
EXTERNAL_API.md.
Approving or rejecting from the list's review column opened the
details dialog once the decision saved. Go back to the list instead;
a decision made from the details dialog still returns there with the
new status.
jsdom only makes untrusted events, so the test took the same path as
dev's Select and passed either way. The guard is for real taps, where
the compatibility mousedown opened the menu under the finger before
the click; explain that next to it.
Fold the created-key, create, revoke and regenerate dialog state into
one value each, so the section is down to 9 useState calls and 300
lines, inside frontend.md's guide.
The section tests stub useApiKeys, so the hook's create, update,
revoke and regenerate requests were untested. Add tests for those,
for the privilege-increase check that guards saving, and for the
external access editor's load, confirm, failure and retry paths.
Move the hook test next to the hook.
If a granted channel was disabled between the eligibility check and
the save, its kept grant collided with the new row and the save
returned 500. Skip the duplicate, and say in EXTERNAL_API.md how a
dormant grant is removed.
- Label the select-all box "Select all channels" until a search is
  typed, and say when a search matches no channels.
- Don't show the zero-channels warning while the key's grants are
  still loading or failed to load.
- Use the same eye icon for view-only access as the key cards do.
- List the new external request types and rating policy files in the
  external-api rule paths so the rule loads for them.
@dialmaster
dialmaster merged commit c2cd489 into DialmasterOrg:dev Nov 24, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants