Build an outline from the Observe/Interpret/Apply and background notes
Build and Push Docker Image / build-and-push (push) Successful in 4m8s
Build and Push Docker Image / build-and-push (push) Successful in 4m8s
New "Build from my notes" on the Outline page: a main point per chunk with Background, What the text says, What it means and How we respond under it (a point per note line, long lines become a headline plus a note), with the chunk's cross-references and words attached. Also builds a single chunk's sections. Only adds what's missing; Undo offered. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f70f1baf15
commit
d2bbf1feb4
3 files changed
+128
-2
No files matched your search
@@ -14,7 +14,7 @@ import IqOutlineAttach from '../components/iq/IqOutlineAttach.jsx';
|
||||
import ShareOutlineSheet from '../components/ShareOutlineSheet.jsx';
|
||||
import { downloadOutlineDocx, downloadOutlineMarkdown, printOutline } from '../utils/outlineExport.js';
|
||||
import {
|
||||
KINDS, STUDY, addAfter, addChild, addRoot, chunkOf, countNodes, flatten, getNode, indent, insertAt, kindLabel, locate,
|
||||
KINDS, STUDY, buildChunkFromNotes, buildFromNotes, notesBuildCount, addAfter, addChild, addRoot, chunkOf, countNodes, flatten, getNode, indent, insertAt, kindLabel, locate,
|
||||
moveNode, newNode, outdent, outlineFor, outlineToText, removeNode, seedFromChunks, seedFromVerses, timeSummary, updateNode, withOutline,
|
||||
} from '../utils/outline.js';
|
||||
|
||||
@@ -73,6 +73,7 @@ export default function OutlinePage() {
|
||||
? seedFromChunks(project, tree).length - tree.length
|
||||
: seedFromVerses(project, scope, tree).length - tree.length;
|
||||
const seedLabel = scope === STUDY ? 'Add my chunks' : 'Add the verses';
|
||||
const fromNotes = notesBuildCount(project, scope, tree);
|
||||
|
||||
const addMain = () => { const node = newNode(); edit((t) => addRoot(t, node)); setPendingFocus(node.id); };
|
||||
const addSub = (id) => { const node = newNode(); edit((t) => addChild(t, id, node)); setPendingFocus(node.id); };
|
||||
@@ -81,6 +82,14 @@ export default function OutlinePage() {
|
||||
edit((t) => (scope === STUDY ? seedFromChunks(project, t) : seedFromVerses(project, scope, t)));
|
||||
toast(`Added ${addable} point${addable === 1 ? '' : 's'}`);
|
||||
};
|
||||
// Builds the outline from the Observe / Interpret / Apply and background notes, with an Undo.
|
||||
const buildFromMyNotes = () => {
|
||||
const before = tree;
|
||||
edit((t) => (scope === STUDY ? buildFromNotes(project, t) : buildChunkFromNotes(project, scope, t)));
|
||||
toast(`Built ${fromNotes} ${scope === STUDY ? `main point${fromNotes === 1 ? '' : 's'} from your chunk notes` : `section${fromNotes === 1 ? '' : 's'} from this chunk's notes`}. Your notes are copied into it, so they appear if you share the outline.`, {
|
||||
action: { label: 'Undo', onClick: () => edit(() => before) },
|
||||
});
|
||||
};
|
||||
const remove = (id) => {
|
||||
const where = locate(tree, id);
|
||||
const gone = getNode(tree, id);
|
||||
@@ -157,6 +166,10 @@ export default function OutlinePage() {
|
||||
title={scope === STUDY ? "Adds a main point for each chunk that isn't in the outline yet" : "Adds a point for each verse of this chunk, with its words"}>
|
||||
{seedLabel}{addable > 0 ? ` (${addable})` : ''}
|
||||
</button>
|
||||
<button type="button" onClick={buildFromMyNotes} disabled={fromNotes <= 0} className={btn}
|
||||
title="Turns your Observe, Interpret, Apply and background notes into points: a main point per chunk, or this chunk's sections">
|
||||
Build from my notes{fromNotes > 0 ? ` (${fromNotes})` : ''}
|
||||
</button>
|
||||
<span className="mx-1 hidden h-6 w-px bg-[var(--r-line)] sm:block" aria-hidden="true" />
|
||||
<button type="button" onClick={() => setShareOpen(true)} disabled={tree.length === 0} className={btn}>Share</button>
|
||||
<button type="button" onClick={print} disabled={tree.length === 0} className={btn}>Print / PDF</button>
|
||||
@@ -182,6 +195,7 @@ export default function OutlinePage() {
|
||||
<button type="button" onClick={seed} disabled={addable <= 0} className="rounded-xl bg-[var(--r-accent)] px-4 py-2 text-sm font-medium text-[var(--r-on)] hover:opacity-90 disabled:opacity-50">
|
||||
{scope === STUDY ? 'Start from my chunks' : 'Start from the verses'}
|
||||
</button>
|
||||
<button type="button" onClick={buildFromMyNotes} disabled={fromNotes <= 0} className={btn}>Build from my notes{fromNotes > 0 ? ` (${fromNotes})` : ''}</button>
|
||||
<button type="button" onClick={addMain} className={btn}>Start blank</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user