Repository navigation
Cathet v4.1.0
Release Notes — Cathet v4.1.0
Target of the Change / Release Note
Cathet v4.1.0 Windows x64 and ARM64 Production Release (git diff v4.0.3..HEAD).
Summary of the Change
Cathet v4.1.0 introduces bidirectional scroll position preservation across Markdown edit and preview modes, a configurable Markdown Preview default document opening setting, universal multi-window working set memory compaction across all WebView2 process trees, GPU and memory optimizations for the spammable heart sprout particle subsystem, and refined compact layout aesthetics in the Settings and About window.
Detailed Breakdown
1. Bidirectional Markdown Edit and Preview Scroll Preservation
- What Changed: Toggling between Markdown Edit mode and Markdown Preview mode via Ctrl+M now preserves the exact proportional scroll position in both directions.
- Why the Change Was Made: Previously, switching modes completely destroyed and re-rendered the inner DOM of the editor, causing the container scroll height to collapse instantaneously and clamping the scroll position to zero (the top of the document). In addition, returning to Edit mode triggered keyboard focus on the contenteditable container, which prompted the browser engine to scroll the initial caret position into view.
- Bug Fixing: Resolved viewport snapping to line 0 on mode transitions. Implemented non-scrolling focus using the preventScroll option on the editor element.
- Technical Details: Created a dedicated utility module, scrollSync.ts, to calculate normalized vertical progress:
scrollRatio = scrollTop / (scrollHeight - clientHeight)
Upon DOM reconstruction, scrollSync applies an immediate synchronous scroll restoration followed by a secondary pass within requestAnimationFrame to guarantee alignment after asynchronous font and image layout reflows settle.
2. Markdown Preview Default Document Opening Setting
- What Changed: Added a toggle in the Settings interface allowing users to configure whether existing text and markdown documents automatically open in rendered Preview mode by default, while preserving immediate Edit mode for blank scratchpads.
- Why the Change Was Made: Improves reading efficiency for users frequently opening technical documentation, readmes, and notes without requiring manual shortcut invocation on every open operation.
- Technical Details: Implemented PreviewService to manage persistent storage under the cathet_always_preview key. Wired cross-window communication via the Tauri event cathet:always-preview-change. Updated the main application document loader to evaluate document state and conditionally initialize in rendered preview mode.
3. Universal Multi-Window Working Set Compaction
- What Changed: Broadened Win32 working set memory compaction to execute across all open windows upon focus loss, and scheduled an automatic memory trim when the secondary Settings window is closed or destroyed.
- Why the Change Was Made: Cathet utilizes independent native WebView2 windows for the main editor and the Settings dialog. Previously, memory trimming was restricted to focus loss on the main window. Closing or defocusing the Settings window left allocated renderer and GPU working set pages active until the main window was refocused and defocused.
- Technical Details: Updated the on_window_event handler in src-tauri/src/lib.rs. Any window receiving Focused(false) triggers trim_memory() across the entire process tree via Win32 SetProcessWorkingSetSize. When the Settings window receives CloseRequested or Destroyed, a background asynchronous task waits 250 milliseconds for WebView2 COM interfaces to tear down, then initiates working set compaction.
4. Settings Window Compact Layout & Hidden Scrollbar
- What Changed: Restored the Settings window inner dimensions to the compact 350x318 form factor, enabled hidden vertical scrolling for the settings card, and balanced the vertical spacing of the About card.
- Why the Change Was Made: Accommodates the additional Markdown Preview toggle switch without clipping or introducing visual distortion, while preserving a minimal desktop footprint.
- Bug Fixing: Resolved a flexbox container layout constraint where min-height: auto on intermediate parents prevented scrollHeight from exceeding clientHeight, which previously blocked native mouse wheel scrolling. Corrected with explicit min-height: 0 and overflow-y: auto on the tab pane.
- Technical Details: Applied custom CSS rules (scrollbar-width: none, -ms-overflow-style: none, and webkit-scrollbar display none) to provide smooth vertical scrolling with zero visual scrollbar obstruction. Added window and container scroll listeners to FontSelect to automatically dismiss open dropdown menus during scroll events.
5. Settings & About UI Enhancements & Particle Performance
- What Changed: Integrated monochrome SVG icons for GitHub and Website links, structured left-aligned labels with flush right-aligned frosted glass action capsules, added a continuous glowing pulse to the update button when updates are ready, and upgraded the spammable heart sprout particle utility with an 11-color palette, arc trajectory dispersion, FIFO active particle ceiling, and compositor layer promotion.
- Technical Details:
- Particle Pool Ceiling: Enforced a maximum limit of 24 concurrent active particles in heartSprout.ts. When rapid clicks occur, the oldest active DOM particles are retired immediately via a FIFO queue, preventing DOM tree bloat.
- Template Node Cloning: Replaced synchronous innerHTML string re-parsing on every click with cloneNode(true) from a pre-parsed template element.
- Compositor Isolation: Added will-change: transform, opacity, contain: layout style, and backface-visibility: hidden to .sprouting-heart-particle in settings.css. Reduced drop-shadow blur radius from 5px to 3px to eliminate per-frame Gaussian blur re-rasterization bottlenecks in Skia GPU compositing.
- Idle Memory Recovery: Scheduled an automated debounced 1.5-second idle trim hook after particle bursts settle to return memory directly to baseline.
6. Institutional Memory & Governance
- What Changed: Codified strict architectural standards and mistake guardrails in AGENTS.md, established history.md as the living project changelog, and mandated grouped and staged git commit procedures.
- Technical Details: Added pre-planning validation rules and mistake logging protocols across all development workflows.
Git Commits Covered by This Release
- 3ecd9c7: docs: update history.md with memory optimization and scroll sync changelogs
- 8f876a0: fix(editor): preserve scroll position when toggling Markdown edit and preview modes
- b1b650b: perf(settings): optimize heart sprout particle rendering and GPU memory usage
- 152eb8c: perf(backend): broaden memory trimming to all windows and settings teardown
- e03aae5: docs(history): log Settings and About UI enhancements and sprouting heart cluster burst
- 17d18bc: feat(settings): enhance About layout alignment, brand hover glow, and update button pulse
- e1bebd4: feat(ui): add monochrome icons and spammable sprouting heart particle utility
- cfb4e04: chore(release): bump application version to 4.1.0
- c41c920: docs(history): record Settings window sizing change and flexbox scroll mistake guardrail
- 43c5752: feat(settings): enable hidden-scrollbar scrolling and balance About card layout
- b3c38a7: fix(window): restore Settings window inner dimensions to compact 350x318
- 4aa44a7: docs(agents): establish history.md and codify agent workflow governance rules
- a84a499: feat(editor): integrate PreviewService and preview mode file loading
- c45ff85: feat(settings): add Markdown Preview default toggle and expand window height