Skip to content

ReadWrite v0.1.0

Choose a tag to compare

@github-actions github-actions released this 27 Apr 06:58
· 41 commits to main since this release

The first published release of ReadWrite — a side-by-side reader + Markdown editor with workspaces, screenshots, AI actions, and WeChat 公众号 publishing.

Highlights

  • Workspace model — pick or create a folder; every document lives inside as its own subfolder with a <name>.md plus an images/ directory. Move the folder anywhere; relative-path image refs travel with the doc.
  • Multi-tab reader for the web (real Chromium via WebContentsView, so cookies / CSP / X-Frame-Options: DENY sites all work), GitHub (owner/repo shorthand), PDFs, EPUBs, and local code folders.
  • Milkdown WYSIWYG editor with a one-click toggle to a full CodeMirror 6 source mode that shares the same buffer. Autosave with a configurable debounce.
  • Region-snip tool (⇧⌘S / Ctrl+Shift+S): drag a rectangle on any reader pane, the cropped PNG goes to the clipboard and into the doc's images/ folder, with a relative-path Markdown link inserted automatically.
  • AI actions (OpenAI-compatible endpoint, BYO key): Polish selection / whole document, Translate selection or document to English / 中文, Summarize, Explain, plus an Interpret dialog with a custom prompt. API keys live in the OS keychain via Electron's safeStorage.
  • Copy to WeChat 公众号 with three style themes — produces self-contained HTML (per-element inline styles, no <style> tag, base64-embedded images, the <li>-children-wrapped-in-<p> quirk) that survives a paste into mp.weixin.qq.com unchanged.
  • Direct publish to WeChat: upload all images, create a draft, and (optionally) push it to followers — all without leaving the editor.

Detailed feature list

Workspaces (Obsidian-style)

  • Mandatory workspace concept. The first-launch onboarding offers three paths: create a new workspace, open an existing folder, or pick from recent ones.
  • iCloud-friendly defaults — on macOS, the picker suggests iCloud Drive ahead of ~/Documents so notes sync across your Macs by default.
  • Multiple workspaces, switchable from a title-bar dropdown or Settings → Workspaces. Cross-window sync via a workspace:active-changed broadcast keeps the main and Settings windows in sync.
  • Per-workspace last-doc memory: the document you were editing reopens automatically on next launch, per workspace.
  • Settings → Workspaces panel: list, switch, reveal-in-Finder, forget. "Forget" only removes the entry from the known list — the folder on disk is preserved.

Documents

  • Folder-per-document model — <name>.md + images/ per doc.
  • New / Open / Rename buttons in the title bar. Rename atomically renames both the folder and the .md; relative image refs keep working.
  • Path transforms at the I/O boundary: in-memory editor content carries file:// image URLs (so the WYSIWYG view actually renders them), but on save they're rewritten to relative paths so the on-disk markdown is portable.
  • Autosave (default 1.5 s debounce, configurable) — first edit on the welcome doc lazily creates the folder.
  • Workspace docs sidebar (toggleable) listing every document, sorted by last modified, with search filter and per-doc Rename / Reveal in Finder / Move to Trash. Auto-refreshes when the workspace folder changes on disk (Finder, iCloud, Git pulls).
  • Move to Trash uses shell.trashItem so docs go to the system Trash and can be restored.

Reader

  • Web / GitHub tabs render in a native Electron WebContentsView (not iframe) so cookies, CSP, and X-Frame-Options: DENY sites Just Work.
  • PDF via pdfjs-dist with page nav and zoom.
  • EPUB via epubjs + react-reader, with location persisted per tab.
  • Local code folder via Monaco (read-only) + a chokidar-driven file tree that hot-refreshes on disk changes.

Editor

  • Milkdown 7.x with commonmark + GFM + history + listener + clipboard + upload presets.
  • CodeMirror 6 source-mode toggle that shares the buffer.
  • Live editor font / family / max-width controlled by CSS variables driven from settings.
  • Pasted/dropped images are auto-saved to the doc's images/ folder via @milkdown/plugin-upload, then inserted as a relative Markdown link.

Snip

  • Title-bar Crop button (also ⇧⌘S / Ctrl+Shift+S) freezes the reader pane, lets you drag a rectangle, and routes the cropped PNG to clipboard + disk + editor in one motion. For web tabs the native WebContentsView is briefly hidden so the renderer-side overlay can be drawn on top, then restored automatically.

AI

  • OpenAI-compatible endpoint configurable in Settings → AI. Works with OpenAI, DeepSeek, Moonshot, Azure OpenAI, Ollama (local), etc.
  • Connection test in Settings issues a real chat-completions request.
  • Editor-toolbar AI menu with Polish (selection / doc), Translate (selection / doc → English / 中文), Summarize, Explain, and Interpret-with-prompt actions.
  • Interpret dialog accepts a custom prompt (with quick-pick chips for common ones), then lets the user review and choose where to insert the response.
  • AI requests route through the main process; the API key never leaves the renderer's network panel.

WeChat 公众号

  • Settings → WeChat: AppID + AppSecret with a credential-verification button that hits the real cgi-bin/token endpoint.
  • Editor toolbar → Export → Copy to WeChat 公众号: three themes (Default sans, Serif, Compact). Inline-styled HTML, base64-embedded images.
  • Editor toolbar → Export → Publish draft to WeChat 公众号: uploads every inline image to WeChat's permanent media endpoint, replaces data: URLs with mmbiz.qpic.cn URLs, uploads the cover separately for thumb_media_id, and POSTs the article to /cgi-bin/draft/add. Access tokens are cached for 7200s.
  • A "Publish to followers" button on the draft success state calls /cgi-bin/freepublish/submit to push the article live without round-tripping through mp.weixin.qq.com.

Security

  • AI API key and WeChat AppSecret are encrypted at rest via Electron's safeStorage (macOS Keychain, Windows DPAPI, Linux libsecret). The renderer never sees ciphertext; the main process decrypts on demand. Existing plaintext values from older installs auto-migrate on first launch.

Build & release

  • electron-builder configuration for macOS (.dmg), Windows (NSIS), Linux (AppImage + .deb).
  • deploy.sh script for local cross-platform packaging and tag-triggered CI release.
  • .github/workflows/release.yml: tag-triggered three-OS matrix that builds all three platforms natively and publishes a GitHub Release with the binaries attached. Release notes are auto-extracted from this CHANGELOG.
  • v0.1.0 binaries ship unsigned — macOS users open with right-click → Open the first time; Windows users see SmartScreen warnings.

Tooling

  • TypeScript strict across all three processes.
  • ESLint + Prettier + Husky + lint-staged + commitlint (Conventional Commits) on every commit.
  • Vitest for unit tests; GitHub Actions CI runs typecheck + lint + test on every PR plus a cross-platform build.

Acknowledgements