Commit graph

16 commits

Author SHA1 Message Date
m-kk
902c8b7bdd 🔖 release: 1.1.1 — fix release-scan warnings 2026-07-10 12:35:06 -05:00
m-kk
5e9697315a 🔧 fix: restore fundingUrl with correct handle 2026-07-10 12:34:11 -05:00
m-kk
081db287ac 👷 ci: attest build provenance for release assets 2026-07-10 12:26:51 -05:00
m-kk
2ce3957300 🔧 fix: address automated release-scan warnings
- type loadData result and processFrontMatter callbacks (no-unsafe-assignment/member-access)
- remove deprecated setDynamicTooltip (slider value now shown inline)
- end manifest description with punctuation; drop unreachable fundingUrl
- replace builtin-modules package with node:module builtinModules
2026-07-10 12:26:51 -05:00
m-kk
c30a59bcab 👷 ci: update release workflow to checkout/setup-node v5, Node 22, run tests 2026-07-09 22:29:52 -05:00
m-kk
36b0ed0543 🔖 release: 1.1.0 — minAppVersion 1.7.2, rewrite README to match implementation 2026-07-09 22:11:33 -05:00
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
e11b2f955b test: add vitest and extract pure TOC logic into src/ modules
- src/toc-section.ts: string-derived TOC section find/remove/insert
- src/toc-generator.ts: TOC rendering with injected stripHeadingForLink
- src/heading-filter.ts: pattern validation/compilation, heading filtering
- 43 unit tests covering detection, insertion, idempotence, filtering
2026-07-09 22:11:33 -05:00
m-kk
24254ea092 🔧 fix: address remaining Obsidian community plugin review feedback
Addresses all outstanding review comments from PR #7753:

1. README: Added "Why This Plugin?" section explaining key differences
   from other TOC solutions (frontmatter tracking, no visible markers,
   cache integration, smart positioning)

2. Frontmatter: Replaced manual parsing with MetadataCache API
   - Now uses getFileCache(file)?.frontmatter to read frontmatter
   - Uses frontmatterPosition from cache for content splitting
   - Removed manual parseFrontmatter method (59 lines)
   - Removed unused FRONTMATTER_PATTERN constant

3. Settings: Removed redundant "Usage" heading per Obsidian guidelines
   - Kept usage information text without heading wrapper

Note: Items already addressed in previous commits:
- CSS colors: No hardcoded colors present
- Style overrides: Minimal styling with justification
- Debounce: Using Obsidian's built-in debounce (imported line 13)
- Vault API: Using vault.process (line 401)
- Frontmatter updates: Using processFrontMatter (line 393)
- Position detection: Using frontmatterPosition from cache (lines 407, 488)

Code reduction: -59 lines (removed manual YAML parsing)
Build status: ✓ TypeScript compilation successful

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-11 11:05:44 -06: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
a73b1ffa95 🐛 fix: expand abbreviations in UI text for sentence case compliance
Changed "Debug TOC metadata" to "Debug table of contents metadata" and "Exclude H1 headings" to "Exclude level 1 headings" to avoid abbreviations in user-facing text per Obsidian UI guidelines.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-07 14:38:06 -06:00
m-kk
df95e63ee7 🐛 fix: convert UI text to sentence case for Obsidian guidelines
Address plugin review requirement to use sentence case for all UI text.
Updated ribbon icon tooltip, setting descriptions, and placeholders to
follow lowercase convention (e.g., "table of contents" instead of
"Table of Contents").

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-07 11:31:48 -06:00
m-kk
057b0007e4 🔧 chore: remove redundant type annotation
Remove trivial type annotation from startIndex parameter
as it can be inferred from the default value.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-07 09:29:56 -06:00
m-kk
7cdebd6127 🐛 fix: address Obsidian community plugin review requirements 2025-11-06 18:37:12 -06:00
m-kk
24fdcc80ee 🐛 fix: address Obsidian community plugin review requirements
- Replace space literals with {2} quantifiers in regex patterns for clarity
- Add void operator to unhandled promises in callbacks
- Convert all UI text to sentence case per Obsidian guidelines
- Replace console.log with console.debug for debug output
- Remove unnecessary await of non-Promise value
- Replace 'any' types with 'unknown' for type safety
- Fix Promise returned where void expected in debounce
- Remove unnecessary escape characters in regex patterns
- Remove async keyword from non-async method insertOrUpdateTOC
- Replace HTML heading elements with Setting().setHeading() API

All changes address required fixes from ObsidianReviewBot automated review.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-06 17:04:07 -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