Add an opt-in context menu for files and directories

Apps set browser.contextMenu to a list of { label, action, when?, danger? }
items; when(entry, path) scopes an item to directories, files, or any
other match. Right-click, the Menu key, or a touch long press opens it.
The demo adds sample items, including a .json-only one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-23 18:50:21 -07:00
co-authored by Claude Opus 5.5
parent 13e2654415
commit d8b8012e40
12 changed files with 292 additions and 18 deletions
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
:root{color:#181c21;font-synthesis:none;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,system-ui,sans-serif}body{min-width:280px;margin:0}main{max-width:1220px;margin:0 auto;padding:20px}@media (width<=640px){main{padding:8px}}
:root{color:#181c21;font-synthesis:none;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,system-ui,sans-serif}body{min-width:280px;margin:0}main{max-width:1220px;margin:0 auto;padding:20px}@media (width<=640px){main{padding:8px}}.demo-status{color:#57606a;min-height:20px;margin:8px 2px 0;font-size:13px}
File diff suppressed because one or more lines are too long
+3 -2
View File
@@ -6,12 +6,13 @@
<meta name="color-scheme" content="light">
<meta name="theme-color" content="#ffffff">
<title>octopus-file-browser</title>
<script type="module" crossorigin src="/assets/index-CRttpLjx.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-rQJBLWWV.css">
<script type="module" crossorigin src="/assets/index-BJSID0yX.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Bx92WdqS.css">
</head>
<body>
<main>
<octopus-file-browser></octopus-file-browser>
<p class="demo-status" role="status">Right-click or long-press a file or folder.</p>
</main>
</body>
</html>