Skip to content

Fix CSS snippet creation and cleanup in callout manager#370

Merged
ebullient merged 2 commits intomainfrom
claude/reverent-lalande
Mar 28, 2026
Merged

Fix CSS snippet creation and cleanup in callout manager#370
ebullient merged 2 commits intomainfrom
claude/reverent-lalande

Conversation

@ebullient
Copy link
Copy Markdown
Owner

Changes

  • Improved snippet management: Enhanced setUseSnippet() to properly disable and remove CSS snippets when the feature is toggled off
  • Fixed snippet directory creation: Added logic to create the snippets directory if it doesn't exist before writing the snippet file
  • Simplified write operation: Unified file creation and update into a single write() call for cleaner code
  • Updated documentation: Added note to settings that CSS snippet is required for correct rendering in popout windows

Fixes

  • Prevents errors when snippet directory structure doesn't exist
  • Ensures proper cleanup when disabling the snippet feature
  • Better error handling for file removal

ebullient and others added 2 commits March 28, 2026 17:55
- Replace vault.create() (needs relative path) with vault.adapter.write()
  (handles absolute paths) to fix silent failure on first snippet creation
- Ensure snippets directory exists before writing
- Disable and delete snippet file when useSnippet is toggled off,
  preventing ENOENT on restart from orphaned Obsidian CSS config

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Closes #344

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ebullient ebullient merged commit 9d34644 into main Mar 28, 2026
1 check passed
@ebullient ebullient deleted the claude/reverent-lalande branch March 28, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant