Skip to content

Release v2.0.0 - Polished and Running

Choose a tag to compare

@lapisecek lapisecek released this 21 Sep 20:10
· 11 commits to main since this release

MarkdownReader v2.0.0 — Polished and Running

This is a major stability and performance release. The app now opens instantly when double-clicking any .md file, with no hangs, no freezing, and no blank screens.


Critical Bug Fixes

Fixed: App freezes / never opens on startup (the big one)

The root cause was an infinite React render loop introduced by an inline onEditorReady callback prop. Every render created a new function reference, re-triggering the editor's useEffect, calling setTabs() (generating a new array each time), which triggered yet another render — indefinitely. This saturated the Chromium renderer thread at 100% CPU, leaving the window blank and blocking all IPC communication (including single-instance file-open events from Explorer).

Fix: onEditorReady, setUnsaved, and onSelectionUpdate are now stable useCallback references. The editor-ready effect fires exactly once per editor instance (guarded by lastReadyEditorRef). State updates now bail out early if nothing actually changed.

Fixed: Opening a file continuously wrote to disk

On every editor mount, the app was calling window.api.saveFile() to "normalize" content. Combined with the render loop, this resulted in thousands of writes per second to the opened file. Opening a file is now strictly read-only — auto-save handles persistence through the existing settings.autoSave path only.

Fixed: Duplicate Tiptap link extension warning

StarterKit now disables its built-in link extension (link: false) since tiptap-markdown already registers its own, eliminating the console warning.

Fixed: IPC listener leak on settings change

The onFileLoaded / onDirectoryLoaded / onWindowStateChange IPC listeners no longer re-register when settings.defaultMode changes. A settingsRef is used to capture the latest value without adding it as a useEffect dependency.

Fixed: Editor ref leak on tab close

editorsRef entries are now cleaned up when a tab is closed.

Fixed: Source mode sync

Switching to Source Mode now syncs the Tiptap editor's current markdown content into the tab state first, so the raw text editor always shows the latest content.


Performance

Metric Before After
Startup time (no file) Hangs indefinitely ~600 ms
Startup time (with .md file) Hangs indefinitely ~650 ms
Idle CPU after load 100% (infinite loop) 0%
Disk writes on open Thousands/sec 0
Window paint Never < 1 second

Windows Integration (carried over from v1.3.x)

  • Double-clicking any .md file opens it instantly in MarkdownReader
  • Second .md double-click while app is already open loads the file in a new tab (single-instance forwarding)
  • Desktop + Start Menu shortcuts
  • File type icon associations
  • Windows setup assistant popup (bottom-right corner) for first-run configuration

What's in the zip

File Description
MarkdownReader.exe Main application (rename/run directly, no install needed)
icon.ico App icon (used by Windows Explorer & shortcuts)
resources/app.asar Packaged application code
*.dll, locales/, etc. Chromium runtime (required, keep alongside the exe)

Setup (first time)

  1. Extract MarkdownReader-v2.0.0-win32-x64.zip anywhere (e.g. C:\Program Files\MarkdownReader\)
  2. Run MarkdownReader.exe
  3. A setup assistant will appear in the bottom-right corner — click Fix to register .md file associations and shortcuts
  4. Done — double-click any .md file to open it

Note for AVG/Avast users: The executable uses the unmodified official Electron runtime binary, which is already whitelisted in AVG/Avast cloud reputation databases. If AVG prompts on first run, select "Allow" and it will not prompt again.


Full Changelog

  • fix(renderer): eliminate infinite re-render loop in EditorComponent — onEditorReady now fires exactly once per editor instance
  • fix(renderer): handleEditorReady, handleSetUnsaved, handleSelectionUpdate wrapped in useCallback for stable prop references
  • fix(renderer): bail-out guard in setTabs — no state update if isUnsaved is already correct value
  • fix(renderer): remove window.api.saveFile() from editor mount path
  • fix(renderer): settingsRef decouples IPC listener registration from settings.defaultMode reactivity
  • fix(renderer): clean up editorsRef[id] when tab is closed
  • fix(renderer): sync Tiptap content to tab state when entering Source Mode
  • fix(tiptap): disable StarterKit built-in link extension to prevent duplicate registration with tiptap-markdown
  • chore: bump version to 2.0.0