Replaces custom modal implementation with Obsidian's Modal class for improved consistency and accessibility
Enhances API key management with dynamic model refreshing and fallback handling
Improves event handling and modal interaction patterns
Replace hardcoded model list with dynamic API-based model fetching
that queries the Anthropic models endpoint. Implements 24-hour caching
with automatic fallback to hardcoded models if API is unavailable.
Changes:
- Add ModelService to fetch and cache available models from API
- Implement 24-hour TTL cache persisted in plugin data
- Update AnthropicClient with fetchModels() method
- Modify settings UI to load models asynchronously with loading states
- Auto-refresh models when API key is entered or changed
- Display model names using display_name field from API
- Preserve user's selected model across updates and restarts
- Show notice when falling back to hardcoded model list
- Change model type from strict enum to string for dynamic support
Technical details:
- New ModelInfo and ModelsListResponse interfaces for API response
- ModelCache interface with timestamp for TTL validation
- FreewritingCleanupData extends settings to include cache
- Settings dropdown disabled during model fetch/refresh
- Fallback to ANTHROPIC_MODELS constant on API failure
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Ensures that the modal element is not null before attempting to append it to the document body or remove it from its parent node. This prevents potential errors if the modal element is not properly initialized.
Replaces innerHTML usage with Obsidian's safe DOM manipulation methods:
- Line 150: Use createEl() and appendText() for commentary style display
- Lines 159-168: Build usage instructions with createEl() instead of innerHTML
This addresses the Obsidian Review Bot security warning and follows
the official guidelines: https://docs.obsidian.md/Plugins/User+interface/HTML+elements🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix command name from "Clean Up Freewriting" to "Clean up text" to follow Obsidian guidelines (no plugin name in command)
- Replace inline JavaScript styles with CSS classes for better theme compatibility
- Add proper CSS styles in styles.css for textarea and description elements
- Correct license information in README from MIT to GPL v3 to match actual LICENSE file
- Update README documentation to reflect new command name
These changes address common Obsidian plugin review feedback:
- Avoid assigning styles via JavaScript
- Command names should not include plugin name
- Maintain consistency between documentation and actual license
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Adds a plugin to clean up freewriting text using the Anthropic API.
This initial commit introduces core functionality, including:
- API client for interacting with Anthropic's Claude models.
- Service for orchestrating cleanup operations and managing API calls.
- Command for executing the cleanup process on selected text within Obsidian editor.
- Settings tab for configuring the API key, model, prompts, and commentary preferences.
- Type definitions for settings, API requests/responses, and cleanup results.
The plugin provides a command to clean up selected text, apply custom prompts, and optionally generate commentary on the freewriting session.