Skip to content

refactor(dashboard): mirror check button disable state in AddApiKeyModal Enter handler (#10995) - #11156

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.50from
rqzbeh:refactor/add-api-key-modal-enter-polish
Aug 22, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.50from
rqzbeh:refactor/add-api-key-modal-enter-polish

Conversation

@rqzbeh

@rqzbeh rqzbeh commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Addresses the two post-merge polish suggestions from #11056 for AddApiKeyModal:

  1. Mirrored Check Disabling Condition:
    Updated the onKeyDown Enter key handler in AddApiKeyModal.tsx to reuse isCheckDisabled ((!isCompatible && !apiKeyOptional && !formData.apiKey) || (isGooglePse && !formData.cx.trim()) || validating || saving). This prevents dispatching unnecessary validation requests when the field is empty or Google PSE cx is missing.

  2. React Render Test:
    Converted tests/unit/ui/add-api-key-modal-enter-key.test.tsx to a React render test simulating keydown Enter events with @vitest-environment jsdom.

  3. Code Formatting:
    Formatted test code using Prettier.

Verification

  • npx vitest run tests/unit/ui/add-api-key-modal*.test.tsx (10/10 tests passed)
  • npm run typecheck:core (0 errors)
  • npx eslint (0 issues)

@rqzbeh
rqzbeh requested a review from diegosouzapw as a code owner August 22, 2026 19:53
@rqzbeh
rqzbeh force-pushed the refactor/add-api-key-modal-enter-polish branch 4 times, most recently from 8a64cb7 to dff4865 Compare August 22, 2026 22:24
@diegosouzapw
diegosouzapw force-pushed the refactor/add-api-key-modal-enter-polish branch from dff4865 to fd96e3f Compare August 22, 2026 23:13
@diegosouzapw
diegosouzapw merged commit d3ac1a6 into diegosouzapw:release/v3.8.50 Aug 22, 2026
0 of 3 checks passed
diegosouzapw pushed a commit that referenced this pull request Aug 23, 2026
Merged after conflict resolution (validated on the combined batch board + this branch): stale drift files (package.json/package-lock/.gitignore) kept at tip; the two modals merged additively — AWS SigV4 fields coexist with the chatgpt-web-codex tunnel fields and the #11156 Enter-handler mirror (vitest 2/2 re-run). file-size gate green with the dated AddApiKeyModal 1173 entry (owner-authorized). aws-polly modal + provider-validation-specialty 127/127. Base was mistakenly main; retargeted to release/v3.8.50. Credentials stay in the protected field; nothing logged. Thank you @rafacpti23!
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…dal Enter handler (diegosouzapw#10995) (diegosouzapw#11156)

Cherry-picked onto the current tip (authorship preserved), generated-count noise stripped. Pre-merge: file-size baseline rebaselined 1080→1082 with dated annotation (the +2 lines are the Enter-handler isCheckDisabled mirror — owner-requested diegosouzapw#11056 polish; rest is Prettier reflow). Gate green; vitest add-api-key-modal-enter-key 2/2 (jsdom render test). Thank you @rqzbeh!
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
Merged after conflict resolution (validated on the combined batch board + this branch): stale drift files (package.json/package-lock/.gitignore) kept at tip; the two modals merged additively — AWS SigV4 fields coexist with the chatgpt-web-codex tunnel fields and the diegosouzapw#11156 Enter-handler mirror (vitest 2/2 re-run). file-size gate green with the dated AddApiKeyModal 1173 entry (owner-authorized). aws-polly modal + provider-validation-specialty 127/127. Base was mistakenly main; retargeted to release/v3.8.50. Credentials stay in the protected field; nothing logged. Thank you @rafacpti23!
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.

2 participants