feat(sidebar): wire tag rename + delete actions - #238
Merged
Conversation
Phase 5.2 (ref .claude/plans/tech-debt-remediation.md § 5.2). - TagRenameDialog: controlled shadcn Dialog with prefilled input, loading state on submit, calls tagsService.renameTag + success/error toasts. - TagDeleteDialog: AlertDialog with confirmation copy explaining notes are untagged (not deleted), calls tagsService.deleteTag + toasts. - Wires both into TagOverflowMenu in tag-detail-view.tsx, replacing the three TODOs. - Subscribes to onTagRenamed / onTagDeleted so cached detail views invalidate after mutations. - Uses the existing extractErrorMessage + sonner toast pattern already in the file. - Tests: tag-detail-view.test.tsx (vitest + RTL) covers the menu wiring + dialog callbacks; tags-rename-delete.e2e.ts drives the full flow through Electron.
h4yfans
added a commit
that referenced
this pull request
Apr 17, 2026
…g selectors Three compounding bugs kept this suite red since it was added in #238: 1. createNote() never emitted notes:tags-changed, so the sidebar tag tree (subscribed via useNoteTagsQuery) didn't refetch when a tagged note was created via API. Mirrors the existing emission in updateNote(). 2. The test selector aside button:has-text(...) targeted an <aside> element that doesn't exist; the main sidebar is a <div>. Replaced with getByRole('button', { name: tag, exact: true }). 3. The Tags sidebar section is defaultExpanded={false}, so even with the tag rendered it wasn't visible. Added expandTagsSection() helper that toggles via aria-label="Tags section, collapsed".
3 tasks
h4yfans
added a commit
that referenced
this pull request
May 6, 2026
Phase 5.2 (ref .claude/plans/tech-debt-remediation.md § 5.2). - TagRenameDialog: controlled shadcn Dialog with prefilled input, loading state on submit, calls tagsService.renameTag + success/error toasts. - TagDeleteDialog: AlertDialog with confirmation copy explaining notes are untagged (not deleted), calls tagsService.deleteTag + toasts. - Wires both into TagOverflowMenu in tag-detail-view.tsx, replacing the three TODOs. - Subscribes to onTagRenamed / onTagDeleted so cached detail views invalidate after mutations. - Uses the existing extractErrorMessage + sonner toast pattern already in the file. - Tests: tag-detail-view.test.tsx (vitest + RTL) covers the menu wiring + dialog callbacks; tags-rename-delete.e2e.ts drives the full flow through Electron.
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
Part of Phase 5 (UI stubs + polish) in the tech-debt-remediation plan — see
.claude/plans/tech-debt-remediation.md § 5.2.Closes three TODOs in
apps/desktop/src/renderer/src/components/sidebar/tag-detail-view.tsx(lines 319, 324, 348).New components
tag-rename-dialog.tsx— controlled shadcnDialogwith prefilled input, submit-locked while in-flight, callstagsService.renameTag({ oldName, newName }).tag-delete-dialog.tsx— shadcnAlertDialogwith confirmation copy clarifying that notes are untagged, not deleted. CallstagsService.deleteTag(tag).Wiring changes
TagOverflowMenunow opens each dialog on its respective menu item.toast.success/toast.errorusing the existingextractErrorMessagehelper.onTagRenamedandonTagDeletedevents so the detail view re-fetches after a mutation.Tests
tag-detail-view.test.tsx(vitest + RTL): mockstagsService, asserts menu entries open the correct dialog, dialogs call the right service method with correct args, and toasts fire on both paths.tests/e2e/tags-rename-delete.e2e.ts(Playwright): seeds a note with a tag, drives the rename + delete flow through the real Electron UI, asserts sidebar state after each mutation.Test plan
pnpm exec tsc -p tsconfig.web.json --noEmitclean in the worktreepnpm test --filter @memry/desktopgreen on tag-detail-view testspnpm test:e2e --grep tags-rename-deletegreen against a built bundle