← Sat, Nov 7 digest

Tasfer: a text editor drawn on a 2D canvas

read article ↗ hn thread ↗

Hamza built Tasfer, an open-source, local-first text editor that bypasses contentEditable to render everything directly onto an HTML5 2D canvas.

summary is enough The brief architectural overview is interesting, but the comment thread is essential for understanding the real-world usability and accessibility hurdles of canvas-based text editors.

summary

Frustrated by the quirks of the browser contentEditable API, a developer built Tasfer, a local-first text editor that renders everything directly on an HTML5 2D canvas. The project uses a hidden input element to handle keystrokes and IME events, while implementing CRDTs and WebRTC for peer-to-peer synchronization without storing documents on a server. Although it packs features like LaTeX rendering and multi-platform support, users and commenters quickly point out typical canvas editor drawbacks like broken mobile gestures, selection bugs, and accessibility limitations.

key points

  1. Tasfer avoids contentEditable by painting text, cursors, and layouts directly onto an HTML5 2D canvas, using a hidden input element solely to capture keyboard and IME events.
  2. The application is entirely local-first, utilizing CRDTs and encrypted WebRTC to enable peer-to-peer document collaboration without a central database.
  3. Commenters highlight recurring usability issues inherent to custom canvas text rendering, including broken mobile text selection, gesture handling, and screen reader compatibility.

who should read it

Frontend engineers and developers interested in alternative text-editing architectures and local-first software.

discussion mixed

consensus

Commenters appreciate the privacy-focused design and engineering ambition, but heavily scrutinize the UX trade-offs of abandoning native DOM text rendering for a canvas.

pushback

Some developers argue that mature DOM-based libraries like CodeMirror or specialized tools like Typst achieve high performance without the severe drawbacks of a custom canvas engine.

best comment by chrismorgan ↗

This is a good demonstration of why you really shouldn’t do this. Bluntly: this is completely unusable for many people, barely usable for a lot more, and on desktop and mobile both I would absolutely hate to use this, and a lot of the problems in it fundamentally cannot be fixed.

> But it also means the editor looks and behaves the same in every browser, on desktop and on phone, because nobody else is in charge of the pixels.

You say this as though it were a good thing. It’s very much not; they’re not supposed to be the same, they have slightly different expected renderings, and …

It details why bypassing native platform rendering causes intractable usability, accessibility, and text selection problems.

Generated by an LLM from the article and thread. Check the sources before relying on it.