Skip to content

Add delete functionality to 3 dots menu, distinguish container resour… - #735

Open
SharonStrats wants to merge 3 commits into
stagingfrom
feat/3-dots-menu
Open

Add delete functionality to 3 dots menu, distinguish container resour…#735
SharonStrats wants to merge 3 commits into
stagingfrom
feat/3-dots-menu

Conversation

@SharonStrats

Copy link
Copy Markdown
Contributor

3 dots.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 mint index.ttl#this so 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

  • fileExplorerContext can be undefined (context not provided), but it’s dereferenced directly in handleShare. 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.

Comment thread src/outline/manager.js
Comment thread src/components/resource-actions-menu/ResourceActionsMenu.ts Outdated
Comment thread src/components/file-explorer-header/FileExplorerProvider.ts Outdated
Comment thread src/components/file-explorer-header/FileExplorerProvider.ts Outdated
Comment thread test/unit/components/file-explorer-provider.test.ts Outdated
…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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 delete fileExplorerContext.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

  • openPaneInPlace only updates an existing td.paneView whose about matches 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. Use GotoSubject to 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: resourceNode still 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, but package-lock.json:3 and package-lock.json:9 still identify the root package as 4.4.2-7. Regenerate or update the lockfile so release metadata remains synchronized.
  "version": "4.4.2-8",

…@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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

2 participants