Replaces the old Default theme (which followed the OS color scheme) with a
fixed warm, writing-focused Light theme: off-white editor surface, charcoal
text, subtle warm-gray borders, and a restrained deep teal-green accent. The
selector now offers Light and Neonflux. Old saves storing "default" are
migrated to "light" in both the renderer and the main process, and the e2e
scenario now covers Light + Neonflux application, light/dark checks, theme
round-trips, and content preservation.
The main process now assembles the manuscript from the chapter files and
renders it to a Word document with the docx library, using the same
markdown-it plugin set as the on-screen renderer (highlight, callouts,
wikilinks). ODT is converted from that DOCX with LibreOffice running
headless, keeping the two formats consistent; a clear error is returned
when LibreOffice is missing. The Full Book header's single Export PDF
button becomes an Export menu (PDF/DOCX/ODT) wired to the File menu.
Tests: new run-office-export-test.mjs verifies DOCX/ODT structure,
chapter order and formatting; the e2e scenario exports through the real
IPC chain and checks magic bytes, extensions and the status notices.
Introduce a theme layer on top of the existing CSS custom properties.
All color tokens now live in themes.css, scoped by a data-theme
attribute on <html>, so a theme is just a new token block plus a
dropdown option - no code changes needed. The Default theme preserves
the existing light/dark behavior; Neonflux adds an electric-cyan dark
theme.
The active theme is chosen via a Theme selector in the sidebar footer
and persisted in a new main-process settings file (userData
settings.json) through getTheme/setTheme IPC, so it survives restarts.
Hard-coded on-accent, selection, shadow and backdrop colors across the
renderer were converted to semantic tokens so every theme stays
consistent.
Add a chapter dropdown plus Previous/Next buttons to the Full Book
toolbar. The dropdown lists every chapter in canonical order and the
buttons jump between them, scrolling the assembled manuscript so the
target chapter begins near the top of the viewport. Manual scrolling
keeps the dropdown in sync with the chapter currently on screen, and
reordering chapters while Full Book is open re-renders navigation to
match the new order immediately.
Navigation reuses the same chapter boundaries that drive page breaks,
so it can never drift from the assembled chapter order.
The printed book is rendered from the same markdown the editor writes, but
markdown-it escaped HTML and did not understand Folio's extensions, so
underlines, text/highlight colors, alignments, ==highlights==, callouts and
wikilinks all showed up as raw source text in the PDF. Render the print book
with a purpose-built print-format renderer that keeps every feature:
- html: true so the toolbar's <u>, <span style=...> and <div align=...>
pass through and render instead of appearing literally,
- ==highlight== rendered as <mark> (new inline rule),
- Obsidian callouts (> [!note] Title) rendered as styled divs with a bold
title (new core rule),
- wikilinks resolved to links via the shared wikilink plugin.
Add matching print styles for mark, underline and callout types, and e2e
assertions that none of these features leak as raw source into #printBook.
The previous export printed the CodeMirror editor, which only keeps a
virtualized window of lines in the DOM; on larger books the PDF could come
out truncated (only what was rendered around the viewport). Replace the
print path with a dedicated #printBook container: the renderer renders each
chapter of the assembled manuscript to plain HTML with markdown-it, and the
print stylesheet hides the entire app and shows that container instead.
Plain HTML paginates reliably regardless of editor viewport or scroll
position, every chapter after the first still starts on its own page, and
output is a properly formatted manuscript instead of raw markdown. Keep the
screen-only chapter-break separator in the Full Book editor.
Extend the e2e selftest to assert #printBook holds every chapter, is hidden
on screen, and that a 1500-line chapter reaches the print DOM and exported
PDF in full.
Print the Full Book window via webContents.printToPDF (A4, 1in margins),
reusing the existing print stylesheet so every chapter after the first
starts on its own page and all app chrome is stripped from the output.
Expose it as an Export PDF button in the Full Book header and a File menu
item, save via a native save dialog (self-test writes to FOLIO_TEST_PDF),
and force light-on-white colors in print so dark-mode exports stay readable.
Add e2e coverage that exports through the real renderer->IPC->print chain
and verifies a valid non-empty PDF is written.
Set effectAllowed to copyMove in dragstart so Chromium renders a valid
drop cursor over chapter rows on X11 and other platforms (the effective
operation remains move via dropEffect). On native Wayland the prohibited
cursor persists as a known upstream Chromium/Electron platform
limitation; no DOM change can reach it.
The Full Book pane had no CSS rule, so it fell back to block layout:
the CodeMirror editor grew to the full manuscript height and was
clipped by the overflow-hidden workspace, leaving the content below
the first screen unreachable and making a multi-chapter book appear
as a single chapter. Give .full-book-view the same flex-column layout
as .chapter-view so the editor is bounded and scrolls internally.
Add an e2e assertion (fbLayoutOk) that checks the computed layout is a
flex column with the editor bounded to the viewport, so this class of
rendering regression is caught in future runs.
Full Book now assembles from a fresh read of the canonical book metadata
(chapter order + chapter entries) instead of the renderer's in-memory
chapter array, so it always contains every chapter in the current order
and can never render from stale or partially-loaded state. The chapter
sidebar and Full Book share the same single source of truth.
Also refresh Full Book whenever book metadata loads, and extend the e2e
scenario to cover reordering to a new order, order persistence across
reopen, and delete/rename/new-empty chapters all being reflected.
Route the renderer select-all listener (previously sent but never handled) to
the active editor, and extend the e2e scenario to verify the Full Book
assembly, stats, Copy All clipboard content, and read-only select-all.
- Bind Ctrl+Shift+S to strikethrough
- Smart code toggle: fenced block for multi-line selections, inline otherwise
- Link editing: selecting an existing link now selects its URL for editing
- Route undo/redo shortcuts through IPC so CodeMirror history is used when
the editor has focus instead of Electron's native menu-role undo/redo
- Add Indent/Outdent toolbar buttons