feat: nudge users to add keys for unconfigured providers - #332
feat: nudge users to add keys for unconfigured providers#332chongjiazhen wants to merge 7 commits into
Conversation
|
Quick context on intent: this is a proposal, not a "please merge." I opened it as a draft PR so the design is concrete and reviewable rather than hand-waved in an issue — but I haven't gauged your appetite for it, and scope/approach are entirely yours to steer. Totally fine to convert this to an issue, reshape it, or close if a key-nudge isn't a direction you want. If you are interested, the obvious open questions are:
No rush on this one — happy to follow your lead. |
Both popups inherited `w-(--anchor-width)`, sizing them to their trigger. The add-provider Select (trigger w-[220px], items whitespace-nowrap, popup overflow-x-hidden) clipped the "· N free models, no key" hint off the right edge, making the indicator invisible. The banner dismiss menu, anchored to a small ghost button, wrapped its "Mute …" / "Don't ask again" items. Override per-instance: SelectContent → w-auto min-w-[220px]; banner DropdownMenuContent → w-auto. Shared ui/select + ui/dropdown-menu defaults left intact (other selects want trigger-width matching). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The concept and tests here are good. The Keys page was redesigned in #467 (add-key dialog, collapsible provider sections), so the banner and the AddKeyForm hooks need re-hosting onto the new layout. A rebase is welcome; if the mapping isn't clean, ping me here and we'll figure out placement together. |
41f86c2 to
14ded87
Compare
|
Thanks for opening this as a working draft instead of an issue. Having the design concrete made it much easier to think about, and the tests you wrote were genuinely good. We ended up approaching the same problem from a slightly different angle. There is now a Your diagnosis was right, and it pushed the idea forward. Thanks for the care you put into it. |
A provider with enabled models but no API key is invisible in the dashboard today —
/api/healthonly reports platforms that already have keys (GROUP BY api_keys). So free models the user could unlock just sit there unused, with nothing pointing them out. This adds a small, dismissible nudge.What it does
GET /api/healthgainsunconfiguredProviders(raw: enabled models, no enabled key — excludingcustom, keyless providers, and platforms this binary can't route) plusnudgeState.<select>now shows "· N free models, no key" on unconfigured providers, driven by the raw list so it survives "Don't ask again". This is the always-available reference; the banner is just the proactive layer.POST /api/keys/nudge({scope, platform?}) persists dismiss state in settings; adding a key prunes that provider from the mute/snooze sets.Design notes
unconfiguredProvidersis returned raw; the banner derives its visible subset (raw − muted − snoozed, hidden when disabled) on the client. Muting a provider therefore silences the banner but keeps its dropdown hint — the information is never buried.Scope
v1 is the KeysPage banner + dropdown only. Deliberately out: catalog-delta "newly-added only" detection, desktop tray notification, global banner.
Tests
New service unit tests (raw detection; keyless/custom/unroutable exclusion; mute/disable/snooze-snapshot semantics; prune; corrupt-JSON degrade) and route tests (health field, all dismiss scopes incl. 400s, prune-on-key-add). Full server suite green.
Client
tsc -b && vite buildclean.