Skip to content

Refactor InstanceLinkCell and floating IP form#3142

Merged
david-crespo merged 2 commits intomainfrom
instance-link-tabs
Mar 19, 2026
Merged

Refactor InstanceLinkCell and floating IP form#3142
david-crespo merged 2 commits intomainfrom
instance-link-tabs

Conversation

@david-crespo
Copy link
Collaborator

Extracted from external subnets work coming in #3039 but not present yet in that PR.

@vercel
Copy link

vercel bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
console Ready Ready Preview Mar 19, 2026 10:33pm

Request Review

await Promise.all([
queryClient.fetchQuery(floatingIpView(selector)),
queryClient.fetchQuery(instanceList(selector.project).optionsFn()),
])
Copy link
Collaborator Author

@david-crespo david-crespo Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we were using a list endpoint here so we could fetch it in parallel with the floating IP view instead of having to wait for the floating IP to come back and then use the ID to fetch the instance. However, we're already waiting for the IP pool to come in async. So I figure having both of these resolve out of band and pop in is perfectly fine. I changed these to actually prefetch. The API is fast and I hate pop-in.

if (!result) return <SkeletonCell />

return <LinkCell to={result.to}>{result.name}</LinkCell>
}
Copy link
Collaborator Author

@david-crespo david-crespo Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InstanceLinkCell works in real tables, But the hover styling doesn't work in properties tables. So this change splits out a non-cell instance link component that lets us load instance names in properties tables. Because I'm prefetching the instance on the side modal, we'll never actually see the loading state of this, but in the future we might use it in a place where we want it to pop in.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I unsplit it because it was duplicative, but the idea is the same. It's now just a cell prop.

@david-crespo david-crespo merged commit 93ccb53 into main Mar 19, 2026
7 checks passed
@david-crespo david-crespo deleted the instance-link-tabs branch March 19, 2026 23:08
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