Listing JSON gains a writable bool per file row, computed by running the policy decider with ActionWrite against the parent-dir chain (with the same admin-bypass branch the file API uses). Cost: one extra decider call per file in the listing, sharing the parent chain so the cascade walk is amortized. Browse loader stores writable on every tree node. The markdown and YAML editors read it and gate their canSave + initial mount: - !writable markdown → Toast UI Viewer (rendered, no edit toolbar, no caret). Banner above explains why save is disabled. - !writable YAML → CodeMirror readOnly:'nocursor' (selection for copy, no caret). Banner above explains why save is disabled. Both editors gain autofocus:false so keyboard nav in the browse tree doesn't divert into the editor — arrow keys keep moving through files and folders without the caret jumping. User clicks (or tabs) into the editor when they actually want to type. .zddc files already route through preview-yaml's isZddcFile path; bare .zddc (no ext) matches because that function checks the literal name. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
58 lines
1.4 KiB
CSS
58 lines
1.4 KiB
CSS
/* browse-specific layout on top of shared/base.css */
|
|
|
|
html, body {
|
|
height: 100%;
|
|
margin: 0;
|
|
padding: 0;
|
|
background: var(--bg);
|
|
color: var(--text);
|
|
font-family: var(--font);
|
|
}
|
|
|
|
body {
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
#appMain {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-height: 0;
|
|
}
|
|
|
|
/* .empty-state / .empty-state__inner live in shared/base.css. */
|
|
|
|
/* .hidden lives in shared/base.css; no per-tool override needed. */
|
|
|
|
/* Status bar — shows transient errors/info */
|
|
.status-bar {
|
|
padding: 0.4rem 1rem;
|
|
background: var(--bg-secondary);
|
|
border-top: 1px solid var(--border);
|
|
font-size: 0.85rem;
|
|
color: var(--text-muted);
|
|
min-height: 1.6rem;
|
|
line-height: 1.6rem;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.status-bar--error { color: #b00020; }
|
|
.status-bar--info { color: var(--primary); }
|
|
|
|
/* Read-only banners — surfaced by preview-markdown.js / preview-yaml.js
|
|
when the listing's `writable` bit was false. Inline at the top of
|
|
the editor host so the user can't miss it; muted styling so it
|
|
doesn't fight the editor chrome. */
|
|
.md-readonly-banner,
|
|
.yaml-readonly-banner {
|
|
background: rgba(220, 53, 69, 0.10);
|
|
color: var(--text);
|
|
border-bottom: 1px solid rgba(220, 53, 69, 0.35);
|
|
padding: 0.4rem 0.7rem;
|
|
font-size: 0.85rem;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.4rem;
|
|
}
|