Skip to content

feat(site): saved workflows settings page (fork-workflows) - #387

Merged
ibetitsmike merged 12 commits into
mainfrom
mike/issue-327-saved-workflows-settings
Nov 19, 2026
Merged

ibetitsmike merged 12 commits into
mainfrom
mike/issue-327-saved-workflows-settings

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Coder Agents opened this PR on behalf of @ibetitsmike.

Part of #327 (the AI settings page). #391 completes it.

What

New AI Settings page for saved workflows, behind the fork-workflows experiment. It lists the personal and organization saved workflows of the selected organization in two sections, with:

  • create, edit, and delete through an editor dialog with client-side validation against the server's field limits
  • a read-only detail dialog showing the script, args schema, and phases
  • per-row permission sharing for the organization tier, reusing the organization skill ACL endpoints
  • an organization picker above both sections that shares the URL parameter with the sibling fork pages

All UI lives in fork files. Upstream files carry one hook line each: a lazy route in forkRoutes.tsx, sidebar nav items in AISettingsSidebarView.tsx, and a nav hook in forkAISettingsNav.ts. No backend changes.

Behavior worth review

  • No lost-response recovery. A save whose response is lost or fails keeps the editor open with the draft, so the user can retry. The client does not try to guess the server outcome.
  • Delete checks the id. The API deletes by name, so delete first GETs the name and compares the id with the picked row. A 404 or a different id, on the GET or on the DELETE, aborts with an info toast and deletes nothing. This needs read access for delete, which every listed row has.
  • Fresh editor seed. The editor seeds only after a fresh refetch of the list and the detail, so a stale cache never seeds it.
  • Limit. New workflow is disabled at 100 workflows per scope, with a tooltip that says why.
  • Membership. The personal tier only shows for organizations the user is a member of. Others see the organization tier alone.
  • Args schema. The size check counts compact JSON, as the server does. Numbers JSON.parse would change (unsafe integers, overflow, nonzero underflow) are rejected with a hint to write them as strings.
  • Copy. The section copy makes no owner-only or universal visibility promise.
  • Focus. Read-only tables use the name button as the focus fallback when a row goes away.
  • Widened update type. The generated UpdateForkSavedWorkflowRequest.args_schema cannot hold null, but the API treats null as "remove the schema" and an absent key as "leave unchanged". UpdateSavedWorkflowRequest in api/forkSavedWorkflows.ts widens the field to Record<string, string> | null; buildUpdateSavedWorkflowRequest always sends the key, null when the field is cleared.
  • PR size. About 3,800 new lines, above the usual 500-line bar, kept as one cohesive fork feature: the queries, editor hook, dialogs, table, and page share one cache model. Extracting a layer shared with forkAgentDefinitions is a follow-up.

Tests

Run in site/ on d414ff3:

  • pnpm exec vitest run --project unit src/pages/AISettingsPage src/api/queries: 41 files, 659 passed
  • pnpm exec vitest run --project storybook src/pages/AISettingsPage/ForkWorkflowsPage: 5 files, 42 passed
  • pnpm exec tsc -p .: clean
  • biome check and oxlint on the touched files: clean
  • pnpm lint (on 48f1fb9): biome, oxlint, tsc and circular deps clean. lint:compiler fails only on ForkHtmlAttachmentViewer.tsx (on main). lint:sentence-case reports the same 25 findings with and without this change. knip reports only chatPinnedSkillsKey and excludedPluginPacksKey (on main).

Negative controls, each verified to fail and then restored:

  • Skipping the id compare in deleteSavedWorkflow fails "deletes nothing when the name holds a recreated workflow" and "deletes nothing when the name now holds another workflow".
  • Letting the editor seed from any cached data fails "seeds the editor from a fresh fetch".
  • Removing the name button fallback ref fails the read-only focus test.
  • Rendering the picker inside the tables again fails "keeps the picker and its focus when a switch hides the personal tier".
  • Filtering the cache by name after a delete fails "keeps a same-name workflow cached while the delete was in flight".
  • Keeping the cached detail on create (cached ?? workflow) fails "replaces an older same-name workflow in the detail cache".
  • Measuring the untrimmed description fails "measures the description and script as the request sends them".
  • Removing the name input's aria-describedby fails "creates a workflow from the editor form".
  • Skipping the id check when a row opens its detail fails "does not show a cached detail of an earlier workflow with the same name".

Follow-ups: #391 (personal Workflows page in Agent settings for members), #392 (id-conditional PATCH and DELETE on the server).

Not exercised: live member and sharing behavior against a dev build (stories and unit tests only).

@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-19T17:25:31.855954Z d414ff3 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: 7a7e7ddd35

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

Coder Agents acted on behalf of @ibetitsmike.
@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

… save

The lost-response recovery in the saved workflow editor compared only the
script, so a description, args schema, or phases edit that lost its
response closed the editor and reported success while the refetched
workflow still showed the old values.
The lost-response comparison of a saved workflow update normalized the
missing-schema case (undefined on the server, null in the request) and
compared schemas as canonical JSON, so nested schemas and schemas the
server stores as absent fields recover the same way plain ones do.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.
@codex review

@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: 731ff93be5

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

The lost-response create confirmation now compares every submitted
field, the confirmed delete drops the workflow's cached detail query,
and the organization section no longer claims every member can run a
workflow whose permissions were narrowed.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.
@codex review

@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: 2a8398dd68

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

Coder Agents acted on behalf of @ibetitsmike.

Lead takeover: the previous workstream made no commit for 17 hours, so it is archived. A new workstream (Opus) owns this PR on the same branch. It will drop the lost-response reconciliation, fix the two P1s (delete by name checks the id first; the editor seeds only after the refetch), handle the P2s on the limit, copy, personal tier, unsafe integers and focus, then run fork-ci and Codex.

Remove the lost-response reconciliation: a failed save shows an error and
the user retries. Delete checks that the name still holds the picked
workflow. The editor seeds only from a fetch made after it opened. New
workflow is disabled at the limit of 100 with a tooltip. The personal tier
shows only to organization members. The args schema rejects integers JSON
cannot keep exactly and counts its compact size. The description field
keeps line breaks. Read-only tables return focus to a name button.
…aces

The organization picker now sits above both tiers, so switching to an
organization without the personal tier keeps its focus. The New workflow
tooltip wraps the button either way. A DELETE that 404s after the id
check reports the workflow as changed. The args schema check rejects
nonzero numbers that underflow to 0, and the detail dialog keeps the
description's line breaks.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@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: 48f1fb91f6

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

The delete success handler filtered the list by name, so a same-name
workflow cached while the delete was in flight vanished. It now matches
the deleted id, for the list and the detail query.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@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: 9f880a2f0f

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

… checks

A create now writes its response to the detail cache, so an older
same-name workflow cached there no longer shows. The description and
script limits measure the trimmed values the request sends. The name
input references its help text, and the limit test no longer checks
rendered state the AtLimit story covers.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

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

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

…th the same name

The detail cache is keyed by name, so after a delete and recreate in
another tab it could show the earlier workflow for the new row.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: d414ff32a8

ℹ️ 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 7c92dd5 into main Nov 19, 2026
10 checks passed
@ibetitsmike
ibetitsmike deleted the mike/issue-327-saved-workflows-settings branch November 19, 2026 17:37
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

Merged at head d414ff32a8b903e0318472ae39647d03b8af9bab as 7c92dd5, on main e358fe5e2dab25576647fb5fe03dd3a157e67cf1, with the server running that main.

Gates on this exact head:

  1. The head matched the SHA I verified (--match-head-commit).
  2. Every check run passed. fork-ci run 44576044293 passed on this head.
  3. Codex receipt for this head: feat(site): saved workflows settings page (fork-workflows) #387 (comment) ("Didn't find any major issues", Reviewed commit: d414ff32a8).
  4. No unresolved review thread.
  5. 0 commits behind main.
  6. I ran the tests below on this exact head.

Tests I ran on d414ff32a8:

  • pnpm exec vitest run --project unit src/pages/AISettingsPage/ForkWorkflowsPage src/api/queries/forkSavedWorkflows.test.ts: 3 files, 45 tests passed.
  • Negative control: with the id compare before DELETE disabled, 2 tests fail ("deletes nothing when the name holds a recreated workflow" and "deletes nothing when the name now holds another workflow"). The source was restored after it.
  • The workstream also ran the AISettingsPage and api/queries unit suites (659 passed), the storybook project for the page (42 passed) and tsc, with more negative controls listed in the PR body.

Review notes:

Not exercised: a dev build with two members editing and sharing workflows. Member and sharing behavior is covered only by unit tests and stories.

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