Select text in the book to highlight it
Markdown supported — rich-text paste converts to markdown
0\" :style=\"noteOverLimit(newNoteText) ? 'color: #f87171;' : 'color: var(--text-secondary);'\" x-text=\"noteCountLabel(newNoteText)\">
No bookmarks yet
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "Select text in the book to highlight it
Markdown supported — rich-text paste converts to markdown
0\" :style=\"noteOverLimit(newNoteText) ? 'color: #f87171;' : 'color: var(--text-secondary);'\" x-text=\"noteCountLabel(newNoteText)\">
No bookmarks yet
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/web/src/annotations-banner.ts b/web/src/annotations-banner.ts
index 724cfd83..f6880781 100644
--- a/web/src/annotations-banner.ts
+++ b/web/src/annotations-banner.ts
@@ -25,6 +25,9 @@ interface AnnotationRow {
loc: string;
/** row accent color (swatch) */
color: string;
+ /** highlight rows: whether a note rides on the highlight (Edit-note vs
+ * Add-note label). Note rows always true. */
+ hasNote: boolean;
expanded: boolean;
}
@@ -96,6 +99,7 @@ function buildAnnotationRows(
rich: renderNoteHtml(content),
loc,
color: "var(--accent)",
+ hasNote: true,
expanded: false,
};
rows.push(row);
@@ -144,6 +148,7 @@ function buildAnnotationRows(
rich,
loc,
color,
+ hasNote: !!note,
expanded: false,
};
rows.push(row);
diff --git a/web/src/book-detail.ts b/web/src/book-detail.ts
index 6dea10fe..009318e1 100644
--- a/web/src/book-detail.ts
+++ b/web/src/book-detail.ts
@@ -174,6 +174,9 @@ Alpine.data("bookDetail", () => {
bannerRows: [] as AnnotationRow[],
bannerLoaded: false,
bannerError: "",
+ bannerEditOpen: false,
+ bannerEditRow: null as AnnotationRow | null,
+ bannerEditText: "",
// raw source kept for the export builder (not exposed to the template)
bannerSources: [] as { row: AnnotationRow; source: string; highlightText: string }[],
@@ -220,6 +223,94 @@ Alpine.data("bookDetail", () => {
this.annotationsBannerLoading = false;
}
},
+ // ----- note edit/delete at the banner (objective 8a) -----
+ startBannerEdit(row: AnnotationRow): void {
+ // Highlight rows edit the note ATTACHED to the highlight (never the
+ // highlight itself): rich = "