Skip to content

feat(admin): signage AI providers page (PPT-2741) - #309

Open
camreeves wants to merge 7 commits into
developfrom
feat/signage-ai
Open

feat(admin): signage AI providers page (PPT-2741)#309
camreeves wants to merge 7 commits into
developfrom
feat/signage-ai

Conversation

@camreeves

Copy link
Copy Markdown
Contributor

Part of the AI signage feature (PPT-2741). Depends on PlaceOS/rest-api#447 being deployed.

What this adds

An admin page for configuring image generation providers, at Admin > Signage AI. It is entirely provider setup and credentials: nothing about generating images lives here, that is in the signage manager.

The page lists the configured providers and lets you add, edit, remove and test one. The form swaps its middle section per vendor, because OpenAI, Azure and Vertex do not take the same credentials. Credentials are only ever sent, never returned, so on an edit those boxes start empty and leaving them empty keeps what is stored.

There is also a usage table so you can see what has been spent per provider and model before the bill arrives.

Ordering, and one trap

This needs rest-api deployed first. The tab is pushed onto the admin list unconditionally with no capability check, so if this ships ahead of the API there is a Signage AI tab whose every call 404s. Worth either sequencing it or adding a gate, and I am happy to add the gate if you would prefer this not to be order-dependent.

Notes for review

The locale diff is deliberately small. An earlier version of this branch re-sorted the whole ADMIN block alphabetically, which showed up as 225 deleted lines of unrelated keys and buried the actual change. It is back to insertion order with the new keys appended, so the diff is 46 added lines.

signage-ai.fn.ts is a local functions file rather than an import from ts-client. That matches what the repo already does: storage.fn.ts is local for the same reason, the surface is small and only this page uses it. If the ts-client provider functions land first this could move over, but it does not need to.

Testing

12 examples in src/tests/admin/signage-ai.fn.spec.ts, modelled on storage.fn.spec.ts. 935 tests pass, build is clean.

Creeves and others added 5 commits August 28, 2026 00:34
A Data Stores shaped page for the vendor credentials behind signage image
generation, plus a usage table so a domain's spend is visible.

Credentials are only ever sent, never returned, so the boxes start empty on
an edit and leaving them empty keeps what is stored. The form swaps its
middle section per vendor rather than showing every field at once, and a
test button asks the vendor for one small image so a wrong key is caught
here rather than by a user mid poster.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
null means leave it alone, empty means unset it. Clearing the endpoint in
the form sent null, so the old value survived the save and the provider
kept talking to whatever it was pointed at.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Testing a provider asks the vendor for a real image and is billed. The button
had no disabled state and no confirmation, so a second click on a slow answer
spent again. It now says what it costs and refuses a second run.

A failed delete left the confirm dialog spinning for good.

The domain picker is gone: the API answers for the domain this Backoffice is
served from, and another customer's row is deliberately unreachable, so the
picker was choosing between one option and a lie.

A Google Vertex row needs a region and there was no field for one, so it could
not be configured through the UI at all.
…icker

A signal nothing set, a domain still forwarded into the provider modal, and
three imports for a form that is no longer there.
Four things the page did its own way.

The locale file's ADMIN block was re-sorted alphabetically when the new keys
went in, which showed as 225 deleted lines of unrelated keys and buried the
real change. Restored to insertion order with the new keys appended: the diff
is now 46 added lines.

`signage-ai.fn.ts` had its own query-string builder, when `common/api.ts`
exports `toQueryString` with 26 tests against it and `build-list.component.ts`
already uses it for exactly this.

Five uses of `any`, in a tree that had none and uses `unknown` 216 times.

No tests, where `storage.fn.spec.ts` is the direct model for this file. Adds
12 examples covering the model class, the query, the create-or-update split
and the usage window. One of them caught a wrong assumption in the spec rather
than the code, which is the point.
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
backoffice Ready Ready Preview Sep 1, 2026 5:39am UTC

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

Review feedback: the comments explained why the implementation is the way it
is, which is fluff for anyone reading the code and, in ts-client, for anyone
consuming the library. user-interfaces already says as much in AGENTS.md —
"comments should only explain hard to understand code not justify
implementation".

What each thing does, the @PARAM tags, and notes on mechanics a reader cannot
infer — an external API quirk, a magic number's unit, an ordering requirement —
all stay. Comments only, no behavioural change.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

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.

3 participants