Documentation Index

June 9, 2026 · View on GitHub

Core Context


Technical Documentation

Configuration & Setup

DocumentDescription
Project SetupInitial project configuration, dependencies, and build setup
Error HandlingCentralized error system, Result type, logging, graceful degradation
Settings & ConfigSettings struct, serialization, validation, sanitization
Config PersistencePlatform-specific config storage, load/save functions, fallback handling
Log Level ConfigConfigurable log verbosity via config.json and --log-level CLI flag
Internationalizationrust-i18n integration, Language enum, translation keys, adding languages
Multi-Encoding SupportCharacter encoding detection (chardetng), manual selection, save in original encoding
Snippets SystemText expansion system with built-in date/time snippets and custom user snippets
New File Save PromptSkip save prompt for unmodified untitled files, should_prompt_to_save(&Settings) logic
Quick note workflowEphemeral untitled tabs: on by default (no-prompt quit; tab close still prompts); turn off in Settings; session recovery; rename
Default View ModePer-file-type default view mode configuration
Code execution settingsOpt-in prefs for markdown code-block runners (timeout, shell/Python gates)

Editor Core

DocumentDescription
ArchitectureREQUIRED READING: Core principles, complexity tiers, memory budget, anti-patterns
FerriteEditorCustom editor widget: TextBuffer, ViewState, LineCache; undo via Tab::edit_history
TextBufferRope-based text buffer for O(log n) editing operations on large files
EditHistoryOperation-based undo/redo for memory-efficient large file editing
ViewStateViewport tracking and visible line range calculation for virtual scrolling
LineCacheLRU-cached galley storage for efficient text rendering without recreation each frame
LineCache Smart InvalidationTargeted range invalidation and dynamic cache sizing for large-file editing performance
Large File PerformancePer-frame optimizations for 5MB+ files; open-time warning toast for 10MB+
Memory OptimizationTab closure cleanup, FerriteEditorStorage management, debug vs release performance
Word WrapPhase 2 word wrap support: visual row tracking, wrapped galley caching, cursor navigation
Editor WidgetText editor widget, cursor tracking, scroll persistence, egui TextEdit integration
Line Numbers & GutterGutter system with toggleable line numbers and fold indicators, dynamic width calculation
Line Number AlignmentTechnical fix for line number drift, galley-based positioning
Cursor Position MappingRaw-to-displayed text position mapping for formatted content editing
Galley Cursor PositioningPixel-accurate cursor placement using egui Galley text layout
Undo/Redo SystemPer-tab undo/redo with keyboard shortcuts (Ctrl+Z, Ctrl+Y)
Undo Hash Change DetectionBlake3 hash-based undo snapshot to eliminate per-frame content clones
Find and ReplaceSearch functionality with regex, match highlighting, replace operations
Go to LineCtrl+G modal dialog for line navigation, viewport centering
Duplicate LineCtrl+Shift+D line/selection duplication, char-to-byte index handling
Move LineAlt+Up/Down line reordering, pre-render key consumption, cursor following
Code FoldingFold region detection, gutter indicators, content hiding
Code Folding UICode folding user interface and interactions
Multi-Cursor EditingMultiple cursor support with Ctrl+Click, simultaneous editing, selection merging
Semantic MinimapSemantic minimap with clickable heading labels, content type indicators, density bars
Editor Minimap (Legacy)VS Code-style pixel minimap (replaced by semantic minimap)
Search HighlightSearch-in-files result navigation with transient highlight, auto Raw mode switch
Search Highlight Rendered ViewRendered view search highlights (incl. tables) and floating panel z-order stacking
Search Highlight Edit RecomputeFix stale search highlights after document edits by recomputing match positions
Syntax HighlightingSyntect integration for code block highlighting
Auto-close BracketsAuto-pair insertion, selection wrapping, skip-over behavior for brackets/quotes
Bracket MatchingHighlight matching brackets and parentheses
Vim ModeOptional modal editing with Normal/Insert/Visual modes, Vim keybindings
Windows IME layer transformIMEOutput in screen space via layer TSTransform (candidate box alignment)
Word Wrap Scroll FixesCorrectness fixes for pixel_to_line, line_to_pixel, scroll sync when word wrap active
Word Wrap PerformanceIncremental height cache, O(1) LRU, O(log N) visual row mapping
Ctrl+Scroll ZoomCtrl+Mouse Wheel zoom mapped to egui::gui_zoom, ZoomIn/ZoomOut/ResetZoom shortcuts
Font SystemCustom font loading, EditorFont enum, bold/italic variants, CJK/complex script lazy loading
HarfRust text shapingharfrust 0.5.2 OTL shaping: cluster grouping, shaped-line cache, per-cluster rendering
Grapheme-Cluster CursorGrapheme-cluster-aware arrow keys, backspace, delete for emoji ZWJ, Bengali, Korean
Uniform Height Large FilesUniform line heights for 100K+ line files: O(1) memory, force-disabled word wrap
Custom Font SelectionSystem font enumeration, custom font picker, CJK regional preferences
Complex Script Font PreferencesPer-script font preferences for Arabic, Bengali, Devanagari, Thai, Hebrew, Tamil, etc.
CJK Font Preloading VerificationVerification that explicit CJK preferences preload correctly at startup
Custom Font Crash PreventionMagic-byte validation, catch_unwind, graceful fallback for invalid custom fonts
Custom font picker deferred loadCustom mode waits for an explicit combo pick before loading; fixes macOS #133 toast

UI Components

DocumentDescription
Ribbon UIModern ribbon interface replacing menu bar, icon-based controls
Ribbon RedesignDesign C streamlined ribbon, title bar integration, dropdown menus
Special TabsTab-based UI panels (Settings, About/Help) replacing modal windows
Settings PanelSettings UI in a special tab, live preview, appearance/editor/files/keyboard/terminal sections
Outline PanelDocument outline side panel, heading extraction, statistics for structured files
Backlinks PanelBacklinks panel showing files linking to current file, adaptive indexing, click-to-navigate
Status BarBottom status bar with file path, stats, toast messages
About/Help PanelAbout/Help in a special tab, version info, keyboard shortcuts reference
Zen ModeDistraction-free writing mode, centered text column, chrome hiding, F11 toggle
Split ViewSide-by-side raw editor + rendered preview, draggable splitter, independent scrolling
Search Panel ViewportViewport constraints for Search panel, DPI handling, resize behavior
Quick Switcher Mouse SupportMouse hover/click fix with layer-based background, interaction overlay
Command PaletteAlt+Space searchable command launcher with fuzzy search, recent commands, deferred dispatch
Keyboard ShortcutsGlobal shortcuts for file ops, tab navigation, deferred action pattern
Keyboard Shortcut CustomizationSettings panel for rebinding shortcuts with conflict detection, persistence
Light Mode ContrastWCAG AA color tokens, contrast ratios, border/text improvements
Light Mode Strong Text FixFix invisible RichText::strong() labels in light mode
Theme SystemLight/dark/System themes, ThemeManager, user-configurable Ferrite accent (headings, selection, chrome; links stay classic blue)
Adaptive ToolbarFile-type aware toolbar, conditional buttons for Markdown vs JSON/YAML/TOML
Navigation ButtonsDocument navigation overlay for quick jumping to top, middle, or bottom
Frontmatter PanelVisual YAML frontmatter editor, form-based key-value editing, tag chips, bidirectional sync
Header SpacingAdjustable vertical spacing between headings (H1-H6) in rendered view
Check for UpdatesManual update checker via GitHub Releases API, security model, URL validation

Markdown & WYSIWYG

DocumentDescription
Markdown ParserComrak integration, AST parsing, GFM support
WYSIWYG EditorWYSIWYG markdown editing widget, source synchronization, theming
WYSIWYG InteractionsWYSIWYG user interaction patterns and behaviors
Editable WidgetsStandalone editable widgets for headings, paragraphs, lists
Editable Code BlocksSyntax-highlighted code blocks with edit mode, language selection
Code block RunRun control in rendered/split preview: background worker, ANSI inline output (CRLF-safe on Windows), ✓/✗ exit, insert-as-fenced-block, Stop + hard timeout; § Known limitations + link to manual test file
Code execution consent dialogFirst-run modal when clicking Run before consent; queues payload; Settings toggle skips modal
Code block Run cancellation & timeoutRunStatus::Cancelled, atomic cancel token, Stop button, Timed out after Ns / Stopped by user labels, reader-thread shutdown
Editable LinksHover-based link editing with popup menu, autolink support
Editable TablesGFM table editing, deferred commits, toolbar, markdown sync
Table cell focus & navigationEmpty-cell hit targets, Tab / Shift+Tab in-table (lock_focus, consume order)
Click-to-Edit FormattingHybrid editing for formatted list items and paragraphs (superseded — see Rendered edit session: formatted blocks)
Rendered edit session (overview)Architecture hub: motivation, source_epoch, BlockRef, session API, commit policy, RS-1…RS-7 / TBLE matrix, design decisions
Rendered edit session (Phase 0)Formatted blur hotfix + Tab::source_epoch; foundation before full session coordinator
Rendered edit session (core types)BlockRef, RenderedEditSession state machine and tab-scoped egui storage
Rendered edit session (headings)Headings wired to session: switch_to_ui, buffer commit, one-click cross-heading switch
Rendered edit session (paragraphs & lists)Plain paragraphs and simple list items on session; epoch invalidation; cross-block switch with headings
Rendered edit session (formatted blocks)Formatted paragraphs and list items on session: click-to-edit, display→raw cursor mapping, Enter/Escape; replaces FormattedItemEditState and formatted_exit_should_save
Rendered edit session (tables)BlockRef::TableCell activation + signal_table_force_commit one-shot signal: cross-block exit commits the table; intra-table Tab navigation preserves deferred commits
Rendered edit session (split view)rendered_editor_id(tab.id) shared by rendered-only and split preview; raw-pane epoch bumps invalidate session buffers (RS-6)
Rendered edit session (undo)One logical undo step per block commit; session keystrokes stay off the undo stack until close/switch
Rendered widget identityui.push_id(editor_id + source_epoch) for stable TextEdit ids; content_hash for culling only
Formatting ToolbarMarkdown formatting toolbar, keyboard shortcuts, selection handling
Emphasis RenderingBold, italic, strikethrough rendering in WYSIWYG
Table of ContentsTOC generation from headings, anchor links, update/insert modes
Mermaid insert toolbarFormat toolbar combo: insert fenced Mermaid templates at cursor (Raw / Split)
Mermaid syntax helpAbout / Help (F1) tab: per-diagram descriptions and snippets aligned with Insert → Mermaid…
List Editing FixesFrontmatter offset fix, edit buffer persistence, deferred commits, rendered-mode undo/redo
List Editing DebugDebugging list editing issues and fixes
Task List CheckboxInteractive task list checkboxes in rendered view; click-to-toggle with source sync; scroll-stable via structure-preserving culling
Table Editing FocusFix cursor loss during table cell editing, deferred source updates
Smart PasteURL detection, markdown link creation with selection, image markdown insertion
Image Drag & DropDrag images into editor, auto-save to assets/, insert markdown link
CJK Paragraph IndentationFirst-line paragraph indentation for Chinese (2em) and Japanese (1em)
Block Element AlignmentConsistent 4px left indent for tables, code blocks, blockquotes
GitHub-Style CalloutsGitHub-style callouts with color-coded rendering, collapse toggle
Wikilinks[[target]] syntax, file resolution, click-to-navigate, broken link indicators
Image RenderingLocal image display in rendered/split view, path resolution, texture caching
Setext Heading DetectionSingle-dash false setext fix, backwards-scan underline detection
Markdown AST CachingBlake3 content-hash AST cache to skip re-parsing unchanged markdown
Rendered View Viewport Cullingshow_viewport() two-phase culling with 500px overscan for large-document performance
Block-Level Height CachePer-block blake3-keyed LRU height cache for off-screen block measurement skip
Consecutive Fenced Blocks Fixissue #129 — horizontal ScrollArea auto_shrink_y fix so consecutive fenced blocks all stay visible
Strict Line BreaksOptional setting treating single newlines as hard <br> breaks
Lazy Block Height EstimationHeuristic heights for unmeasured blocks, render budget cap, progressive refinement
Paragraph Trailing SpacesFix for trailing spaces lost in plain paragraphs via persistent edit buffer
Rendered Paragraph Block SpacingTrailing space after block paragraphs and code blocks; viewport height alignment
Table Inline FormattingPreserve and render bold, italic, strikethrough, code in table cells (serialization + rich text display)
Video embed parsing{{video URL}} and bare YouTube paragraph syntax; VideoEmbed AST node, allowlist, round-trip source_text

Data Viewers

DocumentDescription
CSV ViewerCSV/TSV table viewer with scrolling, header highlighting, cell tooltips
CSV Lazy ParsingByte-offset row indexing for large CSVs, on-demand visible-row parsing
CSV Delimiter DetectionAuto-detect delimiter (comma/tab/semicolon/pipe), manual override
CSV Header DetectionAuto-detect header rows with heuristics, toggle UI, column alignment
CSV Rainbow ColumnsSubtle alternating column colors using Oklch, status bar toggle
CSV Raw View CachingBlake3 hash-guarded raw text cache to eliminate per-frame string allocation
Image ViewerDedicated image viewer tabs (PNG/JPEG/GIF/WebP/BMP) with zoom and metadata
PDF ViewerRead-only PDF viewer tabs with hayro rendering, page navigation, zoom
Print previewSame render_markdown_to_pdf as Export PDF; temp file → PdfViewer tab; ephemeral session/temp cleanup
Tree ViewerJSON/YAML/TOML tree viewer with inline editing, expand/collapse, path copying
Tree Viewer CachingBlake3-guarded parse cache and raw text buffer to avoid per-frame work
Live PipelineJSON/YAML command piping through shell commands (jq, yq), recent history
Document ExportThemed HTML export (options dialog, Mermaid SVG, syntect blocks), clipboard HTML, PDF export pointer
Themed HTML exportImplementation map: comrak adapter, Mermaid SVG, theme resolution, image/link post-process
PDF Exportv0.3.x: Native-Rust PDF export via krilla (fonts, page size/margins, H1 page-break dialog, link annotations)

File Operations & Workspaces

DocumentDescription
File DialogsNative file dialogs with rfd, open/save operations
Tab SystemTab data structure, tab bar UI, close buttons, unsaved changes dialog
Recent FilesRecent files menu in status bar
Workspace Folder SupportFolder workspace mode, file tree, quick switcher, search in files, file watching
Workspace File IndexBackground full-tree index for Ctrl+P and Ctrl+Shift+F (independent of lazy file tree)
Session PersistenceCrash-safe session state, tab restoration, recovery dialog, lock file mechanism
Auto-SaveConfigurable auto-save with temp file backups, toolbar toggle, recovery dialog
Git IntegrationBranch display in status bar, file tree Git status badges, git2 integration
Git Auto-RefreshAutomatic git status refresh on save, focus, and periodic intervals

Terminal Emulator

DocumentDescription
Terminal ArchitectureIntegrated terminal with PTY (portable-pty), VTE parsing, screen buffer, ANSI color
Terminal UITerminal panel with tabs, split panes, floating windows, drag-and-drop
Terminal ThemesTerminal color schemes (Solarized, Dracula, Monokai, Nord, etc.)
Terminal LayoutSplit pane layouts (horizontal/vertical), grid creation, layout save/load
Terminal CJK Wide CharsDouble-width CJK character rendering, cursor advancement, selection snapping

Productivity Hub

DocumentDescription
Productivity PanelTask management, Pomodoro timer, quick notes with workspace-scoped persistence

Async Workers

DocumentDescription
Worker InfrastructureBackground tokio runtime, channel-based UI communication, worker pattern

Platform-Specific

DocumentDescription
eframe WindowWindow lifecycle, dynamic titles, responsive layout, state persistence
eframe/egui 0.31 Upgradev0.3.0 GUI stack bump from 0.28 → 0.31.1 — breaking API migration patterns and validation
eframe/egui 0.34 Upgradev0.3.0 GUI stack bump to 0.34.2 — viewport rects, Popup API, skrifa/HarfRust, MSRV 1.92
v0.3.0 Cross-Platform Regression MatrixManual regression matrix for v0.3.0 (egui 0.31 + 0.34 delta, Task 89 §8)
Custom Title BarWindows-style custom title bar implementation
Window ResizeCustom resize handles for borderless windows, edge detection
Windows Borderless WindowTop edge resize fix, fullscreen toggle (F10), title bar button area exclusion
Windows Borderless Transparent FixFix rendering offset (black bars) on Intel GPUs via with_transparent(true) DWM workaround
Windows Path NormalizationStrip Windows \\?\ prefix from canonicalized paths
Linux Cursor Flicker FixTitle bar exclusion zone to prevent cursor conflicts with window controls
Idle Mode OptimizationTiered idle repaint system to reduce CPU usage on all platforms
SignPath Code SigningWindows code signing via SignPath for OSS
Single-Instance ProtocolLock file + TCP IPC to open files in existing window
macOS .app Bundle CICI workflow for proper macOS .app bundle packaging
macOS Gatekeeper (GitHub Releases)Unsigned CI artifacts, doc map (#130), release checklist
macOS Markdown file associationUTI for .md files, Finder Open With / default app
macOS Intel CPU OptimizationIdle repaint optimization to reduce CPU usage on Intel Macs
Intel Mac Repaint InvestigationInvestigation into continuous repaint issues on Intel Macs
Intel Mac CPU AnalysisAnalysis of CPU usage issues on Intel Mac hardware
MSI Installer FeaturesWindows MSI feature tree: file associations, context menu, PATH, desktop shortcut
Linux Portal Dialogsxdg-desktop-portal requirements for Hyprland, Sway, and minimal WMs
Linux Cinnamon DialogsX-Cinnamon desktop detection, xapp/gtk portal instructions, cancellation fix
Flatpak File Dialog PortalOpen Folder/File/Save dialogs in Flatpak via xdg-desktop-portal

Distribution & Packaging

DocumentDescription
Flathub MaintenanceHow to maintain and update Ferrite on Flathub (release checklist, moderation)
Linux Package Distribution PlanPlan for distributing Ferrite via Flathub, Snap, AUR, and native packages
Nix FlakeOfficial Nix flake for reproducible builds, dev shells, NixOS/Home Manager

Mermaid Diagrams

DocumentDescription
Mermaid DiagramsMermaidJS code block detection, diagram type indicators, styled rendering
Mermaid Text MeasurementTextMeasurer trait, dynamic node sizing, egui font metrics integration
Mermaid Modular StructureModular directory layout for diagram types, TextMeasurer trait, shared utilities
Mermaid Edge ParsingChained edge parsing fix, arrow pattern matching, label extraction
Mermaid classDef StylingNode styling with classDef/class directives, hex color parsing
Mermaid YAML FrontmatterYAML frontmatter support for diagram titles, config parsing
Mermaid CachingAST and layout caching for flowcharts, blake3 hashing, LRU eviction
Flowchart Layout AlgorithmSugiyama-style layered graph layout: cycle detection, crossing reduction, alone-on-layer branch-parent snap, resolve_layer_overlaps sibling-spacing safety net (v0.3.0)
Flowchart SubgraphsFlowchart subgraph support, nested parsing, bounding box computation
Flowchart DirectionFlow direction layout (LR/RL/TD/BT), axis transformation, edge anchoring
Flowchart Branch OrderingDecision node branch positioning, edge declaration order, barycenter algorithm
Flowchart Subgraph TitleSubgraph title width expansion, preventing title truncation
Flowchart Asymmetric ShapeAsymmetric (flag) shape rendering, text centering
Flowchart shapes & styleTrapezoid, double circle, style nodeId, color: in classDef, merge precedence
Flowchart Viewport ClippingViewport clipping fix, negative coordinate shifting
Flowchart linkStyleEdge styling via linkStyle directive, stroke color/width customization
Flowchart Crash PreventionInfinite loop safety, panic handling, graceful degradation
Subgraph Layer ClusteringSubgraph-aware layer assignment, consecutive layer clustering
Subgraph Internal LayoutSubgraph internal positioning, SubgraphLayoutEngine, bounding box computation
Subgraph Edge RoutingEdge routing through subgraph boundaries, orthogonal waypoints
Flowchart edge obstacle routingv0.3.0 FC-83a: forward-edge obstacle avoidance, painter sized from real node bounds, fixed-margin back-edge side channels, parallel back-edge lanes (E→B / F→B), inner back-edge top-corner up-first direct path
Nested Subgraph LayoutNested subgraph margins, depth calculation, direction overrides
Sequence Control BlocksSequence diagram loop/alt/opt/par blocks, nested parsing, block rendering
Sequence Activations & NotesActivation boxes, notes, +/- shorthand, state tracking
State Composite NestedState diagram composite and nested state support
State pseudostates (fork/join/history)<<fork>> / <<join>> bars and [H] / [H*] history glyphs in native state diagrams
Flowchart Modular RefactorFlowchart.rs split into 12 focused modules (types, parser, layout/, render/, utils)
Flowchart Refactor PlanOriginal analysis and refactoring plan for flowchart.rs modularization
Mermaid Inline ValidationParse-time validation: warning header (line + hint), last-good fallback, raw-editor squiggles for broken mermaid blocks
Mermaid Parity MatrixFeature/status map vs Mermaid.js, GitHub issue cross-ref, repro catalog, pre-0.3.0 rendering backlog

LSP Integration (deferred to v0.2.9 — feature-gated behind lsp Cargo feature)

DocumentDescription
LSP Integration PlanPlanning: Language Server Protocol client (diagnostics, hover, go-to-def)
LSP Module Infrastructuresrc/lsp/ — LspManager, stdio transport, extension-to-server detection
LSP Server LifecycleAuto-detect/spawn servers, crash restart with backoff, clean shutdown
LSP Windows — No ConsoleCREATE_NO_WINDOW on LSP Command spawn to prevent cmd.exe flash
LSP Status & OverridesStatus bar per-server state, lsp_server_overrides, Editor settings UI
LSP On-Demand StartupLazy server spawn on tab activation, idle shutdown, didClose on tab close
LSP Inline DiagnosticsInline squiggles (error/warning), hover tooltips, didOpen/didChange sync

Planning & Roadmap

DocumentDescription
Custom Editor Widget Planv0.3.0 planning: Replace egui TextEdit with custom FerriteEditor widget
Memory Optimization Planv0.2.6 planning: Reduce idle RAM from ~250MB to ~100-150MB
Custom Memory AllocatorPlatform-specific allocators (mimalloc/jemalloc) for reduced fragmentation
egui Memory CleanupClean up rendered editor temp data in egui memory on tab close
Viewer State CleanupMemory leak fix: cleanup viewer state HashMaps on tab close
Dead Code CleanupTask 39 cleanup summary, removed code, module changes
app.rs Refactoring PlanSplit 7,634-line app.rs into ~15 focused modules under src/app/
Mermaid Crate PlanExtract Mermaid renderer as standalone pure-Rust crate
Math Support Planv0.4.0 planning: Native LaTeX/TeX math rendering (pure Rust)
PDF Export Pipelinev0.3.x decision doc: native-Rust PDF export via krilla + krilla-svg, browser fallback retained

Performance

DocumentDescription
Per-Frame Cache Eliminationcontent_version-based caching to eliminate 7 O(N) per-frame operations for large files
Background File LoadingBackground thread loading for 5MB+ files with progress bar, cancellation support

Core (Remaining)

DocumentDescription
App StateAppState, Tab, UiState structs, undo/redo, event handling
View Mode PersistencePer-tab view mode storage, session restoration, backward compatibility
Document StatisticsStatistics panel tab with word count, reading time, heading/link/image counts
Text StatisticsWord, character, line counting for status bar
Sync ScrollingSplit-view live sync (minimap Sync / 2-way), per-pane scroll delivery, Ctrl+E mode-toggle preservation, content anchors
Configurable Line WidthMaxLineWidth setting (Off/80/100/120/Custom), text centering in all views
BrandingIcon design, asset generation, platform integration guidelines

Guides

GuideDescription
macOS install & GatekeeperUnsigned CI bundles, macOS 15.x / Sequoia, xattr quarantine removal, Open Anyway workarounds
GitHub Release checklistPre-tag, GitHub Release, Flathub, and Nix steps; macOS Gatekeeper blurb (#130)
Adding LanguagesHow to add new translations, translation portal setup, contributor workflow
Translation Status AssessmentList of user-facing strings not yet using i18n, for Weblate extraction
v0.2.6 Test SuiteManual testing checklist for FerriteEditor release
v0.2.8 Test SuiteManual testing checklist for v0.2.8 release
v0.3.0 Test SuitePre-merge manual checklist for v0.3.0 (Tasks 90–106, rendered session, session recovery)