Skip to content

feat(site/src/pages/AgentsPage/AgentSettingsPage/ForkAgentDefinitionsPage): hide agent definition actions the user cannot take - #159

Merged
ibetitsmike merged 68 commits into
mainfrom
mike/agent-definitions-ui-7-access
Nov 11, 2026
Merged

ibetitsmike merged 68 commits into
mainfrom
mike/agent-definitions-ui-7-access

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Xum opened this PR on behalf of @ibetitsmike.

Part of #75.

Prepares the agent definitions table for the organization page, where members read the organization's definitions and only admins change them:

  • ForkAgentDefinitionsTable takes an optional SkillAccess (create, update, delete), the type the skills pages use; organization agent definitions are authorized with the organization skill RBAC object. Without create there is no New agent definition, without update the Enabled column shows the static Enabled/Disabled icon of the read-only skills table (SkillEnabledStatus, now exported from SkillEnabledSwitch.tsx) and the row menu has no Edit, without delete it has no Delete…, and with neither the table has no actions column. The personal page keeps full access.
  • The section description, the empty message and the delete confirmation message come from the scope's tier, with organization copy for the organization tier.

Tests: an organization-scope table toggles through the organization route. A ReadOnly table view story shows the member view.

Checks: tsc, biome, oxlint, knip, lint:check, lint:compiler, lint:circular-deps, the folder's Vitest unit tests (76) and the table view story tests (13) pass locally.

Carry the organization in toggle and delete variables so a request that
settles after an organization switch releases and invalidates its own
list, reconcile the list after a failed delete, fall back to the table
when the last row's menu button is gone, and describe deletion as
removing only the personal definition.
A toggle or delete the server accepted stays visible even if the
reconciling refetch fails.
…ion is gone

A delete whose response was lost can still have committed, so the
refetched list decides whether the dialog closes.
Keep the model and the other front-matter in the dialog and give the
skill form a content builder, so the size limit, the meter, and the
submitted markdown all use the agent definition file. Block Escape while
a save runs, keep standalone front-matter comments, describe the field
for agents, document the exported context hook, and test import and
submit.
…ly bodies

The size limit counts the model, which lives outside the skill form, so
a model change validates again. The server strips HTML comments before it
requires a body, so the form does too. The dialog now submits the name
with the content.
…itions

A create whose response was lost closes the editor when the refetched
list shows the new name and the name was not listed before. Reopening a
definition seeds the editor from cached data instead of waiting for the
refetch. Tighten the API and query JSDoc.
…ssals, and indented comments

The editor keeps the values it opened with as every field's baseline, so
refreshed initial values cannot reset some fields and leave others stale.
Escape and outside clicks act as Cancel, which the form disables from the
moment Save is clicked. Indented front-matter comments after owned keys
are kept unless they sit inside that key's block or quoted text. Add
stories for the submitting and import error states.
…or-dialog' into mike/agent-definitions-ui-4-editor-wiring
A save writes its response to the definition's cached detail, so a
reopened editor shows the saved content even if the refetch fails.
Cached content seeds the editor only when it matches the listed
definition's id and is at least as new, or a fetch just returned it, so
a definition recreated or edited elsewhere waits for its fetch.
Hand-classifying front-matter lines lost inline comments on owned keys and
produced invalid YAML for indented root keys. Parse the front-matter as a
yaml Document and set the owned keys in place, which keeps comments and
other keys.
…m:ibetitsmike/coder into mike/agent-definitions-ui-4-editor-wiring
…m:ibetitsmike/coder into mike/agent-definitions-ui-4-editor-wiring
…m:ibetitsmike/coder into mike/agent-definitions-ui-4-editor-wiring
@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum requested this review on behalf of @ibetitsmike.

@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: a21e2bc89b

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum requested this review on behalf of @ibetitsmike.

@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: f88326de59

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum requested this review on behalf of @ibetitsmike.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: f2f846d52b

ℹ️ 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".

…s-ui-4-editor-wiring

# Conflicts:
#	site/src/pages/AgentsPage/AgentSettingsPage/ForkAgentDefinitionsPage/ForkAgentDefinitionEditorDialog.stories.tsx
#	site/src/pages/AgentsPage/AgentSettingsPage/ForkAgentDefinitionsPage/ForkAgentDefinitionEditorDialog.tsx
…s-ui-6-tier-scope

# Conflicts:
#	site/src/api/forkAgentDefinitions.ts
#	site/src/api/queries/forkAgentDefinitions.test.ts
#	site/src/api/queries/forkAgentDefinitions.ts
#	site/src/pages/AgentsPage/AgentSettingsPage/ForkAgentDefinitionsPage/ForkAgentDefinitionsPage.test.tsx
#	site/src/pages/AgentsPage/AgentSettingsPage/ForkAgentDefinitionsPage/ForkAgentDefinitionsTable.tsx
#	site/src/pages/AgentsPage/AgentSettingsPage/ForkAgentDefinitionsPage/useForkAgentDefinitionEditor.ts
…-scope' into mike/agent-definitions-ui-7-access
…-scope' into mike/agent-definitions-ui-7-access
Base automatically changed from mike/agent-definitions-ui-6-tier-scope to main November 11, 2026 01:27
…s-ui-7-access

# Conflicts:
#	site/src/pages/AgentsPage/AgentSettingsPage/ForkAgentDefinitionsPage/ForkAgentDefinitionsTable.tsx
@ibetitsmike
ibetitsmike marked this pull request as ready for review November 11, 2026 01:29

@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: 363fa3deef

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum commented on behalf of @ibetitsmike.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 3211c89392

ℹ️ 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".

@ibetitsmike
ibetitsmike merged commit 73f9bfa into main Nov 11, 2026
10 checks passed
@ibetitsmike
ibetitsmike deleted the mike/agent-definitions-ui-7-access branch November 11, 2026 01:57
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) merged this on behalf of @ibetitsmike.

Merge evidence for head 3211c893922926aaf590ae6f4f24760289e0bdba:

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