Skip to content

Create instance from existing boot disk - #2076

Merged
david-crespo merged 11 commits into
mainfrom
existing-boot-disk
Apr 3, 2024
Merged

david-crespo merged 11 commits into
mainfrom
existing-boot-disk

Conversation

@benjaminleonard

@benjaminleonard benjaminleonard commented Mar 18, 2024 •

Copy link
Copy Markdown
Contributor

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

@vercel

vercel Bot commented Mar 18, 2024 •

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Collaborator

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

Comment thread app/forms/instance-create.tsx Outdated
@charliepark

Copy link
Copy Markdown
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

@charliepark charliepark left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread app/forms/instance-create.tsx Outdated
// 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
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice

Comment thread app/forms/instance-create.tsx Outdated
Comment thread app/forms/instance-create.tsx Outdated
Comment thread app/forms/instance-create.tsx Outdated

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

@david-crespo david-crespo Mar 25, 2024 •

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Contributor Author

Great, copy changes look good to me

@charliepark

Copy link
Copy Markdown
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
Comment thread app/forms/instance-create.tsx

@david-crespo david-crespo left a comment

Copy link
Copy Markdown
Collaborator

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
@david-crespo
david-crespo deleted the existing-boot-disk branch April 3, 2024 16:09

This branch was successfully deployed

1 active deployment
Preview — 530ff5c7 Deployed Apr 3, 2024 by vercel[bot]
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