feat(web): add copy actions for upstreams and model aliases - #495
Open
yyyr-p wants to merge 2 commits into
Open
Conversation
Drop the opening sentence that restates what the copy route and loader already show; keep the non-obvious credential rationale (API-key providers keep the stored key via the blank-secret contract; OAuth providers reset to the blueprint shape because their tokens are minted by the exchange).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Both list pages gain a copy action next to edit, so a working upstream or model alias can be duplicated without recreating every field by hand.
Upstreams open a new
/dashboard/providers/upstreams/:id/copyroute that reuses the existing editor in create mode, seeded from the source record with a fresh id, a{{name}} copyname, and a distinct hue.structuredCloneisolates every nested field so editing the copy can't mutate the source.The credential is the one field that isn't a straight copy, and it follows the provider kind:
custom(API key),azure,ollamacopilot,codex,claude-codeModel aliases reuse the existing dialog in a new
copymode that seeds from the source with a{{name}} copyname but saves through the create endpoint, producing a second alias rather than overwriting. The dialog'smode(create|edit|copy) replaces the oldrecord ? edit : createboolean so duplicate detection and the save target can tell the three apart.New
enandzh-Hansstrings carry the copy labels, name suffix, dialog title, and document title (the two locales stay structurally equivalent);routes.tsregisters the route anddocument-title-syncmaps its path to the title.Test Plan
pnpm run verify— every stage passes except five tests that fail identically on the feature commit before this PR (copilot-device-flow_test.tsx×4 andoauth-authorize-url_test.tsx×1, all timing/poll-countexpected 1, received 0), so they are pre-existing and unrelated to this change.