Skip to content

Instance quick actions need feedback and confirmation (or remove them) #2276

@david-crespo

Description

@david-crespo

On instance detail, we put instance actions like stop/start/delete etc in the quick actions menu, but when I tried these I noticed several problems:

  • No toast feedback or query invalidate on success
  • Seemed not to work sometimes
  • No confirmation on destructive actions

I would guess roughly no one is using these anyway, so it could well be the most expedient fix is to remove them from the menu, and then we can put them back in later if we have time.

const actions = useMemo(
() => [
{
label: 'Copy ID',
onActivate() {
window.navigator.clipboard.writeText(instance.id || '')
},
},
...makeActions(instance),
],
[instance, makeActions]
)
const quickActions = useMemo(
() =>
actions
// in the quick menu we do not show disabled actions
.filter((a) => !a.disabled)
// append "instance" to labels
// TODO: if these were in an "Instance actions" subsection they might not
// need the suffix for clarity
.map((a) => ({ onSelect: a.onActivate, value: a.label })),
[actions]
)
useQuickActions(quickActions)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions