Open
Conversation
Replace hard-delete with soft-archive. Add archived boolean field to Recipe model, archiveById and unarchiveById resolvers, and remove recipeRemoveById from the public GraphQL schema. Archive uses the same validateItemNotInRecipe check as delete. Include migration script for existing documents.
- Replace DELETE_RECIPE mutation with ARCHIVE_RECIPE and UNARCHIVE_RECIPE - Add archived field to GraphQL queries and fragment - Add archive toggle switch to SearchBar for viewing archived recipes - Replace ConfirmDeleteModal with ConfirmArchiveModal (orange theme) - Update ModifyButtons to show archive/unarchive based on recipe state - Add client-side filter (archived: false) to all recipe list queries - Update search filter logic to support showArchived toggle - Add ArchiveIcon and UnarchiveIcon components - Update all test mocks and rename delete tests to archive tests
Replace the old recipeRemoveById test suite with comprehensive tests for the new archive/unarchive functionality: - archiveById sets archived flag and preserves the recipe - archiveById blocked when recipe is used as ingredient in another recipe - unarchiveById clears archived flag - recipeMany respects archived filter (true/false) - recipeCount respects archived filter - recipeRemoveById mutation no longer in schema Remove unused fs, sinon, and Image imports.
Search input, tag filters, and ingredient filters now remain visible when showArchived is toggled on, allowing users to search/filter within archived recipes. Toggling showArchived in either direction resets all active filters to prevent stale search state. Replaced Chakra UI Switch/FormControl with Mantine Switch and Tooltip for the archive toggle.
Fix line length formatting in API schema and tests. Replace custom ArchiveIcon/UnarchiveIcon SVGs with GoArchive and RiInboxUnarchiveLine from react-icons library.
- Use Mantine theme color 'teal' instead of raw hex for Switch - Add consistent size='18px' to GoArchive icon - Remove dead ArchiveIcon/UnarchiveIcon custom SVGs and path alias - Use resetSearch() in setShowArchived to eliminate duplication
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
Replaces hard-delete with soft-archive across the full stack, allowing users to archive and unarchive recipes instead of permanently deleting them.
API Changes
archived: booleanfield (defaultfalse) to the Recipe modelrecipeArchiveByIdandrecipeUnarchiveByIdGraphQL mutations (archive is blocked if recipe is used as ingredient in another recipe)recipeRemoveByIdmutation from the schemaupdateSchema_2026-03-30.js) to setarchived: falseon existing documentsClient Changes
archivedfield to recipe queries andarchived: falsedefault filterArchiveIconandUnarchiveIconSVG componentsshowArchivedstateuseSearchhook (showArchivedRef, inline filter computation)Tests
Test Plan