Repository navigation
Conversation
With templates selected, the create project dialog offers a default template, and a default preset when the template's active version has presets. Removing the default template from the selection clears both. The create request sends them as default_template.
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 908ccd45b8
ℹ️ 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".
| <SelectContent> | ||
| {presets.map((preset) => ( | ||
| <SelectItem key={preset.ID} value={preset.ID}> |
There was a problem hiding this comment.
After a user chooses a preset, this menu contains only preset IDs, so the user cannot clear just the optional preset while retaining the selected default template; they must reset and reselect the template to return to the placeholder state. Add a sentinel such as None that calls onChange(""), matching the default-template selector above.
Useful? React with 👍 / 👎.
| await userEvent.click(await screen.findByRole("option", { name: "Docker" })); | ||
| }; | ||
|
|
||
| export const DefaultTemplateWithoutPresets: Story = { |
There was a problem hiding this comment.
Cover the new preset selector states
These stories cover the empty and error branches, but there is no Pixel story for the successful preset selector or its pending-loading state. Both are reachable visual branches introduced here, so regressions in the primary selector or skeleton would have no visual coverage; add separate stories with preset data and a pending query.
AGENTS.md reference: site/AGENTS.md:L7-L7
Useful? React with 👍 / 👎.
| export const ChatProjectTemplatesFields: React.FC< | ||
| ChatProjectTemplatesFieldsProps | ||
| > = ({ templates, templatesError, saveError, value, onChange, disabled }) => { | ||
| const defaultTemplateId = useId(); |
There was a problem hiding this comment.
Rename the generated select ID
defaultTemplateId is a generated DOM control ID, but the same component also uses value.defaultTemplateId for the selected template entity ID. Rename this local to something explicit such as defaultTemplateSelectId so the two unrelated identifiers cannot be confused during maintenance.
AGENTS.md reference: AGENTS.md:L88-L88
Useful? React with 👍 / 👎.
| * Query key for {@link templateVersionPresets}. It sits under the template | ||
| * version's key, so invalidating a version also refetches its presets. |
There was a problem hiding this comment.
Remove the redundant query-key description
The first sentence merely expands the templateVersionPresetsKey identifier into prose. Keep the useful cache-hierarchy invariant, but remove or rewrite the restatement so this comment remains substantive.
AGENTS.md reference: site/AGENTS.md:L10-L10
Useful? React with 👍 / 👎.
| import { SettingSwitch } from "../../SettingSwitch"; | ||
|
|
||
| /** Form state for a project's templates. */ | ||
| /** Form state for a project's templates and the defaults its chats use. */ |
There was a problem hiding this comment.
Document the form-state invariant
This exported-type JSDoc only paraphrases the type name. Replace it with the non-obvious representation contract, such as explaining that empty IDs mean no default template or preset, rather than restating the identifier.
AGENTS.md reference: site/AGENTS.md:L10-L10
Useful? React with 👍 / 👎.
| /** | ||
| * Fields that pick a project's templates and whether its chats are limited to | ||
| * them. | ||
| * Fields that pick a project's templates, whether its chats are limited to | ||
| * them, an optional default template, and that template's default preset. |
There was a problem hiding this comment.
Document behavior instead of listing rendered fields
This component JSDoc only enumerates the controls rendered immediately below it. Replace the list with the meaningful consistency behavior, such as clearing the default and preset when their selected template is removed.
AGENTS.md reference: site/AGENTS.md:L10-L10
Useful? React with 👍 / 👎.
…s/default-template
…s/default-template
…s/default-template
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
…s/default-template
Lets the create project dialog pick a default template for the project's chats, and a default preset for that template.
default_template. The server's validation errors fordefault_template.*fields show under the templates fields.Default parameter values follow in #32374. Split out of #30756.
Stack (merge top to bottom):