From 24ea1e849ef460ac1435af41edd8530e99630c82 Mon Sep 17 00:00:00 2001 From: aiongg Date: Thu, 12 Nov 2026 08:28:12 +0000 Subject: [PATCH] NotesEditor stories: the old five-paragraph speaker notes as Default --- crates/text/src/ui/notes/stories.rs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/crates/text/src/ui/notes/stories.rs b/crates/text/src/ui/notes/stories.rs index d0477f036..d68ff7b46 100644 --- a/crates/text/src/ui/notes/stories.rs +++ b/crates/text/src/ui/notes/stories.rs @@ -7,6 +7,19 @@ use egui::Ui; use super::{NotesEditor, NotesParagraph, NotesRun, NotesText}; use crate::lists::ListMarker; +/// Speaker notes: an opening paragraph, a key message with a bold lead, two bullets one level in, and a closing line. +fn speaker_notes() -> NotesText { + let plain = |text: &str| NotesRun::new(text); + let item = |text: &str| NotesParagraph::new(vec![plain(text)]).list(1, Some(ListMarker::Bullet("•".into()))); + NotesText::new(vec![ + NotesParagraph::new(vec![plain("Welcome everyone and introduce the agenda for the next thirty minutes before taking questions.")]), + NotesParagraph::new(vec![plain("Key message:").bold(true), plain(" revenue grew in every region, led by the new subscription tier.")]), + item("Show the regional chart"), + item("Pause for questions on pricing"), + NotesParagraph::new(vec![plain("Thank the team and hand over to the next speaker.")]), + ]) +} + fn bullets() -> NotesText { let run = |text: &str, bold: bool| NotesRun::new(text).bold(bold); let bullet = || Some(ListMarker::Bullet("•".into())); @@ -17,6 +30,12 @@ fn bullets() -> NotesText { } #[story(NotesEditor<'static>, covers = [Default], drive = Drive::Never)] +fn editing_speaker_notes(ui: &mut Ui, data: &mut StoryData) -> StoryOutput { + let notes = data.value("notes", speaker_notes()); + NotesEditor::new("Notes", notes).show(ui).response.into() +} + +#[story(NotesEditor<'static>, covers = [], drive = Drive::Never)] fn editing_bullets(ui: &mut Ui, data: &mut StoryData) -> StoryOutput { let notes = data.value("notes", bullets()); NotesEditor::new("Notes", notes).show(ui).response.into() @@ -30,6 +49,6 @@ fn long_text(ui: &mut Ui, data: &mut StoryData) -> StoryOutput { #[story(NotesEditor<'static>, covers = [], drive = Drive::Never)] fn read_only(ui: &mut Ui, data: &mut StoryData) -> StoryOutput { - let notes = data.value("notes", bullets()); + let notes = data.value("notes", speaker_notes()); NotesEditor::new("Notes", notes).read_only(true).show(ui).response.into() }