Skip to content

Add source cell for disks, with side modal#3214

Open
charliepark wants to merge 15 commits into
mainfrom
add_disk_source_cell
Open

Add source cell for disks, with side modal#3214
charliepark wants to merge 15 commits into
mainfrom
add_disk_source_cell

Conversation

@charliepark

@charliepark charliepark commented May 11, 2026

Copy link
Copy Markdown
Contributor

This PR adds a "source" cell to each row in the Disks table, and to each Instance's "Storage" tab.

Screenshot 2026-05-11 at 4 49 59 PM

For each of those locations, it provides a side modal with more info on the source disk / snapshot / image.
Screenshot 2026-05-11 at 4 50 20 PM
Screenshot 2026-05-11 at 4 50 13 PM

In the Disk sidemodal, the source cell is not a link, to prevent stacking of side modals. This follows the pattern on #3158. I also added a badge to the side modal to indicate whether the source is from an image or a snapshot. We can remove that if we feel like it's too noisy. I left it off on the main view, since you can click into it to get more details.
Screenshot 2026-05-13 at 11 30 29 AM

Note that this image detail side modal has a slightly different layout than the existing image detail side modal, and we might want to just use the existing one. I do think the existing one has more of a pseudo-form feel to it, which might be more appropriate in its current location as a drill-down on the images index list, which looks like this:
Screenshot 2026-05-13 at 4 51 49 PM

Closes #2057

@vercel

vercel Bot commented May 11, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
console Ready Ready Preview Jul 2, 2026 1:36am

Request Review

@charliepark charliepark marked this pull request as ready for review May 13, 2026 16:15
@david-crespo

Copy link
Copy Markdown
Collaborator

The test failures were the first hour of the month UTC bug fixed in #3274. No need to merge main, re-running should work.

@david-crespo

Copy link
Copy Markdown
Collaborator

I think you should consolidate the image side modals on the newer non-form version, like you said. I think we did the old one as a pseudo-form in anticipation of it becoming editable, and that's not really on the way.

@david-crespo

david-crespo commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Pushed some small fixes based on a Fable review. The only one that's more than a few lines is d63b3d1, which pulls out a shared DiskNameFromId and a couple of query objects that are used in a few spots.

I increased the gap here from 1 to 1.5:

image

I also added Image and Snapshot to the deleted badge. Fable's idea — I don't think I would have thought of it, but I like it.

image image

Comment thread test/e2e/disks.e2e.ts
const idCell = propertiesTableValue(modal, 'ID')
await expect(idCell.getByLabel('7f2309a5-13e3-47e0-8a4c-2a3b3bc992fd')).toBeVisible()
await expect(idCell.getByRole('button', { name: 'Click to copy' })).toBeVisible()
})

@david-crespo david-crespo Jul 1, 2026

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.

Something like this had been deleted below (I think rightly, because whatever it is no longer has an ID in the same spot). The robot noticed it was the only place in the e2es where we were exercising this aspect of how IdRow works, so it wanted to add an assert about it back somewhere else where it would still work.

@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.

Looks great!

Something for us to mull over: the instance cells here go to the instance page, but the source cells open a side modal. It's not a big deal, but it would be interesting if there was some way to indicate visually what to expect when you click. Maybe a link vs. button distinction, but it's hard to see how to do that here, plus buttons can open pages too.

Image

const deleteDisk = useApiMutation(api.diskDelete)
// no invalidation needed: the deleted snapshot is the transient one created
// by this flow, so nothing can be displaying it
const deleteSnapshot = useApiMutation(api.snapshotDelete)

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.

There were some invalidations added here that were probably harmless but I'd rather avoid them because they give the impression of being necessary. On the other hand I'm always wondering #3083 whether we should be more aggressive about invalidations. But I don't think we tend to have issues.

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.

Disk: Display the image or snapshot name from which it is created

2 participants