ZDDC/browse/js
ZDDC 8aebb0c346 fix(browse): propagate writable bit into tree nodes
Root cause of "I'm root admin but the editor says read-only."

loader.js parses the listing JSON and stamps `writable` onto the raw
entry. tree.js:newNode() then copies every other field (name, url,
isDir, size, modTime, ext, handle, virtual …) into the tree node —
but dropped `writable`. So `node.writable` was always undefined and
`canSave(node)` short-circuited to false, mounting the YAML and
markdown editors read-only even for an elevated admin where the
server had correctly stamped writable=true.

Symptom: red banner / read-only mode regardless of admin status.
Server-side log line was correct (elevated=true active_admin=true
chain_admin_level=0); the bit just never reached the editor.

One-line fix: include `writable: !!raw.writable` alongside `virtual`
in the tree-node initialiser. Verified end-to-end against the live
bitnest fixture — every entry now carries the bit through.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 16:47:57 -05:00
..
accept-transmittal.js feat: reviewing/ lifecycle — Plan Review endpoint, virtual received window, browse context-menu workflows 2026-05-15 16:08:04 -05:00
app.js feat(browse): SPA overhaul — context menu, YAML editor, icons, hovercard, deep links, autofilter 2026-05-14 12:12:42 -05:00
create-transmittal.js feat: reviewing/ lifecycle — Plan Review endpoint, virtual received window, browse context-menu workflows 2026-05-15 16:08:04 -05:00
download.js refactor: virtual file extensions for subtree zip + MD conversion 2026-05-14 12:23:37 -05:00
events.js feat(browse): keyboard navigation in the file tree 2026-05-18 08:21:47 -05:00
grid.js feat(zddc): Phase 4b — grid mode driven by cascade default_tool 2026-05-11 16:15:25 -05:00
hovercard.js feat(browse): extension chip under tree icon + archive refs in hovercard 2026-05-18 08:18:01 -05:00
init.js feat(browse): SPA overhaul — context menu, YAML editor, icons, hovercard, deep links, autofilter 2026-05-14 12:12:42 -05:00
loader.js feat(browse): editors honor server-side write authority + don't steal focus 2026-05-18 09:42:36 -05:00
plan-review.js feat: reviewing/ lifecycle — Plan Review endpoint, virtual received window, browse context-menu workflows 2026-05-15 16:08:04 -05:00
preview-markdown.js fix(browse): trim markdown read-only banner + drop YAML front-matter placeholder 2026-05-18 09:47:21 -05:00
preview-yaml.js refactor(audit): pre-release cleanup pass 2026-05-18 16:28:07 -05:00
preview.js feat(browse): SPA overhaul — context menu, YAML editor, icons, hovercard, deep links, autofilter 2026-05-14 12:12:42 -05:00
stage.js feat: reviewing/ lifecycle — Plan Review endpoint, virtual received window, browse context-menu workflows 2026-05-15 16:08:04 -05:00
tree.js fix(browse): propagate writable bit into tree nodes 2026-05-18 16:47:57 -05:00
upload.js feat: reviewing/ lifecycle — Plan Review endpoint, virtual received window, browse context-menu workflows 2026-05-15 16:08:04 -05:00