Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create instance from existing boot disk #2076

Merged
merged 11 commits into from
Apr 3, 2024
Merged

Conversation

benjaminleonard
Copy link
Contributor

@benjaminleonard benjaminleonard commented Mar 18, 2024

Fixes #1060

This exacerbates the confusion with #2075 – where it is unclear what happens to the selected value when a user switches tabs. That doesn't necessarily need to be a blocker for this, would prefer to think through a design solution first.

CleanShot 2024-03-18 at 12 32 10

Also seeing a flash from the navigation blocker after submission. Unsure if that's something I introduced with this PR by accident.

  • Fix click from number input to tab bar not setting value
  • Text that explains which disks are usable

Copy link

vercel bot commented Mar 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
console ✅ Ready (Inspect) Visit Preview Apr 3, 2024 5:00am

@benjaminleonard
Copy link
Contributor Author

Also running into an issue where the disk size input does not apply if you exit focus by clicking on the tab bar. Maybe the setValue on bootDiskSource interrupts the disk size input applying its own value. This is causing a failed E2E test.

CleanShot 2024-03-18 at 12 36 44

@david-crespo
Copy link
Collaborator

Ugh, thought I fixed the flash for good. Will look at it.

@charliepark
Copy link
Contributor

Also running into an issue where the disk size input does not apply if you exit focus by clicking on the tab bar. Maybe the setValue on bootDiskSource interrupts the disk size input applying its own value. This is causing a failed E2E test.

This appears to be fixed now

Copy link
Contributor

@charliepark charliepark left a comment

Choose a reason for hiding this comment

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

This looks good; sorry for the delayed approval. Was running into issues that stemmed from me not restarting vite, but this is solid.

@@ -334,8 +367,14 @@ export function CreateInstanceForm() {
className="full-width"
// default to the project images tab if there are only project images
defaultValue={
projectImages.length > 0 && siloImages.length === 0 ? 'project' : 'silo'
siloImages.length > 0 ? 'silo' : projectImages.length > 0 ? 'project' : 'disk'
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice

@@ -95,11 +106,24 @@ const baseDefaultValues: InstanceCreateInput = {
userData: null,
}

const useBootDiskItems = (projectSelector: PP.Project) => {
const { data: disks } = useApiQuery('diskList', {
query: { ...projectSelector, limit: 1000 },
Copy link
Collaborator

@david-crespo david-crespo Mar 25, 2024

Choose a reason for hiding this comment

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

Tested this with 500 disks in the response and it doesn't seem to get bogged down at all. Obvious candidate for a combobox.

@benjaminleonard
Copy link
Contributor Author

Great, copy changes look good to me

@charliepark
Copy link
Contributor

I have a few fixes in #2097 that I'm close to merging here

#2097)

* Fix issue with sourceType collision on project vs silo images and disks

* refactor

* Refactoring, and updating types

* Maintain state of fields across tab navigation (#2100)

* Simplify test; make it work for Safari

* Clean up and add comments

* verify in test that correct image used

* clean up comment
Copy link
Collaborator

@david-crespo david-crespo left a comment

Choose a reason for hiding this comment

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

@david-crespo david-crespo enabled auto-merge (squash) April 3, 2024 05:02
@david-crespo david-crespo disabled auto-merge April 3, 2024 16:09
@david-crespo david-crespo merged commit 2cfc8ee into main Apr 3, 2024
8 checks passed
@david-crespo david-crespo deleted the existing-boot-disk branch April 3, 2024 16:09
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.

Choose existing disk as a boot disk on instance create
3 participants