Open a note that also links as its article with the note on top
Words carrying a note and a Wikipedia link (one note with a body and a target, as the bulk linking pass made by merging links onto glosses, or a note and a link on the same words) opened only the note: a click toggled the gloss inline in both views, Enter did the same in the column, and in panes Enter opened the note's pane with the article folded to its summary. Now Enter or a click opens one page: the note's text first, then the article in full (in the column the note is hoisted and h returns to its words; in panes it is the next pane). A note's target is its own or that of a link on exactly its words. Node and web targets show their card beneath the note the same way. Browser tests cover click and keyboard in both views and the same-span case; the old test only covered the folded panes path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014yB6q4BHMwptTX3YFtkRab
This commit is contained in:
1 parent
f86a06fa06
commit
02e044af35
11 files changed
+187
-57
No files matched your search
+6
-2
@@ -5,6 +5,7 @@ import { anchorLost, ancestors, descendants, docOf, isLibraryRoot, label, notesO
|
||||
import type { Ref } from "../core/ref";
|
||||
import { clip, overlaps, paragraphs, plain, type Form, type Range } from "../core/text";
|
||||
import { streamView } from "../core/marks";
|
||||
import { ownerSection } from "../core/links";
|
||||
import { ChoiceRows, LinkMark, LinkPreview, NodeBacklinks, NodeRelated, SuggestionCard, TargetRow, articleChoice, sectionChoice, useWikiSuggest, type Choice } from "./Links";
|
||||
import { store, type Pending } from "./store";
|
||||
|
||||
@@ -446,9 +447,12 @@ export function TopMatter({ id }: { id: NodeId }) {
|
||||
</nav>
|
||||
)}
|
||||
<header class={`top${focused ? " focused" : ""}${library ? " library" : ""}`} data-node={id}>
|
||||
<div data-row={id}>{editing ? <TitleEditor id={id} /> : <h1>{n.title || "Untitled"}</h1>}</div>
|
||||
<div data-row={id}>{editing ? <TitleEditor id={id} /> : <h1 class={n.kind === "note" ? "note-title" : undefined}>{n.title || (n.kind === "note" ? label(snap, id) : "Untitled")}</h1>}</div>
|
||||
<div class="byline">
|
||||
{library ? `${kids.length} document${kids.length === 1 ? "" : "s"}` : `${kids.length} section${kids.length === 1 ? "" : "s"}`} · {count} nodes · branch {store.repo.current}
|
||||
{n.kind === "note"
|
||||
? `a note in ${clip(label(snap, ownerSection(snap, id)), 40)}${n.by === "llm" ? ", written by the model" : ""}`
|
||||
: `${library ? `${kids.length} document${kids.length === 1 ? "" : "s"}` : `${kids.length} section${kids.length === 1 ? "" : "s"}`} · ${count} nodes`}{" "}
|
||||
· branch {store.repo.current}
|
||||
<Flags id={id} />
|
||||
</div>
|
||||
</header>
|
||||
|
||||
Reference in new issue
Block a user