Skip to content

[codex] enforce unique secret ids client-side in web UI#347

Open
heyglassy wants to merge 1 commit intoRhysSullivan:mainfrom
heyglassy:codex/ui-secret-id-uniqueness
Open

[codex] enforce unique secret ids client-side in web UI#347
heyglassy wants to merge 1 commit intoRhysSullivan:mainfrom
heyglassy:codex/ui-secret-id-uniqueness

Conversation

@heyglassy
Copy link
Copy Markdown
Contributor

@heyglassy heyglassy commented Apr 20, 2026

What changed

  • add a shared React helper to slugify secret labels, detect duplicate IDs from the loaded secret list, and generate the first available -2, -3, etc. suffix
  • wire the helper into the shared inline secret creator used by source flows and the secrets page dialog
  • add client-side duplicate-ID validation so the UI blocks save when the typed secret ID already exists
  • leave Google Discovery unchanged
CleanShot 2026-04-20 at 12 09 09@2x CleanShot 2026-04-20 at 12 09 22@2x

Why

Creating secrets from web source flows could prefill IDs that collided with existing secrets, and the UI would allow the duplicate through because secrets.set is still an upsert. This keeps the API/core contract unchanged and makes the web UI pick a unique default and block obvious collisions before submit.

Validation

  • bun run --filter @executor/react typecheck
  • bun run --filter @executor/plugin-openapi typecheck
  • bun run --filter @executor/plugin-google-discovery typecheck
  • bunx vitest run --config vitest.config.ts src/plugins/secret-id.test.ts (from packages/react)

@heyglassy heyglassy force-pushed the codex/ui-secret-id-uniqueness branch 3 times, most recently from 1dc4677 to 00da213 Compare April 20, 2026 19:05
Keep secret ID uniqueness enforcement in the web UI only and preserve the existing upsert behavior in the core secrets API.

Prefill source and secrets-page creation flows with the first available unique ID, prevent duplicate manual IDs in the shared React flows, and show each saved secret's ID beside its name in the secrets list with subdued monospace styling and a themed hover tooltip for the full value. Add an optional hideArrow escape hatch to the shared tooltip component so the secrets list can keep that tooltip flush with the dark UI.
@heyglassy heyglassy force-pushed the codex/ui-secret-id-uniqueness branch from 00da213 to 6b06979 Compare April 20, 2026 19:08
@heyglassy heyglassy marked this pull request as ready for review April 20, 2026 19:10
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