Skip to content

fix: reposition org pickers in AI settings models and MCP pages (#28564) - #28666

Closed
github-actions[bot] wants to merge 1 commit into
release/2.37from
backport/28564-to-2.37
Closed

fix: reposition org pickers in AI settings models and MCP pages (#28564)#28666
github-actions[bot] wants to merge 1 commit into
release/2.37from
backport/28564-to-2.37

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Cherry-pick of #28564

Original PR: #28564 — feat: reposition org pickers in AI settings models and MCP pages
Merge commit: 78c65ea
Requested by: @tracyjohnsonux

@tracyjohnsonux

Copy link
Copy Markdown
Contributor

Conflict analysis (from the batch backport work in #28673):

Conflicts span MCPServerForm.tsx, MCPServerFormHeader.tsx, UpdateMCPServerPageView.{tsx,stories.tsx}, and ModelFormProviderConfig.stories.tsx. This change was written on top of two PRs that are not on release/2.37:

#28593 is a feature and likely not release material, so backporting the dependencies is probably not the right path here. Recommended resolution: manually re-apply the org-picker repositioning against the pre-#28593 code on release/2.37. (#28473 also touches these files but is already backported, so it is not a blocker.)

Analysis by Coder Agents on behalf of @tracyjohnsonux.

)

Repositions the organization picker on the AI settings models and MCP
servers pages so it lives with the content it scopes instead of floating
above the page header.

**Models** (`/ai/settings/models`)

- The picker moved out of `OrganizationModelsLayout` into a shared
`ModelOrganizationSelect` component that preserves the current path and
auxiliary query params when switching orgs.
- List page: rendered in the filter row to the right of search.
- Add/edit model form: rendered as row 3 of the form grid at 50% width,
labeled "Organization". On the edit page it is informational only (a
static value, not a picker), since switching org there would 404 the
model. Also rendered in the no-provider fallback and "Provider not
found" states so the switcher never disappears on those pages.

**MCP servers** (`/ai/settings/mcp-servers`)

- List page: new client-side search input (matches display name, slug,
and URL) with the org picker beside it, label hidden.
- Add/edit server form: the picker moved into the form as the third cell
of the first row (slug, display name, organization), making it a 3-up.
- `OrganizationPicker` now renders a static read-only value instead of a
disabled button when the org cannot be changed (no handler or single
org). This fixes the muted `content-disabled` text on the update page.
The read-only rendering is shared with the models edit page via a new
`OrganizationValue` component beside `OrganizationAutocomplete`.

**Status columns** (both list tables)

- The visible "Status" header and the Enabled/Disabled badges are
removed; both list tables drop the status column entirely. Models whose
provider is deleted or disabled show a warning "Unavailable" badge (with
an explanatory tooltip) beside the name.
- Disabled models and MCP servers show a "Disabled" badge beside the
name, matching the existing "Default" badge placement, and the row dims
like disabled providers: avatar/icon at half opacity, text in
`content-disabled`.

<details>
<summary>Decision log</summary>

- `ModelOrganizationSelect` reuses `OrganizationAutocomplete` and reads
accessible organizations from the models context
(`accessibleOrganizations` added to `OrganizationModelsContext`), rather
than duplicating the layout's navigation logic per page.
- Navigation semantics are unchanged: switching orgs rewrites the `org`
search param and preserves the path and remaining params, exactly as the
old layout-level picker did.
- The MCP `OrganizationPicker` read-only state uses an `<output>`
element (labelable, keeps the `Label` association) rather than a
disabled button, so non-interactive values do not render with disabled
styling or sit in the tab order.
- The add MCP server page keeps a standalone picker above the "cannot
add servers" alert since the form (and its picker slot) is not rendered
in that state.
- Story review: one interaction story per new behavior. A
`ModelsPageView` story duplicating the shared picker's
select-and-navigate flow was deliberately dropped; list-page placement
is covered by the `OrganizationModelsLayout` stories that mount the real
`ModelsPage`. The `ModelForm` fallback-branch picker has no dedicated
story since its sibling branch and the shared flow are covered.

</details>

Verification: `pnpm lint:types`, `pnpm check`, and all affected
Storybook tests pass (ModelsPage and MCPServersPage: 140), plus the
`organizationModels` and `mcpServerFormLogic` unit tests.

---

🤖 This PR was generated by Coder Agents on behalf of @tracyjohnsonux.

---------

Co-authored-by: Michael Suchacz <[email protected]>
(cherry picked from commit 78c65ea)
@tracyjohnsonux
tracyjohnsonux force-pushed the backport/28564-to-2.37 branch from 011b1b7 to f5335dc Compare August 26, 2026 21:48
@github-actions

Copy link
Copy Markdown
Contributor Author

Docs preview

Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.

@tracyjohnsonux

Copy link
Copy Markdown
Contributor

Resolved without backporting #28593. The branch has been re-created from the current release/2.37 tip with git cherry-pick -x 78c65ea5; 24 of 29 files applied cleanly and the 5 conflicts were ported by hand:

Validation: tsc, Biome on changed files, mcpServerFormLogic unit tests (8), and all MCPServersPage + ModelsPage Storybook tests pass (140/140, same count as the original PR).

Resolved by Coder Agents on behalf of @tracyjohnsonux.

@tracyjohnsonux tracyjohnsonux changed the title [CONFLICT] feat: reposition org pickers in AI settings models and MCP pages (#28564) feat: reposition org pickers in AI settings models and MCP pages (#28564) Aug 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor Author

👋 Hey @github-actions[bot]!

This PR is targeting the release/2.37 release branch, but its title does not start with fix: or fix(scope):.

Only bug fixes should be cherry-picked to release branches. If this is a bug fix, please update the PR title to match the conventional commit format:

fix: description of the bug fix
fix(scope): description of the bug fix

If this is not a bug fix, it likely should not target a release branch.

@tracyjohnsonux tracyjohnsonux changed the title feat: reposition org pickers in AI settings models and MCP pages (#28564) fix(scope): reposition org pickers in AI settings models and MCP pages ensure they work the same (#28564) Aug 26, 2026
@tracyjohnsonux

Copy link
Copy Markdown
Contributor

Re: the conflict analysis in #28666 (comment) — resolved via the recommended path (manual re-application against pre-#28593 code, see #28666 (comment)). Neither #28593 nor a standalone #28462 backport is needed; this PR is no longer blocked on any dependency.

Coder Agents on behalf of @tracyjohnsonux.

@tracyjohnsonux tracyjohnsonux changed the title fix(scope): reposition org pickers in AI settings models and MCP pages ensure they work the same (#28564) feat: reposition org pickers in AI settings models and MCP pages (#28564) Aug 26, 2026
@tracyjohnsonux tracyjohnsonux changed the title feat: reposition org pickers in AI settings models and MCP pages (#28564) fix: reposition org pickers in AI settings models and MCP pages (#28666) Aug 26, 2026
@tracyjohnsonux tracyjohnsonux changed the title fix: reposition org pickers in AI settings models and MCP pages (#28666) fix: reposition org pickers in AI settings models and MCP pages (#28564) Aug 26, 2026
@tracyjohnsonux
tracyjohnsonux requested a review from mtojek August 26, 2026 22:00
@tracyjohnsonux

Copy link
Copy Markdown
Contributor

Consolidated into the batch backport #28673 (commit 9948cc60f1, same resolution as pushed here, including the #28593-free port and the folded-in #28462 stories fix). Closing.

Coder Agents on behalf of @tracyjohnsonux.

mtojek pushed a commit that referenced this pull request Aug 27, 2026
…n area to release/2.37 (#28673)

Batch backport of @tracyjohnsonux's PRs that merged into `main` after
the `release/2.37` branch point (`c275327f`, #28369) and were not yet on
the release branch.

Commits are `git cherry-pick -x` of the original squash commits in
`main` merge order. Ten are verbatim; the last two carry manual conflict
resolutions, documented below. `pnpm run lint:types` and the affected
Storybook suites (311 tests) pass on the branch.

## Included (12)

| PR | Commit on main | Notes |
|---|---|---|
| #28427 fix(site/src): delete DateTimeRangeFilter and unify on the
picker's time range type | `607a1d06` | verbatim |
| #28481 fix(site/src/pages/AIBridgePage): move AI Sessions docs link
inline into subtitle | `0452ff7e` | verbatim |
| #28477 fix(site/src/pages/AIBridgePage): align token badges with
neighboring badge sizing | `e98e2b9b` | verbatim |
| #28561 fix(site): use robot icon for subagent toggle in chat kebab
menu | `94f312df` | verbatim |
| #28557 fix: use medium badges and shorter shared key label on agent
API keys page | `c07bde80` | verbatim |
| #28560 fix(site/src/pages/AgentsPage): use outlined empty state and
kebab menu for personal skills | `74e5a680` | verbatim |
| #28559 fix(site/src/pages/AgentsPage): add organization filter to
compaction settings | `2eee703e` | verbatim |
| #28527 fix(site/src): use md badges for provisioner tags and network
call pills | `f31b7597` | verbatim |
| #28613 fix(site/src): use default combobox dropdown surface |
`2eb9e4fb` | verbatim |
| #28478 fix(site): match sessions date/time picker icon to search field
icon | `769decbe` | verbatim |
| #28612 fix(site/src): move deployment docs links inline as View docs
text links | `046a532a` | resolved |
| #28564 fix(site/src): reposition org pickers in AI settings models and
MCP pages | `78c65ea5` | resolved, ported |

## Conflict resolutions

- **#28612**: conflicted with #28664 (the backport of #28660) in
`SecuritySettingsPageView.{tsx,stories.tsx}` because the backports
landed in reverse `main` order. Resolved by taking `main`'s content;
since only #28612 and #28660 touched those files on either side, the
resolved files are byte-identical to `main`.
- **#28564**: written on top of #28593 (MCP server sharing), which is
not release material. 24 of 29 files applied verbatim; the 5 conflicting
files were ported by hand against pre-#28593 code: `organizationPicker`
prop threading and the edit-requires-dirty submit gate without the
`canShareServer` context, the form header rebuilt as `main`'s version
minus the share button, and story assertions ported (the #28593 share
stories do not exist on this branch).
`ModelFormProviderConfig.stories.tsx` takes `main`'s version,
deliberately folding in the stories-only decorator fix from #28462
because `release/2.37` already has #27960 and those stories were broken
without the provider wrap. Validated with the full MCPServersPage +
ModelsPage Storybook suites (140/140, matching the original PR) and the
`mcpServerFormLogic` unit tests.

## Excluded

- #28492 (built-in emoji avatar inset): reverted on `main` by #28533, so
it is not backported.
- #28558 (show disabled state on AI provider rows): handled individually
in #28662; blocked only on the #28624 backport (see analysis there).

<details>
<summary>Decision log</summary>

- Branch point of `release/2.37` from `main`:
`c275327fb724dea6c4428263d948e13815041b3e` (2026-08-24, #28369),
computed via `git merge-base`.
- 15 of the author's merged PRs landed on `main` after that point; none
had been backported yet (verified by ancestry, patch-id equivalence, and
`(#NNNN)` references in `release/2.37` history since the branch point).
- Cherry-picks were applied oldest-first in `main` topological order;
conflicting picks were initially skipped, then #28612 and #28564 were
resolved on the same base and appended (no file overlap with the
verbatim picks except `docs/ai-coder/agents/models.md`, which merges
cleanly).
- #28492 was initially included, then rebased out after confirming it
was reverted on `main` by #28533 (`bef6b4c30b`).
- The bot's individual cherry-pick PRs were closed as superseded:
#28661, #28663, #28665, #28667, #28668, #28669, #28671, and after
consolidation #28670 and #28666.
- Validation: `pnpm install`, `pnpm run lint:types` (tsc), Biome on
changed files, `mcpServerFormLogic` unit tests, and the AISettingsPage +
SecuritySettingsPage Storybook suites (311 tests) pass after each
change.

</details>

> Created by Coder Agents on behalf of @tracyjohnsonux.

---------

Co-authored-by: Michael Suchacz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick/v2.37 Cherry-pick PR targeting release/2.37

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant