-
Notifications
You must be signed in to change notification settings - Fork 11
Bugfix/issue 39/deleting folder doesnt delete items inside #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4ba1d63
f8a3f39
1001482
8338a3d
a2861ca
fcf4ce7
858992a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,7 @@ interface WorkspaceGridProps { | |
| onMoveItem?: (itemId: string, folderId: string | null) => void; // Callback to move item to folder | ||
| onMoveItems?: (itemIds: string[], folderId: string | null) => void; // Callback to move multiple items to folder (bulk move) | ||
| onOpenFolder?: (folderId: string) => void; // Callback when folder is clicked | ||
| onDeleteFolderWithContents?: (folderId: string) => void; // Callback to delete folder and all items inside | ||
| addItem?: (type: CardType, name?: string, initialData?: Partial<Item['data']>) => string | void; // Function to add new items | ||
| onPDFUpload?: (files: File[]) => Promise<void>; // Function to handle PDF upload | ||
| setOpenModalItemId?: (id: string | null) => void; // Function to open modal for newly created items | ||
|
|
@@ -59,6 +60,7 @@ export function WorkspaceGrid({ | |
| onMoveItem, | ||
| onMoveItems, | ||
| onOpenFolder, | ||
| onDeleteFolderWithContents, | ||
| addItem, | ||
| onPDFUpload, | ||
| setOpenModalItemId, | ||
|
|
@@ -531,6 +533,7 @@ export function WorkspaceGrid({ | |
| onOpenFolder={handleOpenFolder} | ||
| onUpdateItem={handleUpdateItem} | ||
| onDeleteItem={handleDeleteItem} | ||
| onDeleteFolderWithContents={onDeleteFolderWithContents} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing The 🔧 Suggested fix // eslint-disable-next-line react-hooks/exhaustive-deps
}, [
itemsKey, // Stable key based on item IDs/names/types - only changes when items actually change
handleUpdateItem,
handleDeleteItem,
handleOpenModal,
existingColors,
onMoveItem,
handleOpenFolder,
folderItemCounts,
workspaceName,
workspaceColor,
+ onDeleteFolderWithContents,
]);Also applies to: 569-580 🤖 Prompt for AI Agents
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The children useMemo now reads onDeleteFolderWithContents but the dependency array wasn’t updated. This can leave FolderCard with a stale delete handler if the prop changes. Add onDeleteFolderWithContents to the useMemo dependency list. Prompt for AI agents |
||
| onMoveItem={onMoveItem} | ||
| /> | ||
| ) : item.type === 'flashcard' ? ( | ||
|
|
@@ -570,6 +573,7 @@ export function WorkspaceGrid({ | |
| handleOpenModal, | ||
| existingColors, | ||
| onMoveItem, | ||
| onDeleteFolderWithContents, | ||
| handleOpenFolder, | ||
| folderItemCounts, | ||
| workspaceName, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.