Instance create form: automatically select SSH key after creation#3173
Merged
david-crespo merged 2 commits intomainfrom Apr 9, 2026
Merged
Instance create form: automatically select SSH key after creation#3173david-crespo merged 2 commits intomainfrom
david-crespo merged 2 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
david-crespo
commented
Apr 9, 2026
| {showAddSshKey && ( | ||
| <SSHKeyCreate | ||
| onDismiss={() => setShowAddSshKey(false)} | ||
| onSuccess={(sshKey) => onChange([...selectedKeys, sshKey.id])} |
Collaborator
Author
There was a problem hiding this comment.
This is the fix.
This was referenced Apr 10, 2026
david-crespo
added a commit
that referenced
this pull request
Apr 10, 2026
It's barely worth fixing, but codex flagged it in #3173 and it's real. Watch the `select all` checkbox below when I submit the create SSH key form. In the very short interval of time after the key is created and but before list of keys refetches, the select all checkbox flashes checked (all are selected) before flipping back to intermediate when the list comes in. It's trivial and it's not worth keeping the e2e test I used to prove and fix it (removed in 966aac1), but it is worth fixing now that I know about. https://github.com/user-attachments/assets/0bc9e5ff-ceb0-49b5-856d-8998a8971528 The checkbox showing the wrong thing is not actually the entire bug — if the user toggles select all during this interval, the behavior is slightly weird because the list of keys is out of sync, but it's nearly impossible for a human user to move fast enough to run into the issue, and the state after the request comes back will be up to date. The real fix would be to make `onSuccess` wait until after the invalidate is complete. But we don't have any other examples of `async onSuccess`, so I don't want to rush that fix in. ```diff const handleDismiss = onDismiss ? onDismiss : () => navigate(pb.sshKeys()) const createSshKey = useApiMutation(api.currentUserSshKeyCreate, { - onSuccess(sshKey) { - queryClient.invalidateEndpoint('currentUserSshKeyList') + async onSuccess(sshKey) { + await queryClient.invalidateEndpoint('currentUserSshKeyList') onSuccess?.(sshKey) handleDismiss() // prettier-ignore ```
david-crespo
added a commit
to oxidecomputer/omicron
that referenced
this pull request
Apr 10, 2026
oxidecomputer/console@b6c8d10...1cc2ce6 * [1cc2ce61](oxidecomputer/console@1cc2ce61) oxidecomputer/console#3177 * [0df8ff04](oxidecomputer/console@0df8ff04) oxidecomputer/console#3176 * [aec681b4](oxidecomputer/console@aec681b4) oxidecomputer/console#3173 * [0fe17297](oxidecomputer/console@0fe17297) oxidecomputer/console#3168
david-crespo
added a commit
to oxidecomputer/omicron
that referenced
this pull request
Apr 10, 2026
oxidecomputer/console@b6c8d10...1cc2ce6 * [1cc2ce61](oxidecomputer/console@1cc2ce61) oxidecomputer/console#3177 * [0df8ff04](oxidecomputer/console@0df8ff04) oxidecomputer/console#3176 * [aec681b4](oxidecomputer/console@aec681b4) oxidecomputer/console#3173 * [0fe17297](oxidecomputer/console@0fe17297) oxidecomputer/console#3168
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After you create an SSH key in the instance create form, it should automatically be checked to be injected into the instance. Otherwise why would you be adding it? Actual fix is 9285551, second commit is a tiny bit of code cleanup.
Did my favorite Claude thing and asked it whether we originally had a reason to not auto-select the SSH key. Definitively, no:
2026-04-08-ssh-key-auto.mp4