Seed new notepad tabs with their name as a heading and focus under it, show Learning switch on/off as working right away, and stop the Tauri window from taking file drops

AI Assisted
This commit is contained in:
jparkerweb committed 2026-11-14 10:42:23 -08:00
1 parent bb5bd5986d
commit 1516b25ea3
10 files changed
+75 -7

No files matched your search

+8 -1
View File
@@ -226,7 +226,14 @@ export function makeCodeMirrorEditor(parent, { onChange, label }) {
readOnly = Boolean(on);
view.dispatch({ effects: access.reconfigure(accessOf(readOnly)) });
},
focus: () => view.focus(),
// `at`, when given, is the caret's offset in the text.
focus(at) {
if (Number.isInteger(at)) {
const pos = Math.min(Math.max(at, 0), view.state.doc.length);
view.dispatch({ selection: { anchor: pos }, scrollIntoView: true });
}
view.focus();
},
destroy() {
view.destroy();
host.remove();