Enforces requirement of custom commentary prompt when custom style is selected
Prevents potential runtime errors by throwing an explicit error if custom commentary style is chosen without providing a custom prompt
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
Removes fallback to model ID for display names
Ensures consistent and user-friendly model representation
Improves model dropdown experience by requiring display names from API
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
Adds API key validation before fetching models
Ensures consistent fallback model caching on API errors or missing key
Reduces redundant code by centralizing fallback model caching logic
Relates to dynamic-models branch
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
Refactors loadSettings method to avoid redundant data loading
Reduces duplicate loadData() calls by reusing loaded data
Improves efficiency of plugin initialization process
Enhances Anthropic API client to return token usage information
Modifies cleanup service to capture and store input and output token counts from API responses
Refactors request and response handling to extract and pass usage metrics
Provides more detailed tracking of API request resource consumption
Removes strict type definition for Anthropic models to enable more dynamic model selection
Allows for flexible model ID fetching from Anthropic API
Provides a fallback list of models when direct API access is limited
Supports more adaptable model configuration in the application
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.
Refactors text validation to ensure that the cleanup process only proceeds with valid text selections.
Removes the insertion position logic as it is no longer needed.
Adapts the Anthropic client to use the new structured content format
for messages and system prompts, ensuring compatibility with the API's
expected input structure. This change modifies both the standard
request and the test request within the Anthropic client.
Updates the license badge in the README to reflect the project's licensing under GPL v3. This ensures accurate and up-to-date information regarding the project's licensing terms.
Improves plugin structure by adopting a modular architecture
with separated services, commands, and settings.
Updates documentation to reflect the new architecture,
settings management, command registration, UI components,
and resource cleanup strategies.
This change enhances maintainability, testability, and
API interaction separation.
Updates the action used for creating releases to the latest major version.
This ensures continued compatibility and access to the newest features and bug fixes provided by the action.
Updates the downloads badge URL to link to the releases page
instead of the Obsidian plugins page. This provides a more
direct route to download the plugin files.
- Update version to 1.0.2 in manifest.json, package.json, and versions.json
- Add CHANGELOG.md entry for security fixes
- Prepare for patch release with XSS vulnerability fixes
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
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 license information in package.json to match GPL-3.0
- Update command name to follow Obsidian guidelines
- Move inline styles to CSS for better theme compatibility
- Update CHANGELOG.md with version 1.0.1 changes
- Update manifest.json and versions.json
🤖 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>
Implements a GitHub Actions workflow to automate the plugin release process.
This workflow:
- Builds the plugin
- Creates a zip package of the plugin
- Generates release notes from the changelog
- Creates a GitHub release with the package and notes
Adds a changelog file to document notable changes, following Keep a Changelog format and Semantic Versioning.
This file details the features, technical implementation, and initial release information for the Freewriting Cleanup plugin.
Creates a comprehensive README file that explains the plugin's features, installation, usage, configuration, troubleshooting, development setup, contribution guidelines, license, and support information.
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.
Replaces the existing proprietary license with the GNU General Public License version 3.
This ensures that the software adheres to the principles of free and open-source software.
Sets up the basic project structure for the "Freewriting Cleanup" Obsidian plugin.
This includes:
- Adding necessary configuration files (.gitignore, package-lock.json, tsconfig.json, etc.)
- Creating a manifest file with plugin metadata
- Adding initial project files
- Adding documentation about the project
This setup provides a foundation for developing the plugin's functionality to clean up freewriting typos using AI.