Skip to content

fix(gui): hide unavailable key rotation controls - #423

Open
luvs01 wants to merge 5 commits into
devfrom
codex/fix-ui-regression-in-key-rotation
Open

luvs01 wants to merge 5 commits into
devfrom
codex/fix-ui-regression-in-key-rotation

Conversation

@luvs01

@luvs01 luvs01 commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Prevent standalone installs from showing inert key-rotation controls when the runtime does not provide rotation handlers, avoiding a misleading UI that could display error alerts on click.

Description

  • Add a rotationEnabled guard computed from onRotationStart, onRotationCommit, or onRotationAbort and use it to conditionally render the rotation section in ApiKeysWorkspace (gui/src/components/apikeys-workspace/ApiKeysWorkspace.tsx).
  • Leave the existing runRotation helper unchanged so rotation behavior remains identical when handlers are present.
  • Add a focused regression test that asserts the rotation heading and Start/Commit/Abort buttons are not present when no rotation callbacks are supplied (gui/tests/apikeys-actions.test.tsx).

UI screenshot

API key detail on a standalone install — the Key rotation section is hidden between Key details and Attributed usage

Testing

  • Ran the focused GUI test: cd gui && bun test tests/apikeys-actions.test.tsx, which passed (including the new test).
  • Ran GUI validation commands: cd gui && bun run lint and cd gui && bun run build, both succeeded for the changed code path.
  • Ran repository checks: bun run typecheck and bun run privacy:scan, both succeeded for the modified files.

Codex Task

Link to Devin session: https://app.devin.ai/sessions/c66f906db0b04a40940502baa5f0115e
Open in Devin Desktop: https://app.devin.ai/desktop/session/c66f906db0b04a40940502baa5f0115e?variant=devin

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository: luvs01/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: da72c2bb-c267-4880-ade5-27c4d5b76142


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-03T06:20:35.991102Z 2648093 PR opened
ℹ️ 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.

@github-actions github-actions Bot added the bug Something isn't working label Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

✅ READY

  • all PR quality gates passed.

Hygiene

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot changed the title fix(gui): hide unavailable key rotation controls [WRONG BRANCH] fix(gui): hide unavailable key rotation controls Sep 3, 2026
@github-actions
github-actions Bot marked this pull request as draft September 3, 2026 06:20
@luvs01 luvs01 changed the title [WRONG BRANCH] fix(gui): hide unavailable key rotation controls fix(gui): hide unavailable key rotation controls Sep 3, 2026
@luvs01
luvs01 changed the base branch from main to dev September 3, 2026 06:21
@github-actions
github-actions Bot marked this pull request as ready for review September 21, 2026 04:31
devin-ai-integration[bot]

This comment was marked as resolved.

Co-Authored-By: Epinephrine <luvs01@hanmail.net>
@devin-ai-integration

Copy link
Copy Markdown

Fixed in dd078ab. Each rotation action is now gated by its own handler, and the section renders only when the selected key's state has a wired action — start for an idle key, commit/abort for a pending one — so a partial handler set can no longer surface a button that can only fail locally. Added partial-handler tests covering both key states in gui/tests/apikeys-actions.test.tsx; focused run passes 15/15, tsc -b clean.

devin-ai-integration[bot]

This comment was marked as resolved.

…tions

A start-only caller's successful rotation flips selectedRotationId truthy,
which switched the section guard to commit/abort and unmounted the reveal —
stranding the one-time secret. Treat a matching rotationSecret as its own
reason to render, and wire Copy/Close to their optional callbacks instead
of always drawing them. Adds a rerender test for the start->secret flow
and coverage for the secret controls' independent gating.

Co-Authored-By: Epinephrine <luvs01@hanmail.net>
@devin-ai-integration

Copy link
Copy Markdown

Fixed in bed96dd. A matching rotationSecret now renders the section on its own — rotationEnabled no longer flips to commit/abort when a start-only integration's issued secret arrives, so the one-time value stays on screen. The reveal box's Copy and Close buttons are separately gated on onCopyRotationSecret and onDismissRotationSecret, and the commit/abort action row only renders when at least one finish handler is wired. Added a rerender test for the start→secret flow and coverage for the secret controls' independent gating in gui/tests/apikeys-actions.test.tsx; focused run passes 17/17, tsc -b clean.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

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

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant