Add delete functionality to 3 dots menu, distinguish container resour… - #735
Add delete functionality to 3 dots menu, distinguish container resour…#735SharonStrats wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands the file explorer “3 dots” actions menu to support deleting resources/containers (with a confirmation dialog), and adds logic to better handle container resources represented by index.ttl#this, including deriving the correct delete target and refreshing/navigation behavior after deletion.
Changes:
- Add delete flow to the resource actions menu, backed by
solidLogicSingleton.resource.deleteResourceAndTypeIndexIfExists. - Derive
deleteTargetUri/ refresh navigation targets for panes that mintindex.ttl#thisso deletes operate on the container root. - Improve delete confirmation dialog content (container vs resource) and adjust file explorer header controls to show container-specific actions (e.g., Share).
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/components/resource-actions-menu.test.ts | Adds unit coverage for deleting container roots via the actions menu. |
| test/unit/components/file-explorer-provider.test.ts | Adds tests for deriving delete/refresh target URIs when subject is index.ttl#this. |
| test/unit/components/delete-resource-dialog.test.ts | Adds coverage for the dialog’s generic prompt behavior when no node value is present. |
| src/outline/manager.js | Wires a refresh callback into the provider to reopen the appropriate folder after deletion. |
| src/components/resource-actions-menu/ResourceActionsMenu.ts | Implements delete + (optional) share menu items and hooks into file-explorer context callbacks. |
| src/components/resource-actions-menu/DeleteResourceDialog.ts | Enhances dialog to display container-specific messaging and uses styles. |
| src/components/resource-actions-menu/DeleteResourceDialog.styles.css | Adds dialog action layout + emphasis styling. |
| src/components/file-explorer-header/types.ts | Extracts FileExplorerResourceMetadata type into a shared types module. |
| src/components/file-explorer-header/helper.ts | Adds helpers to derive delete targets and refresh navigation targets. |
| src/components/file-explorer-header/FileExplorerProvider.ts | Extends file-explorer context with refresh and deleteTargetUri, and adds container detection state. |
| src/components/file-explorer-header/FileExplorerHeaderSummary.ts | Updates FileExplorerResourceMetadata import to the new types module. |
| src/components/file-explorer-header/FileExplorerHeaderControls.ts | Adds container-aware rendering and passes delete/share-related props to the actions menu. |
| src/components/file-explorer-header/FileExplorerHeader.ts | Plumbs isContainerResource through to header controls. |
Suppressed comments (1)
src/components/resource-actions-menu/ResourceActionsMenu.ts:82
fileExplorerContextcan be undefined (context not provided), but it’s dereferenced directly inhandleShare. Optional-chain the context itself to avoid runtime errors.
private handleShare = (event: Event) => {
event.preventDefault()
this.fileExplorerContext.handleSharingClick?.()
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ce 3 dots Note: tests were ai generated based on specific prompts Co-authored-by: GPT-5.4 Mini <gpt-5.4-mini@openai.com>
1e754cf to
25d21b9
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 15 changed files in this pull request and generated no new comments.
Suppressed comments (4)
src/components/file-explorer-header/FileExplorerHeader.ts:70
- The delete permission is fetched for
subjectUri, but container panes deletefileExplorerContext.deleteTargetUri(for example,/workspace/instead of/workspace/index.ttl#this). This can enable deletion using the index document's permission or disable a deletable container. Key the metadata load by the effective delete target as well, so switching panes for the same subject refreshes the correct authorization.
const subjectUri = this.fileExplorerContext.subjectUri
const defaultMetadata = this.getDefaultResponseMetadata()
try {
const metadata = await solidLogicSingleton.resource.fetchMetadataWithDelete(sym(subjectUri))
src/outline/manager.js:475
openPaneInPlaceonly updates an existingtd.paneViewwhoseaboutmatches the target. After deleting the current resource, the parent usually has no such pane, so this returns without navigating and leaves the deleted view on screen. UseGotoSubjectto create a parent-folder view instead.
if (!refreshTargetUri) return
openPaneInPlace(kb.sym(refreshTargetUri), paneRegistry.byName('folder'))
src/components/resource-actions-menu/ResourceActionsMenu.ts:46
- This catch does not produce the claimed generic prompt:
resourceNodestill has its URI, so the dialog can label/classify it from cached data and report a stale or incomplete member count after the load failed. That is misleading immediately before recursive deletion. Pass an explicit load-success state (or no resource node) to the dialog and omit container details when the representation could not be loaded.
try {
await store.fetcher.load(resourceNode.doc())
} catch (_error) {
// Best-effort load: if it fails we still show the generic delete prompt.
}
package.json:3
- The package version is now
4.4.2-8, butpackage-lock.json:3andpackage-lock.json:9still identify the root package as4.4.2-7. Regenerate or update the lockfile so release metadata remains synchronized.
"version": "4.4.2-8",
d126d2f to
06522a4
Compare
6734c85 to
9770249
Compare
…@3.1.3-17 pane-registry@3.1.2-2 activitystreams-pane@1.0.3-4 chat-pane@3.0.4-3 contacts-pane@3.2.1-6 folder-pane@3.1.1-3 issue-pane@3.0.3-1 meeting-pane@3.0.3-1 profile-pane@3.2.3-4 source-pane@3.1.1-7) (latest: rdflib@2.4.0)
3 dots.