feat(app): editor blocks: callout, spoiler, formulas, files, video, study button
All checks were successful
CI / check (push) Successful in 8m34s
CI / deploy (push) Successful in 1m1s

Blocks beyond the editor's own, each built once for editor and view:
- callout: eight kinds in theme colours, kind, title and "folded at
  first" from its header; written in place, left with Enter on its
  empty last line; never inside another
- spoiler: written in plain sight, hidden behind Reveal read-only
- formula on its own line, written on its own screen with a preview
  and snippet buttons, and formulas within a line (Σ in the format
  bar); set by flutter_math_fork behind MathView, LaTeX's numbered
  environments read as their aligned forms
- image and sound picked from the device, kept as synced files
- YouTube video from its link, with its start and a caption: a card
  until played, nothing fetched before; played in place where a web
  view exists (youtube_player_iframe, privacy-enhanced), else opened
  in the browser, behind YoutubeVideos in Dependencies
- study button: a studyset, a tag or all cards, with or without its
  topics, back first; its StudyFocus rides on the study route and
  narrows that session only
- tables, already in the editor, now insertable everywhere

An Insert button opens on the format bar, so blocks can be inserted on
phones too; the desktop's / menu lists the same blocks, translated.
Card faces now dock the format bar while written, so cards get blocks
and formatting on phones as well. The blocks are listed in
EditorBlocks: the core's, plus the features' through
EditorBlocksScope. Blocks of a type the app doesn't know say they need
a newer version and stay as they are, so formatVersion stays 1.

Their types and keys are in content_blocks.dart, which RichContent
reads: a block's text counts as text, and a video or study button
isn't blank. The path import now makes formulas real ones.

integration_test/youtube_player_test.dart plays a real video through
the app's player on a device, which no widget test can: YouTube
refuses embeds that don't say where they are embedded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-03 12:20:41 +02:00
commit ec34bb2334
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -529,6 +529,7 @@
"@heatmapDay": {"placeholders": {"count": {"type": "int"}, "date": {"type": "String"}}},
"commonCancel": "Cancel",
"commonSave": "Save",
"commonClose": "Close",
"commonUndo": "Undo",
"commonTryAgain": "Try again",
@ -543,6 +544,117 @@
"fileStopSound": "Stop sound",
"fileSoundUnavailable": "This sound isn't on this device yet. It plays once it's uploaded and you're online.",
"fileSoundUnplayable": "This sound can't be played. Its file may be damaged, or in a format this device can't play.",
"fileImages": "Images",
"fileSounds": "Sounds",
"fileNotAnImage": "This file isn't an image the app can show.",
"fileNotASound": "This file isn't a sound the app can play.",
"fileTooLarge": "This file is larger than {megabytes} MB.",
"@fileTooLarge": {
"placeholders": {
"megabytes": {"type": "int"}
}
},
"fileNotKept": "The file couldn't be kept on this device.",
"fileRemoveImage": "Remove image",
"fileRemoveSound": "Remove sound",
"editorInsert": "Insert",
"blockGroupText": "Text",
"blockGroupBlocks": "Blocks",
"blockGroupMedia": "Media",
"blockHeading": "Heading {level}",
"@blockHeading": {
"placeholders": {
"level": {"type": "int"}
}
},
"blockBulletedList": "Bulleted list",
"blockNumberedList": "Numbered list",
"blockChecklist": "Checklist",
"blockQuote": "Quote",
"blockDivider": "Divider",
"blockTable": "Table",
"blockRemove": "Remove",
"blockUnknown": "This part needs a newer version of the app.",
"blockCallout": "Callout",
"blockSpoiler": "Spoiler",
"calloutNote": "Note",
"calloutInfo": "Info",
"calloutTip": "Tip",
"calloutSuccess": "Success",
"calloutQuestion": "Question",
"calloutWarning": "Warning",
"calloutDanger": "Danger",
"calloutQuote": "Quote",
"calloutOptions": "Callout options",
"calloutEditTitle": "Edit title…",
"calloutFoldedAtFirst": "Folded at first",
"calloutRemove": "Remove callout",
"calloutShow": "Show",
"calloutHide": "Hide",
"calloutWriteInside": "Write inside",
"calloutTitleDialog": "Callout title",
"calloutTitleLabel": "Title",
"calloutTitleHelper": "Leave it empty to show the kind's name.",
"spoilerReveal": "Reveal",
"spoilerPlaceholder": "Hidden text, revealed on a tap",
"blockFormula": "Formula",
"formatInlineMath": "Formula in the line",
"formulaTitle": "Formula",
"formulaInLineTitle": "Formula in the line",
"formulaPreview": "Preview",
"formulaPreviewEmpty": "The formula shows here",
"formulaLatex": "LaTeX",
"formulaLatexHelper": "\\\\ starts a new line in aligned, cases or a matrix.",
"formulaEmpty": "An empty formula. Tap to write it.",
"formulaEdit": "Edit formula",
"formulaRemove": "Remove formula",
"blockYoutube": "YouTube video",
"youtubeLink": "YouTube link",
"youtubeLinkHelper": "Paste a link from YouTube.",
"youtubeNotFound": "No YouTube video in this link.",
"youtubeFound": "Found the video.",
"youtubeFoundFrom": "Found the video, starting at {time}.",
"@youtubeFoundFrom": {
"placeholders": {
"time": {"type": "String"}
}
},
"youtubeCaption": "Caption",
"youtubeCaptionHelper": "Shown in place of the video until it plays.",
"youtubeVideo": "YouTube video",
"youtubeSource": "YouTube",
"youtubeFrom": "YouTube · from {time}",
"@youtubeFrom": {
"placeholders": {
"time": {"type": "String"}
}
},
"youtubeEdit": "Edit video",
"youtubePlay": "Play video",
"youtubeOpen": "Open on YouTube",
"youtubeRemove": "Remove video",
"youtubeBroken": "This video's link can't be read.",
"youtubeNotOpened": "Couldn't open YouTube.",
"blockStudyButton": "Study button",
"studyButtonDefaultLabel": "Study",
"studyButtonStudyset": "Studyset to study",
"studyButtonTag": "Cards",
"studyButtonAllCards": "All cards",
"studyButtonLabel": "Label",
"studyButtonTopics": "With its topics",
"studyButtonBackFirst": "Back first",
"studyButtonBackFirstHelper": "Front/back and vocabulary cards ask their back.",
"studyButtonWithTag": "Tagged {tag}",
"@studyButtonWithTag": {
"placeholders": {
"tag": {"type": "String"}
}
},
"studyButtonAlone": "Without its topics",
"studyButtonEdit": "Edit study button",
"studyButtonRemove": "Remove study button",
"studyButtonBroken": "This study button doesn't say what to study.",
"studyButtonGone": "That studyset no longer exists.",
"ankiImportMenu": "Import from Anki",
"ankiImportFileType": "Anki decks",
"ankiImportTitle": "Import Anki deck",