Repository navigation
feat(container-indicator): add delete entry with confirmation - #555
Conversation
Stopped containers and virtual machines now show a delete button beside the start action. Clicking it asks for confirmation before running the CLI delete, so a stopped entry can be removed directly from the panel.
|
@xcv58 PTAL |
|
Thanks, @AndrewDi. I reproduced two cases with a fake CLI that I’d like us to address before merging.
Could you add regression tests that verify both state changes cancel deletion? |
…chine deletion Address review feedback: the confirmation dialog can stay open while the daemon changes underneath it. Deleting now re-reads the list first and only deletes when the container is still the same stopped incarnation, so a container that started, disappeared, or was replaced by one reusing the same ID cancels instead of deleting the wrong object. Container delete (without --force) also refuses running containers at execution. The machine delete action is deferred because 'container machine delete' unconditionally stops then deletes, so it cannot enforce the stopped condition the confirmation promises. Regression tests cover both state changes that cancel deletion.
|
Thanks for the careful review. Both cases are now addressed:
Regression tests were added for both state changes ( Note: full |
|
@AndrewDi I opened a follow-up PR against your branch. It uses a fresh inspection before Delete, keeps the row controls in sync with the container’s state, and preserves timeout feedback until a refresh can resolve it. The 22 focused tests passed with a fake CLI. Native confirmation and screenshots are still pending. Once the follow-up is merged into your branch, #555 will update automatically. |
|
Integrated @xcv58's follow-up (commit Validated locally:
The full |
|
@xcv58 PTAL |
Summary
Adds a delete action for stopped containers in the ContainerIndicator plugin.
When a container is stopped, a trash button appears to the left of the start button. Clicking it presents a confirmation dialog naming the entry; confirming runs
container delete <id>(without--force, which refuses running containers).The delete is guarded so a stale confirmation can never remove the wrong object:
Scope: machine deletion is deferred
container machine deleteunconditionally stops then deletes (try? await client.stop(id:)→delete), so it cannot enforce the "still stopped" condition the confirmation promises. Per review, the VM delete action is deferred until the CLI offers a conditional delete; machines keep only their existing lifecycle controls.Changes
ContainerIndicatorController:deleteContainerIfStopped(id:createdAt:)re-reads the list and deletes only when the entry is still the same stopped container.ContainerIndicatorWidgetViews: pending-deletion state + confirmation alert; trash button in the stopped container branch, left of start. Machine rows pass no delete action.panel.action.delete,panel.action.cancel,panel.delete.title,panel.delete.message,panel.error.deleteStateChanged(12 languages).changes/unreleased/.Verification
make build-plugin PLUGIN=ContainerIndicator✓make validate-localization✓make validate-changelog✓make testneeds a Rust 1.97.1 toolchain for the VoiceControlPlugin Cua SDK, unavailable in this environment)