github Epistates/treemd v0.4.2

latest releases: v0.6.0, v0.5.12, v0.5.11...
8 months ago

[0.4.2] - 2025-12-02

Fixed

What's Changed

  • Add Homebrew installation instructions by @gromgit in #6
  • docs: add installation instructions for Arch Linux by @orhun in #7
  • fix: display link targets inline to prevent layout shift in link navigator by @kanatti in #9
  • fix: prevent infinite scrolling in help popup and refactor help text by @kanatti in #11

Details

  • Sub-headings not displayed in content pane - Fixed regression where sub-headings within a section were not rendered in the content pane (#10)

    • Added Block::Heading variant to the parser's block types
    • Sub-headings now render with proper styling (colored, bold, underlined) matching the screenshot in README
    • Content structure and hierarchy are preserved when viewing sections
  • Link selection visibility in interactive mode - Selected links now have clear visual highlighting

    • Previously only a block-level arrow indicated selection, making it unclear which specific link was selected
    • Now selected links show a prefix indicator that moves with the selection
    • Plus cyan background highlight (matching table cell selection style)
    • Also applies to images in interactive mode
  • Help popup infinite scroll - Prevented scrolling past the end of help content (PR #11)

  • Numbered lists with nested code blocks - Fixed markdown display issue where numbered list items containing code blocks would render incorrectly (#8)

    • List items now properly contain their nested code blocks, blockquotes, and other block elements
    • Parser correctly associates indented blocks with their parent list items
    • Renderer handles nested block rendering within list item context

Changed

  • Link navigator layout stability - Link targets now display inline to prevent layout shift when cycling through links (PR #9)
    • Previously, selected links showed target on a separate line causing list to jump
    • Now all links show target inline (e.g., [1] Link Text → target) for stable navigation

Refactored

  • Help text module - Extracted help text content into dedicated src/tui/help_text.rs module (PR #11)

    • Uses typed HelpLine enum for clean separation of data and rendering
    • Compile-time const construction with const fn builders
    • Makes help content easily maintainable and extensible
  • TUI UI module architecture - Refactored monolithic ui.rs (~1700 lines) into modular components for better maintainability

    • ui/mod.rs (~940 lines) - Core rendering orchestration
    • ui/util.rs (~265 lines) - Utility functions: centered_area, detect_checkbox_in_text, align_text
    • ui/popups.rs (~460 lines) - Popup rendering: help, link picker, search, theme selector, cell edit
    • ui/table.rs (~460 lines) - Table rendering: render_table, render_table_row, TableRenderContext
    • Added comprehensive unit tests for extracted modules (29 new tests)
    • Zero regressions - all 90 tests pass

Technical

  • Parser improvements (src/parser/content.rs, src/parser/output.rs)

    • Added Block::Heading variant with level, content, and inline elements for sub-heading support
    • Added Block::ListItemStart variant to track list item context during parsing
    • parse_content() now parses headings within content and creates Block::Heading blocks
    • Nested blocks are properly associated with their parent list items instead of being siblings
  • UI module organization (src/tui/ui/)

    • Clean separation of concerns: utilities, popups, tables, and core rendering
    • Each module has focused responsibility and comprehensive test coverage
    • Added ContentBlock::Heading rendering with level-appropriate colors and styling
    • render_inline_elements() now accepts optional selection index for inline element highlighting
    • Links and images in interactive mode get background highlight when selected
    • Improved code discoverability and maintainability

New Contributors

Full Changelog: v0.4.1...v0.4.2

Don't miss a new treemd release

NewReleases is sending notifications on new releases.