Skip to content

Add context menu with Delete option to file tree entries#4069

Open
lukemelia wants to merge 2 commits intomainfrom
cs-10078-file-tree-context-menu
Open

Add context menu with Delete option to file tree entries#4069
lukemelia wants to merge 2 commits intomainfrom
cs-10078-file-tree-context-menu

Conversation

@lukemelia
Copy link
Contributor

@lukemelia lukemelia commented Feb 26, 2026

Summary

  • Adds a "..." context menu to each file row in the code submode file tree (CS-10078)
  • Menu is triggered by hovering/clicking the three-dot ContextButton or right-clicking the file row
  • First menu item is Delete, which opens the existing delete confirmation modal
  • Context menu is only shown when the user has write access to the realm (read-only realms are unaffected)

Changes

  • directory.gts: Wraps each file in a .file-row div; adds BoxelDropdown with hidden ContextButton trigger and "Delete" Menu item; right-click (contextmenu) programmatically opens the dropdown via a Map<LocalPath, BoxelDropdownAPI>
  • file-tree.gts: Threads new onDeleteFile prop through to Directory
  • code-submode.gts: Adds canWriteToRealm getter and deleteFileInTree action; conditionally passes @onDeleteFile to FileTree
  • file-tree-test.ts: 4 new acceptance tests

Test plan

  • can delete a file from file tree context menu — full delete flow via "..." button
  • can cancel delete from file tree context menu — cancel flow preserves file
  • can delete a file via right-click in file tree — contextmenu event triggers dropdown
  • file tree does not show context menu in read-only realm — no trigger shown for read-only realms
  • All 22 file-tree tests pass (0 failures)

🤖 Generated with Claude Code

image

Adds a "..." context menu (via BoxelDropdown) to each file row in the
code submode file tree. The menu is triggered by hovering/clicking the
three-dot button or right-clicking (contextmenu event). The first menu
item is Delete, which opens the existing delete confirmation modal.

The context menu is only shown when the user has write access to the
realm. Test coverage added for all cases: delete flow, cancel flow,
right-click trigger, and read-only realm suppression.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lukemelia lukemelia marked this pull request as draft February 26, 2026 00:30
@github-actions
Copy link

Preview deployments

@github-actions
Copy link

github-actions bot commented Feb 26, 2026

Host Test Results

    1 files  ±    0      1 suites  ±0   4h 35m 38s ⏱️ + 3h 1m 48s
1 883 tests +    4  1 840 ✅  -    24  15 💤 ± 0   0 ❌ ± 0  28 🔥 +28 
3 796 runs  +1 902  3 710 ✅ +1 831  30 💤 +15  28 ❌ +28  28 🔥 +28 

For more details on these errors, see this check.

Results for commit 9faf8b2. ± Comparison against base commit 61ceac3.

♻️ This comment has been updated with latest results.

@lukemelia lukemelia requested review from a team, backspace and jurgenwerk February 26, 2026 04:11
@lukemelia lukemelia marked this pull request as ready for review February 26, 2026 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant