Feat/delete - #18
Merged
Merged
Feat/delete#18
Conversation
Closes the published-API gap: openapi.yaml documented DELETE /v1/note
but no handler existed, and vault.Writer.DeleteNote had zero callers.
- queue.RemoveNote: one transaction purges FTS + chunks + entities for
a path; retry semantics match DeleteFromIndex; idempotent
- DELETE /v1/note?path=...: sentinel-error classification (path-safety
violations are 400 via vault.ErrVaultPath* sentinels, missing files
404 via os.ErrNotExist chain - never substring matching on paths);
index purge + stats recompute follow the trash move; delete stands
even if purge fails (reindex reconciles)
- DeleteNote now returns the timestamped trash-relative destination
- kl delete <path-or-id>: resolves 36-char UUIDs to note paths via
GET /v1/queue/{id}, y/N confirm (--yes skips), themed output
- PWA: two-step inline confirm in NoteView header (trash icon ->
'move to trash?' -> delete/cancel); deleted notes vanish from the
open results list immediately via deletedPaths prop; destructive
toast on failure keeps the sheet open
Tests: TestRemoveNote (purge+search+idempotent), 4 handler cases,
4 PWA component tests. Full suites green.
khayal vault parent command with four subcommands, dry-run by default: - health: notes / indexed % / orphaned media / broken wikilinks with needs-attention verdict and remediation hints; backed by a new queue.GetReferencedMedia (distinct jobs.source_file) - fix-links: scans [[wikilinks]] against inbox note names; --fix strips the broken links from the files in place - clean-media: unreferenced media files listed with sizes; --fix moves them to .khayal-trash/ with collision-safe timestamps - show-duplicates: word-overlap similarity pairs (--threshold, --min-shared flags), highest similarity first Helpers shared via vault.go (listInboxNotes excludes trash + non-md, extractWikilinks, wordSimilarity, formatSize) with table tests. Live-verified all four against the test vault; delete flow verified end-to-end (capture -> search -> DELETE -> gone from search, file in .khayal-trash/, correct trash_path). Docs synced (VAULT.md delete contract, REPO_STRUCTURE new files).
kl delete added to the kl command list; DELETE /v1/note documented in API REFERENCE with example + error codes; PWA two-step delete affordance specified in UI_SPEC.
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.
No description provided.