revert(frontend): keep provider clone URL as ?id= (revert part of 04702c3)

Reverts the O10 part of commit 04702c3. The original change renamed
the provider clone URL parameter from `?id=` to `?clone=`. On second
look the rename solved no real problem:

- No security issue: PentAGI is a single-tenant local admin tool, so
  there is no cross-tenant info leak from a shared URL.
- No bug: the form behaviour was identical before and after.
- No UX impact: the URL is generated by the "Clone" action, not typed
  by users; the bare `?id=` is also explicit enough in context
  (settings-provider.tsx gates it on `isNew`, so the meaning is
  "source provider to clone from").

What the rename did cost: it broke backward compatibility with any
bookmarks/links saved in `?id=` form. Restore `?id=` to remove the
needless churn.

The rest of commit 04702c3 (O7 dialog case, O8 "API Tokens" unify,
O11 button label + JSDoc, O12 italic placeholder) addressed real
inconsistencies and stays in place.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Sergey Kozyrenko
2026-05-22 18:02:27 +07:00
parent 04702c3648
commit 25e19e5be8
2 changed files with 3 additions and 3 deletions
@@ -877,7 +877,7 @@ function SettingsProvider() {
const formQueryParams = useMemo(
() => ({
clone: searchParams.get('clone'),
id: searchParams.get('id'),
type: searchParams.get('type'),
}),
[searchParams],
@@ -1001,7 +1001,7 @@ function SettingsProvider() {
if (isNew || !providerId) {
const queryType = formQueryParams.type ?? undefined;
const queryId = formQueryParams.clone;
const queryId = formQueryParams.id;
if (queryId && data?.settingsProviders?.userDefined) {
const sourceProvider = data.settingsProviders.userDefined.find((p: Provider) => p.id == queryId);
@@ -103,7 +103,7 @@ function SettingsProviders() {
const handleProviderClone = useCallback(
(providerId: string) => {
navigate(`/settings/providers/new?clone=${providerId}`);
navigate(`/settings/providers/new?id=${providerId}`);
},
[navigate],
);