Refines user-facing text in error notices and settings to improve
clarity and user experience. Standardizes settings header creation,
updates placeholder text, and simplifies setting descriptions.
Simplifies commentary prompt assignments and streamlines
the Freewriting Cleanup Plugin command registration.
Improves consistency and readability in the settings interface
by standardizing heading and button labels. Removes redundant
model selection logging.
This enhances user experience by making the interface
more intuitive and declutters the codebase for easier maintenance.
Revises token and character limit constants with more precise descriptions
- Increases default max output tokens from 4000 to 8192
- Expands documentation explaining token-to-character estimation
- Provides context about current Claude model token limits
- Clarifies variability in character-to-token conversions
Introduces debounced settings save to reduce unnecessary disk I/O during rapid user interactions
Improvements include:
- Adds scheduleSave method to prevent excessive writes
- Updates settings change handlers to use debounced save
- Updates usage limits text with dynamic token/character references
Enhances plugin performance and user experience
Adds comprehensive documentation for all major classes and methods in the Freewriting Cleanup plugin
Improves code readability by:
- Adding detailed JSDoc comments explaining purpose and functionality
- Clarifying method behaviors and input/output expectations
- Providing inline context for complex operations
Standardizes error handling and adds more robust validation across services
Improves model selection logic to automatically switch to the first available model when the current model is no longer valid
Adds fallback mechanism to prevent potential configuration errors
Logs model switching for debugging and transparency
Modifies display method to load models asynchronously in the background
Improves user experience by:
- Removing async modifier from display method
- Handling model loading as a background task
- Adding error handling for model loading
- Preparing to update UI dynamically when models are loaded
Improves model retrieval strategy for scenarios with invalid/missing API keys
Adds immediate fallback model generation when API key is invalid
Ensures consistent model caching for both API and fallback scenarios
Sorts model options alphabetically for improved user experience
Introduces new getFallbackOptions() method for direct fallback access
Refactors model refresh and error handling to provide more robust model selection
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.