Commit graph

3 commits

Author SHA1 Message Date
m-kk
72e06490bf 🐛 fix: data-integrity and lifecycle bugs found in code review
- TOC section now identified only by heading title match (custom title +
  known aliases), never by list-content heuristics — an ordinary section
  with bullets can no longer be deleted as a false-positive TOC
- insertion position computed from the content string inside vault.process,
  not from stale metadata-cache line numbers — fixes TOC landing inside or
  above frontmatter; manual path writes content first, frontmatter second
- drop lastUpdate timestamp; auto-update is now idempotent (no edit when
  the TOC is unchanged), ending the perpetual modify→update loop
- auto-update no longer touches frontmatter; delete hand-rolled YAML
  serialization (FrontmatterManager) — processFrontMatter is the only
  frontmatter writer
- single EventRef for the modify listener; toggling auto-update off now
  takes effect immediately and repeated saveSettings no longer stacks handlers
- duplicate heading names render as plain text (wikilinks cannot address
  2nd+ occurrences); regex patterns validated in settings UI and compiled
  once per generation (timing-probe pseudo-validation removed)
- remove dead code: TOCEditorExtension, debug command, unused constants
- new command: Remove table of contents (section + frontmatter key)
2026-07-09 22:11:33 -05:00
m-kk
582729fb08 🔧 fix: address Obsidian community plugin review requirements
- Remove custom color overrides from styles.css for theme compatibility
- Remove overly broad CSS selectors (now minimal styling to avoid conflicts)
- Replace manual frontmatter parsing with MetadataCache.getFileCache(file)?.frontmatter
- Replace custom debounce implementation with Obsidian's built-in debounce method
- Replace Vault.modify with Vault.process for background file modifications
- Replace manual frontmatter updates with FileManager.processFrontMatter
- Use frontmatterPosition from getFileCache instead of manual parsing
- Remove redundant 'General' heading from settings tab

This addresses all required changes from the Obsidian plugin review:
https://github.com/obsidianmd/obsidian-releases/pull/7753#issuecomment-3513967948

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 15:44:11 -06:00
m-kk
6c30ef79eb 🚀 feat: initial release of Table of Contents Generator v1.0.0
Complete Obsidian plugin for generating clean, trackable table of contents using frontmatter metadata. Features invisible TOC markers, smart H1-aware positioning, automatic updates, and comprehensive configuration options.

Key Features:
- Invisible frontmatter-based TOC tracking (no HTML markers)
- Smart positioning after last H1 or document start
- Surgical content updates preventing cursor jumps
- Pre-compiled regex patterns (75% performance improvement)
- Comprehensive ReDoS protection against malicious patterns
- Auto-update with debounced change detection
- Configurable heading depth, exclusion patterns, and links
- Modern TypeScript architecture with strict type checking
- Service-oriented design with clean separation of concerns

Security & Performance:
- Enhanced ReDoS protection (10+ dangerous patterns)
- Memory-efficient operations with proper cleanup
- Single-pass DOM operations and optimized caching
- Modern build system with esbuild 0.25.9

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 15:03:32 -05:00