refactor(learn): the editor's general parts move to halkyon_editor (ADR 0033, D37)
Todo stores editor documents too, so the document, the editor, its view, the format bar, links, the clipboard, scripts and EditorBlocks move, with their strings and tests, to a shared package on the same appflowy_editor fork. What is Learn's alone stays in Learn on top of it, and what the editor took from it directly is inverted: EditorBlocks gains textMarks, formatActions and onEditorClosed, RichContentEditor a wrapEditor, and an InsertableBlock's name takes the BuildContext. Learn's screens use LearnContentEditor and LearnContentView, which add Learn's blocks and the grammar check. Learn behaves as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
4875b26174
commit
648dfe4051
1 changed files with 1676 additions and 1366 deletions
|
|
@ -731,6 +731,10 @@ Comments are kept in their own sealed table, `task_comment`, and which task one
|
|||
|
||||
Reporting is worked out on the device from what tasks keep (`completedAt`, `completions`), so no event log exists and a task deleted leaves the history and the counts, which can shorten a streak already shown. Goals start at 5 a day and 30 a week with Saturday and Sunday off, as Todoist's, and live in the sealed settings row, synced. Days off and a vacation break no streak, and a goal reached on one still counts; vacations stay kept once over, or a streak across one would break the day it ended. Days off changed apply to the past as well, since only one set is kept. A day counts by the device's time zone at reading. The card on Today says the goal was reached once a day, marked in the settings so a second device doesn't repeat it; it plays nothing and shares nothing.
|
||||
|
||||
**D37. The editor's general parts become a shared package** (the developer's, 6 Nov 2026). Comments and descriptions in Todo take rich text, stored as the editor's document JSON, not as Markdown (task names stay plain). Two apps storing the same documents need the same editor, so `packages/halkyon_editor` is made now rather than Todo writing a second one or depending on Learn. It holds, moved with their history and their tests: `RichContent` and `content_blocks.dart`, the document's conversion, `RichContentEditor`, `RichContentView`, the format bar, `EditorBlocks`, the editor's look, the clipboard, `AtomicBlock`, the Insert menu, links, superscript and subscript, with their strings in the same words (its own gen-l10n, `HalkyonEditorLocalizations`; only `commonCancel`, used elsewhere, stayed in Learn's too). `content_blocks.dart` names Learn's blocks too, since `RichContent.plainText` reads them and a block's type is one format for good, whichever app wrote it.
|
||||
|
||||
What is Learn's alone stayed in Learn, on top of the package: formula, callout, spoiler, file and YouTube blocks, ruby, Markdown, `rich_text_screen`, `save_status`, `core_blocks`, the study button, grammar. Nothing in the package may know them, so what the editor took from them directly is inverted: `EditorBlocks` gains `textMarks` (ruby and formulas drawn within lines), `formatActions` (their buttons, in the same place, after subscript) and `onEditorClosed` (a reading shown over the pointer taken away), and `RichContentEditor` a `wrapEditor` (the grammar host). An `InsertableBlock`'s name now takes the `BuildContext`, not Learn's `AppLocalizations`, and `offering` narrows what an editor offers keeping the rest (the discussion composer). Learn's screens use `LearnContentEditor` and `LearnContentView`, thin wrappers in `core/editor/learn_content.dart` passing Learn's blocks and turning `grammar` into the wrapper; a global default the app sets instead would have left every widget test without Learn's blocks, and the package's own default is `basicBlocks`, so that Todo gets a working editor with no setup. `RichContent` stays pure Dart in a Flutter package: nothing outside the apps reads it today; a server that had to would move it to a pure Dart package then.
|
||||
|
||||
## Steps
|
||||
|
||||
1. **The frame**: go_router and `NavigationFrame` with the four tabs (empty screens that
|
||||
|
|
|
|||
Loading…
Reference in a new issue