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
Enhances error reporting for different API error scenarios by:
- Adding a generic API error handler for unspecified status codes
- Preserving more detailed error information when possible
- Providing clearer user notifications for various error types
Enhances error handling for Anthropic API client:
- Adds specific handling for 429 (rate limit) errors
- Improves authentication error detection
- Modifies text extraction to capture multiple response blocks
Provides more robust and informative error responses during API interactions
Adds more granular error types and handling for API interactions
Improves token estimation with safety margin
Introduces duration tracking for cleanup operations
Provides clearer user feedback for various error scenarios including authentication, rate limiting, and network issues
Enhances request retry mechanism to avoid unnecessary retries on non-transient errors
Adds specific error handling to prevent retrying:
- API key configuration errors
- Client-side API errors (4xx status codes)
Ensures more efficient and targeted retry strategy that avoids wasting API quota
Updates error notices to display specific error messages instead of static text
Provides more informative feedback to users when cleanup process encounters issues
Simplifies error handling by allowing the command layer to manage user feedback
Prevents potential redundant error notices and improves separation of concerns
Introduces a comprehensive custom error hierarchy for more precise error management in API calls
Replaces generic error throwing with specific error types:
- Adds custom error classes for various API-related scenarios
- Improves error handling in cleanup and API client components
- Enables more informative and type-safe error tracking
Enhances error reporting and debugging capabilities for Anthropic API interactions
Extracts common fallback model caching logic into a new private method `cacheFallbackModels()`
Reduces code duplication in model retrieval methods by centralizing fallback model caching
Improves code readability and maintainability by consolidating repetitive logic
Adds descriptive docstring to explain the purpose of the new helper method
Enhances error messaging for custom commentary style to provide more specific guidance
Clarifies that a custom prompt is required when selecting custom commentary style, making the error message more informative and user-friendly
Eliminates redundant empty selection check in cleanup command
Allows processing of empty selections by removing the initial validation
preventing user action when no text is selected
Removes redundant text info formatting method and associated info reporting from selection validation
Streamlines validation process by focusing solely on checking text eligibility
Allows first_id and last_id to be null when no models are present
Improves type safety by explicitly handling edge cases in model list responses, preventing potential null reference issues
Expands stop_sequence type from null to allow string values
Improves type flexibility by making stop_sequence nullable with string support, enabling more precise type representation for Anthropic response handling
Prevents notification fatigue during API failures by throttling error messages
Introduces new method to limit error notices to once per minute when fetching models fails
Refactors model fetching error handling to use a consistent conversion method
Improves user experience by reducing repetitive error notifications
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
Refactors settings loading to exclude model cache from persisted settings
Modifies command registration to use prefixed ID for better stability and collision prevention
Enhances type safety and plugin configuration management
Refactors error handling in cleanup command execution
- Moves loading notice hide to finally block for consistent dismissal
- Enhances error message formatting with locale-specific number formatting
- Imports character and token limit constants for more dynamic error messages
- Renames unused view parameter to indicate intentional non-use
Improves user experience by providing more readable error notifications
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
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.
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.