Feat v0.4.5 editor modes + document outline
All checks were successful
CI/CD / detect-changes (pull_request) Successful in 3s
CI/CD / test-frontend (pull_request) Successful in 5s
CI/CD / test-go-pg (pull_request) Successful in 2m37s
CI/CD / test-sqlite (pull_request) Successful in 2m45s
CI/CD / build-and-deploy (pull_request) Successful in 1m32s

Tri-state viewMode (rendered/edit/split) replaces binary preview toggle.
Split view uses CSS grid with synced scroll. Document outline panel parses
headings and supports click-to-scroll in both CM6 and preview. Mode
preference persisted to localStorage. Notes package bumped to v0.6.0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-29 20:40:22 +00:00
parent cee65c4136
commit db9d630399
7 changed files with 248 additions and 24 deletions

View File

@@ -257,6 +257,14 @@
border-color: var(--accent);
}
/* ── Editor Content (body + outline wrapper) */
.notes-editor__content {
flex: 1;
display: flex;
min-height: 0;
overflow: hidden;
}
/* ── Editor Body ─────────────────────────── */
.notes-editor__body {
flex: 1;
@@ -264,6 +272,13 @@
min-height: 0;
overflow: hidden;
}
.notes-editor__body--split {
display: grid;
grid-template-columns: 1fr 1fr;
}
.notes-editor__body--split .notes-preview {
border-left: 1px solid var(--border);
}
.notes-editor__textarea {
flex: 1;
resize: none;
@@ -617,9 +632,64 @@
font-size: 11px;
}
/* ── Document Outline ─────────────────────── */
.doc-outline {
width: 200px;
min-width: 160px;
border-left: 1px solid var(--border);
background: var(--bg-raised);
overflow-y: auto;
flex-shrink: 0;
}
.doc-outline__header {
font-size: 11px;
font-weight: 600;
color: var(--text-2);
text-transform: uppercase;
letter-spacing: 0.5px;
padding: 8px 10px;
display: flex;
align-items: center;
gap: 6px;
cursor: pointer;
user-select: none;
border-bottom: 1px solid var(--border);
}
.doc-outline__toggle {
font-size: 9px;
color: var(--text-2);
}
.doc-outline__count {
background: var(--bg-hover);
color: var(--text-2);
font-size: 10px;
padding: 0 6px;
border-radius: 8px;
line-height: 16px;
}
.doc-outline__item {
padding: 4px 10px;
font-size: 12px;
color: var(--text-2);
cursor: pointer;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
transition: var(--transition);
}
.doc-outline__item:hover {
background: var(--bg-hover);
color: var(--text);
}
.doc-outline__item--h1 { font-weight: 600; color: var(--text); }
.doc-outline__item--h2 { font-weight: 500; }
/* ── Responsive ──────────────────────────── */
@media (max-width: 700px) {
.notes-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 40vh; }
.notes-app { flex-direction: column; }
.folder-tree { max-height: 30vh; }
.notes-editor__body--split { grid-template-columns: 1fr; }
.notes-editor__body--split .notes-preview { display: none; }
.doc-outline { display: none; }
}