Skip to content

feat(notes): Markdown in user notes, with edit and view modes - #771

Open
WildHagai wants to merge 1 commit into
kdroidFilter:masterfrom
WildHagai:feat/markdown-notes
Open

WildHagai wants to merge 1 commit into
kdroidFilter:masterfrom
WildHagai:feat/markdown-notes

Conversation

@WildHagai

Copy link
Copy Markdown

What

User notes now support Markdown, with an edit mode and a view mode.

  • Notes pane (NotesPanel.kt): the editor has two modes.
    • Edit: the raw Markdown text field. Auto-save works as before (debounced, and saved when the field loses focus).
    • View: the note rendered with the app's existing AccentMarkdown (Jewel Markdown: bold, italic, headings, lists, links, inline code, quotes). It uses the Hebrew serif font and justified right-to-left paragraphs.
    • Saved notes open in view mode; drafts and empty notes open in edit mode.
    • Switching: a footer button (shown on hover, with a tooltip: עריכה / תצוגה), a double-click on the rendered note, or leaving the field.
  • One-line titles: the Notes screen, the notes popup, the home Notes widget and the macOS menu bar now use the new markdownToPlainText(), so **, ##, link syntax and so on never show up in titles.
  • New strings: note_edit, note_preview.

Dependencies

None added. Rendering reuses jewel-markdown, which the app already ships.

Testing

  • ./gradlew :SeforimApp:jvmTest --tests "…MarkdownTextTest": 13/13 pass (headings, emphasis, snake_case kept as is, inline code, links/images, lists/task boxes, quotes, code fences/rules, escapes, Hebrew).
  • ./gradlew :SeforimApp:ktlintCheck: clean.
  • :SeforimApp:compileKotlinJvm: OK.

Not yet verified

  • The edit/view toggle hasn't been tried in the running app yet.
  • AppNativeMenuBar.kt is the macOS menu bar, and this was developed on Windows. The change there is a small call to markdownToPlainText(), but it was only reviewed by eye, not exercised on macOS.

🤖 Generated with Claude Code

The notes pane editor now has two modes. In edit mode it is the raw
Markdown text field (as before: debounced auto-save, flush on blur).
In view mode the note is rendered with the app's existing Jewel
Markdown renderer (AccentMarkdown: Hebrew serif, accent links,
justified RTL paragraphs). Saved notes open in view mode; drafts and
blank notes open in edit mode. A hover-revealed footer button
(with a tooltip) toggles between the modes, a double-click on the
rendered note starts editing, and blurring the field returns to view.

Places that show a note as a one-line title (Notes screen, notes
popup, home Notes widget, macOS menu bar) now flatten the Markdown
to plain text via the new markdownToPlainText(), so syntax like
"**" or "##" never leaks into titles.

No new dependency: rendering reuses jewel-markdown, which the app
already ships.

Signed-off-by: Chagai Yisroel Wild <wildhagai@puzzlesoft.co.il>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants