feat(backend): add delete-file action node#25
Open
LukasHirt wants to merge 2 commits into
Open
Conversation
Adds a `delete` action type that issues a WebDAV DELETE against the current resource path — the natural terminal step for cleanup workflows (e.g. removing files older than N days). Mirrors move/copy's existing shape: FileClient gains a Delete method, webdavfile.Client implements it against the same DAV endpoint used by copyOrMove, and runAction's new "delete" case sets result.Output to the deleted path and resets currentPath to "" so any subsequent file-needing action fails with the same "no target file" error tag/comment/move/copy already produce. Note: oCIS's WebDAV DELETE typically moves the resource to the space's trash rather than hard-deleting it (platform behavior). Covered by a new executor test asserting Delete is called with the right path, result.Output is set, and a chained action after delete fails because currentPath is now empty. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Lukas Hirt <info@hirt.cz>
Registers a new "Delete File" entry under the Actions picker category (actionType: 'delete', icon: delete-bin). Like tag/comment, it's a no-config action — it operates implicitly on the current file, so it needs no destination/newName param the way move/copy/rename do. NodeDetailsPanel already renders a no-config action correctly with no extra changes needed: none of its actionType branches match 'delete', so only the generic "Run only if" condition field shows. Adds Vitest coverage: nodeTypes.spec.ts asserts the action-delete entry exists under ACTION_CATEGORY and is discoverable via findNodeTypeForNode; NodeDetailsPanel.spec.ts and ActionNode.spec.ts add the first component-mount tests in this package, asserting the delete action renders its label/icon with zero action-specific fields (contrasted against tag's one field and move's destination field). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Lukas Hirt <info@hirt.cz>
LukasHirt
force-pushed
the
feat/action-delete-file
branch
from
July 24, 2026 20:54
71bbc01 to
d89c340
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new "Delete File" action node, end to end. Move/copy/rename already exist as file-operation actions; delete was the one basic operation conspicuously missing — the natural terminal step for cleanup workflows like "if a temp file is older than N days, delete it."
deleteaction type issues a WebDAVDELETEagainst the current resource path.webdavfile.Client.Delete(mirrorscopyOrMove's auth-header handling, minus theDestinationheader).FileClientinterface inexecutor.gogainsDelete.runAction's newcase "delete"setsresult.Outputto the deleted path and resetscurrentPathto"", so any later file-needing action in the same chain fails with the existing "no target file" error shape (same patterntag/comment/move/copyalready use).DELETEtypically moves the resource to the space's trash rather than hard-deleting it — platform behavior, not something this action implements or overclaims.action-deleteentry inNODE_TYPESunderACTION_CATEGORY(icondelete-bin),'delete'added to theActionTypeunion. It's a no-config action liketag/comment(no destination/newName param) —NodeDetailsPanel.vueneeded no changes since none of itsactionTypebranches matchdelete, so only the generic "Run only if" condition field renders.Test plan
TestRunDeleteActioninbackend/pkg/executor/executor_test.go— assertsDeleteis called with the correct path,result.Outputis the deleted path, and a chainedtagaction afterdeletefails becausecurrentPathis now empty. Written first, confirmed it failed for the right reason (missingDeletecall), then implemented.cd backend && go build ./... && go vet ./... && go test ./...— all pass.tests/unit/nodeTypes.spec.ts(new) — assertsaction-deleteexists underACTION_CATEGORYand is discoverable viafindNodeTypeForNode.tests/unit/NodeDetailsPanel.spec.tsandtests/unit/ActionNode.spec.ts(new, first component-mount tests in this package) — assert the delete action renders its label/icon with zero action-specific fields, contrasted againsttag(one field) andmove(destination field).cd frontend && npm run test:unit— 5 files / 11 tests pass.cd frontend && npm run check:types— clean.cd frontend && npm run lint— clean.🤖 Generated with Claude Code