Skip to content

refactor(site/src/pages/AgentsPage): extract switch and conflict alert components - #32371

Draft
jaaydenh wants to merge 5 commits into
chat-project-templates/chatdfrom
chat-project-templates/site-refactors
Draft

jaaydenh wants to merge 5 commits into
chat-project-templates/chatdfrom
chat-project-templates/site-refactors

Conversation

@jaaydenh

@jaaydenh jaaydenh commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Moves two pieces of the Agents page into their own components, so the chat project templates UI in the PRs above can reuse them. Nothing changes for users.

Split out of #30756 and #30898 to keep each PR small.

Stack (merge top to bottom):

…Tooltip, and ProjectEditConflictAlert

The chat project templates UI reuses these three pieces, so they move
out of the components that own them today:

- SettingSwitch from SkillEditor. Its description now takes React nodes.
- FocusableTooltip from the Created row of the project details.
- ProjectEditConflictAlert from ProjectInstructionsDialog.
@jaaydenh

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T08:14:05.275827Z 10f4a82 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 10f4a82aa8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

* Text with a tooltip. The text is a button, so keyboard users can focus it
* to read the tooltip.
*/
export const FocusableTooltip: React.FC<FocusableTooltipProps> = ({

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep the one-off tooltip markup at its use site

In this revision, FocusableTooltip has only one consumer, so extracting it adds a file and component API without established reuse; planned consumers in later stack layers do not make this commit self-contained. Keep the markup in ProjectDetailsPanelView.tsx and extract it when a second caller lands.

AGENTS.md reference: site/AGENTS.md:L58-L59

Useful? React with 👍 / 👎.

Comment on lines +17 to +18
export const ProjectEditConflictAlert: React.FC<
ProjectEditConflictAlertProps

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep the one-off conflict alert at its use site

In this revision, ProjectEditConflictAlert is used only by ProjectInstructionsDialog, so its callbacks, ref, and content now cross a file boundary without established reuse. Keep the alert inline until the additional editor that needs this abstraction lands.

AGENTS.md reference: site/AGENTS.md:L58-L59

Useful? React with 👍 / 👎.

Comment on lines +16 to +17
* Text with a tooltip. The text is a button, so keyboard users can focus it
* to read the tooltip.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove the restating tooltip description

The first sentence, “Text with a tooltip,” merely repeats FocusableTooltip; retain only the useful keyboard-focus contract so the exported-symbol documentation adds information rather than restating the identifier.

AGENTS.md reference: site/AGENTS.md:L9-L10

Useful? React with 👍 / 👎.

Comment on lines +13 to +16
/**
* Warns that a project setting changed elsewhere while its editor was open,
* and asks whether to keep the draft or load the latest value.
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove the restating conflict-alert description

This JSDoc paraphrases the component name and the two visibly labeled actions without documenting a non-obvious invariant. Replace it with a substantive contract if the component remains exported, or remove it along with the premature extraction.

AGENTS.md reference: site/AGENTS.md:L9-L10

Useful? React with 👍 / 👎.

readonly onCheckedChange: (checked: boolean) => void;
};

/** A labeled switch for one setting, with the description below its label. */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Document the switch's non-obvious contract

The SettingSwitch JSDoc only repeats the component name and narrates its layout. Rewrite it around the meaningful accessibility contract, such as associating the description through aria-describedby, so the required export documentation adds information.

AGENTS.md reference: site/AGENTS.md:L9-L10

Useful? React with 👍 / 👎.

…es/site-refactors

# Conflicts:
#	site/src/pages/AgentsPage/components/SkillEditor.tsx
…Created tooltip inline

Drops FocusableTooltip. TooltipTrigger already renders a focusable
button, so the wrapper only added class names.
@jaaydenh jaaydenh changed the title refactor(site/src/pages/AgentsPage): extract switch, tooltip, and conflict alert components refactor(site/src/pages/AgentsPage): extract switch and conflict alert components Nov 18, 2026
jaaydenh added a commit that referenced this pull request Nov 18, 2026
Adds the API for attaching workspace templates to a chat project, on the
schema and queries in #32309. A project can attach templates, turn on a
limit that restricts its chats to them, and set a default template with
either a default preset or default parameter values. Attaching a
template never grants access to it: every reader is checked against the
template's own sharing. This PR stores and returns `limit_templates`;
#32310 enforces it.

- The limit is opt-in. `limit_templates` is off unless a request turns
it on, which is what every existing project gets.
- Templates are attached and detached one at a time with `PUT` and
`DELETE /chats/projects/{project}/templates/{template}`, so a caller
never replaces a list they can only partly see. Attaching needs project
`update` and template `use`. Detaching needs project `update` and
template `read`, and a template the caller cannot read is reported as
not found. `POST /chats/projects` accepts `template_ids`,
`limit_templates`, and `default_template` for the new project.
- `PATCH /chats/projects/{project}` sets `limit_templates` and
`default_template`, and no longer changes which templates are attached.
The default must be an attached template the caller can read, and its
preset must belong to the template's active version. Default parameter
names and values are checked against that version for templates on the
classic parameter flow; dynamic parameters are checked when a workspace
is built. Detaching the default template clears the default.
- Project responses list only the attached templates the caller can
read, as `templates`, and count the rest as `hidden_template_count`.
`default_template` is omitted when the caller cannot read it. Deleted,
deprecated, and agent-disabled templates are left out and are not
counted as hidden.
- Editing uses `chat_project:update`, which the project owner and the
project `admin` ACL role have.
- Attaching and detaching are audited as writes to the project, with the
template list before and after, including the templates attached while
creating a project. Changes to `limit_templates` and the default
template are part of the project's own audit diff.

Not included: showing which project members lack access to an attached
template, and MCP server attachments.

Stack (merge top to bottom):
- #32309
- #30754 👈
- #32310
- #30755
- #32371
- #32372
- #30756
- #32373
- #32374
- #32375
- #30898
- #32376
- #32377
- #32378
- #32379

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant