## Problem
The Authorization section of the OAuth app publish form was two toggles,
each with its own inline warning box and its own "I understand this is
permanent" checkbox, plus a static info box describing what users would
see. Two problems with that:
- The settings are a one-way door, so the permanence warning appeared
twice and was easy to click past.
- Nothing showed what the two settings combine into, or what the person
connecting the app actually ends up seeing.
## Solution
UI only — the saved fields (`grant_kind`, `project_scoping_mode`) and
the save logic are unchanged, and `allow_partial_grants` is untouched.
- **Two radio groups** in place of the toggles: "Who approves access?"
(an owner, once for the org / each member, for themselves) and "Which
projects can it reach?" (all projects / let them choose). Built on
`RadioGroupStacked`, grouped with `fieldset`/`legend`.
- **One-way door made visible**: the saved option carries a `Current`
badge, the stricter options carry `Permanent`, and once a stricter value
is saved the looser option is disabled and badged `Can't switch back`.
- **Live preview** replaces the info box: a dimmed, cropped view of the
real consent screen, reusing `ScopeGroupCard` and the interstitial's
width, so it reflects the app's actual scopes and updates as the radios
change. A footer row states the resulting grant, and what it is today
when there are unsaved changes.
- **One confirmation, at save time**: both inline warnings and their
checkboxes are gone. Saving a stricter value opens a `ConfirmationModal`
listing only what changed, with a single acknowledgement checkbox gating
"Save permanently".
Unit tests cover the badge/locking states and the preview; the dialog's
bullets and acknowledgement gate have their own tests.
## Review instructions
1. Enable the `enableScopedOAuthPublish` flag and open **Organization
settings → OAuth Apps**.
2. Publish a new app. Both questions should default to the looser option
with no `Current` badges, and the stricter options should show
`Permanent`.
3. Change each radio and watch the preview and the "Resulting grant"
line update — switching "Which projects can it reach?" should swap the
fixed projects row for the picker.
4. Save with a stricter value selected. Confirm the dialog lists only
the changes you made, and that "Save permanently" stays disabled until
the checkbox is ticked.
5. Reopen the app. The saved values should show `Current`, and the
looser options should be disabled and badged `Can't switch back`.
6. Edit an app without touching authorization and save — no dialog
should appear.
---------
Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com>
## Problem
Extends the create and edit form for OAuth apps. Adds two toggles and
their connections.
## How to test
In _Organization Settings \ OAuth Apps_
### New app
- You should be able to create an app without toggling any of the two
new options
- Toggling any of the two new option should require a confirmation that
blocks the form submition until checked
### Existing app
**The default values for existing apps are hard coded for now**
- You should be able to update any of the app props except the _Use the
permissions of the person who connects_ option which should be disabled.
- Toggling the _Ask for specific projects_ option should require a
confirmation that blocks the form submition until checked
---------
Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com>