Skip to content

A new editor for Tine: live preview (CodeMirror 6) replacing the plain text box — what do you think? #767

Open

Description

@martinkoutecky

Today, when you click a block, Tine shows its raw Markdown in a plain text box, exactly like Logseq. We are experimenting with a new editor (CodeMirror 6) that keeps the block looking rendered while you edit: markup like **, [[ ]], > or TODO appears only around the part your cursor is in, the way Obsidian's live preview works.

This is one of the most requested directions: WYSIWYG / live preview led the direction poll (#422) for a while, and it was asked for in #202 and #219. The experiment itself is tracked in #95.

Why: the text no longer jumps when you click into a block; links, bold and code stay readable while you type; and the editor gets better tools for things the plain box handles badly (input methods, large blocks, precise clicks).

Speed comes first. Tine is meant to stay fast. If the new editor would cost a significant amount of speed (typing, opening pages, scrolling, memory), we will not ship it, however nice it looks.

What we would do: build it in development behind a setting, then ship it as an opt-in in a Beta for anyone who wants to try it, then make it the default with the old editor as a fallback, and finally retire the old editor. Keeping two editors forever would double the work on every editing feature, so we don't plan to. We will only retire the old editor if most of you are fine with that.

What we'd like from you:

  • 👍 / 👎 on the direction, and if 👎, what you would lose.
  • Do you rely on seeing the whole raw block while editing (Logseq's behaviour)? Should that stay available as an option?
  • Do you use an input method (Chinese, Japanese, Korean, …), a screen reader, or an unusual keyboard setup? Tell us; those are the hardest cases and we want testers.

Nothing changes for you until you opt in, and your files stay plain Markdown either way.

Asking those who requested or discussed this, so we hear from you before rather than after: @Jacob-YLB @Louis-15 @scavi-github @almmos @EllisMorrow, and @matristix, who asked us to keep Tine free of bloat.

— Claude (working on Martin's behalf)

Activity

  1. Brikas commented on Oct 25, 2026

    @Brikas

    Have you considered Monaco editor?

    Just asking, not saying its better for Tine. But if you haven't added it to the consideration options, I would push to evaluate it before going with CodeMirror.

    EDIT: I looked at it myself now, and by the looks of it Monaco is a much heavier thing that ships much more clutter than Tine probably needs, so feel free to disregard my comment.

  2. Brikas commented on Oct 25, 2026

    @Brikas

    Direction wise, I think its very interesting.

    It's great because it outsources a very sensitive component where details and stability matters a lot to a mature, battle-tested platform.

    I've only seen CodeMirror used for code and monospace type of typing. Hope you don't hit "I'm a Teapot" kind of situation, where you are trying to fit a code-editor to a non-code use case. But it may indeed just be universal enough for Tine's markdown style.

  3. Brikas commented on Oct 25, 2026

    @Brikas

    Do you rely on seeing the whole raw block while editing (Logseq's behaviour)? Should that stay available as an option?

    Personally, not that I can think off. I would switch to Obsidian live preview style and I would gain much more than lose.

  4. martinkoutecky commented on Oct 25, 2026

    @martinkoutecky
    OwnerAuthor

    Thanks, @Brikas, and thanks for checking it yourself. Your edit matches what we found. Monaco is a great code editor (it's what VS Code uses), but it doesn't support mobile browsers (its README says so explicitly), and Tine runs on Android and iOS too. It's also built around one large document per editor, while Tine opens an editor per block. And live preview needs to hide markup like [[ ]] or ** while you edit, which CodeMirror 6 supports directly.

    On the "code editor for prose" worry: that's a fair concern, but Obsidian's live preview is built on CodeMirror 6, so writing prose in it is well proven. The things we still have to get right ourselves are Tine-specific: blocks, references, autocomplete, and clicks landing in the right place inside rendered text.

    Thanks also for answering the raw-block question.

    — Claude (working on Martin's behalf)

  5. EllisMorrow commented on Oct 26, 2026

    @EllisMorrow
    Contributor

    1. I support this development direction.

    2. For WYSIWYG editing, Vditor, Obsidian, Typora, and Milkdown are all excellent references. For Tine, I particularly recommend looking at Vditor's source code, as it already has a very mature implementation: [https://github.com/Vanessa219/vditor](https://github.com/Vanessa219/vditor?utm_source=chatgpt.com)

    3. If Chinese-language testing is needed, I'd be happy to participate.

    4. Once WYSIWYG editing is stable, I don't think there's any need to retain Logseq's raw Markdown editing approach. I consider it an outdated approach that offers a poor editing experience. If we need access to the Markdown source, we can simply use the block export feature through the bullet on the left, or open the notes in another editor.

    5. Other open-source projects using CodeMirror 6 (CM6) that are worth looking at for reference include:

    Project Strengths Limitations for Tine Most useful ideas to borrow
    1. SilverBullet The closest technical match: it uses CodeMirror 6 and provides Obsidian-style live preview. As a Markdown knowledge-management app, it also handles links, tasks, and dynamic content. It is a complete application, with rendering tied to its own parser and component system. Extracting the relevant parts requires adaptation. Its page-based editor does not directly solve Tine’s block selection, block references, or undo behavior. Core live-preview mechanics: when to reveal or hide Markdown markers, how clicks on rendered content map back to source positions, and how estimated table heights reduce scroll jumps.
    2. Zettlr Also uses CodeMirror 6, with separate rendering modules for links, images, math, code, and other elements. Users can choose which elements are rendered. Its focus is desktop long-form writing, with citation and Pandoc features that Tine may not need. Some implementations depend on Zettlr’s configuration and syntax. Mobile keyboard and touch behavior require separate validation. Rendering architecture, selection handling, and performance: processing visible regions, revealing source within selections, and controlling marker visibility near the cursor.
    3. Vditor A relatively complete, embeddable editor offering rich-text, Typora-style instant rendering, and split-view modes. Its source includes specific handling for Chinese input methods and browser differences. Its editable-DOM, browser-selection, and Lute-based approach differs substantially from Tine’s CM6 architecture. Direct code reuse is more limited, and editing and undo behavior would need to be reconciled with Tine. Interaction details and edge cases: deferring rendering during input-method composition, revealing markers around adjacent formatting, preserving the cursor, and handling copy and paste.
  6. Louis-15 commented on Oct 26, 2026

    @Louis-15

    I do not understand the differences among the various technical approaches to achieving "what you see is what you get," but I appreciate this functionality.

  7. Louis-15 commented on Oct 26, 2026

    @Louis-15

    Can the CodeMirror 6 editor help in implementing rich text formats that are more complex than the current Markdown format?

  8. martinkoutecky commented on Oct 26, 2026

    @martinkoutecky
    OwnerAuthor

    @Louis-15 I guess it depends on what you have in mind? Different formats would also touch much more than the editor, but I'm curious what you are thinking about.

  9. Louis-15 commented on Oct 26, 2026

    @Louis-15

    @Louis-15 I guess it depends on what you have in mind? Different formats would also touch much more than the editor, but I'm curious what you are thinking about.

    For richer formatting while keeping Markdown as the source, these three references may be useful:

    Typora: Markdown + inline HTML. Supports text colors, background colors, font sizes, underlining, and superscript/subscript.

    Joplin: inline HTML rendered in its CM6 Markdown editor. Its live rendering of colored text and superscript/subscript provides an open-source implementation worth examining.

    Zettlr/Pandoc: Markdown + attribute extensions. Supports underlining, alignment, image sizing, and custom styles, although some effects depend on the export pipeline.

    Typora and Joplin share the HTML-in-Markdown approach; Pandoc uses attribute syntax. Both approaches require compatible renderers to preserve the additional styles across apps.

  10. added
    issue-accepted
    on Nov 8, 2026
  11. 9 remaining items

  12. martinkoutecky commented on Nov 25, 2026

    @martinkoutecky
    OwnerAuthor

    @EllisMorrow @Louis-15 thank you both. These are two reports of the same kind: the new editor loses text around an input method (a Chinese IME in one, the keyboard's voice input on Android in the other). Losing what you entered is the most serious kind of problem an editor can have, so both are planned for Tine 0.10 and come first among the editor reports.

    Ellis, your steps and video are enough to start from.

    Louis-15, one question, so that we test the right thing: which keyboard app provides the voice input (Gboard, Sogou, iFlytek or another), and which Android version?

    Until it is fixed, the previous editor is still available: open Settings and search for "classic editor" ("Use classic editor", under Editor, Advanced).

    Claude (working on Martin's behalf)

  13. martinkoutecky commented on Nov 26, 2026

    @martinkoutecky
    OwnerAuthor

    @EllisMorrow @Louis-15: both reports above are fixed for Tine 0.10.0-beta.2.

    • Formatted text disappears while a Chinese input method composes (EllisMorrow). The bold run stayed in the block's text, which is why undo or leaving the block brought it back; what went wrong was the drawing. While a line is being composed the editor redraws its rendered runs, and Tine's rendered run was emptied on screen in that redraw. Rendered runs now stay drawn while you compose.
    • Voice-typed text disappears on Android when another line is tapped (Louis-15). Voice typing keeps a composition open, and the tap closed the editor before the keyboard had ended it, so the text still being composed was never saved. The editor now saves it as it closes.

    How this was checked: tests that drive the real block editor with the events an input method sends; they fail before the change and pass after it. Not checked: a real Chinese input method, and voice typing on an Android device, neither of which I can run here. So my confidence is moderate rather than high. I'm leaving this issue open.

    Claude (working on Martin's behalf)

  14. Louis-15 commented on Nov 26, 2026

    @Louis-15

    @EllisMorrow @Louis-15 thank you both. These are two reports of the same kind: the new editor loses text around an input method (a Chinese IME in one, the keyboard's voice input on Android in the other). Losing what you entered is the most serious kind of problem an editor can have, so both are planned for Tine 0.10 and come first among the editor reports.

    Ellis, your steps and video are enough to start from.

    Louis-15, one question, so that we test the right thing: which keyboard app provides the voice input (Gboard, Sogou, iFlytek or another), and which Android version?

    Until it is fixed, the previous editor is still available: open Settings and search for "classic editor" ("Use classic editor", under Editor, Advanced).

    Claude (working on Martin's behalf)

    我使用的是字节跳动出品的豆包输入法的语音输入功能。
    并且在后续我还发现了,用此输入法手动打字,也会出现换行之后文字消失的问题。

  15. martinkoutecky commented on Nov 26, 2026

    @martinkoutecky
    OwnerAuthor

    @Louis-15, thank you for the report about the Doubao keyboard.

    We don't have an Android device with Doubao here, so we reproduced what Android keyboards send in tests and found two ways Enter could lose text:

    • Enter right after the keyboard finished a word: the block could be split without that last word. Now the word stays and the block splits once.
    • Android versions where keyboard input goes through an EditContext: the finished text was not saved, and Enter did nothing. Now the text is saved and Enter splits the block.

    Fixed for Tine 0.10.0-beta.2.

    Since we could only test these cases and not your keyboard itself, this may not be the whole story. If it still happens on 0.10.0-beta.2, one detail would help a lot: does the text you typed just before Enter disappear, or the text you type on the new line?

    Claude (working on Martin's behalf)

  16. added
    fixed-in-development
    on Nov 26, 2026
  17. martinkoutecky commented on Nov 28, 2026

    @martinkoutecky
    OwnerAuthor

    @EllisMorrow @Louis-15 Tine 0.10.0-beta.2 is out with the three input-method fixes described above:

    • While an input method composes in a block, bold text and other formatted runs after the caret no longer vanish until you leave the block.
    • Text entered with voice typing or another composing keyboard on Android is no longer lost when you tap another block before the keyboard ended its composition.
    • Enter pressed right after a composing keyboard finished a word keeps that word and splits the block once.

    The two Android cases were checked by replaying in tests what Android keyboards send. We have no device with the Doubao keyboard, so how it behaves on your phone is the real test; please tell us either way. This issue stays open.

    Claude (working on Martin's behalf)

  18. added
    fixed-in-beta
    and removed
    fixed-in-development
    on Nov 28, 2026
  19. EllisMorrow commented on Nov 30, 2026

    @EllisMorrow
    Contributor

    The issue I previously reported has been fixed.

    However, there is a new issue in Tine 0.10.0-beta.2: no matter where I click within the following block, the text cursor always jumps directly to the end of the block.

    - 🚩下边的测试排名只能作为参考东有\*\*各自的短板和数据局限性**
    
    QQ20261130-110533.mp4

    I've found that this issue occurs in any block that starts with an emoji.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixed-in-betaissue-accepted

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions