Updates capitalization in command names and settings labels to enhance
UI consistency. Replaces element creation with a standardized heading
approach for setting sections, ensuring a cohesive design throughout
the plugin settings interface. Fixes element reference inconsistency.
Improves user experience by providing clear and uniform interface
elements.
Improves user input validation for settings by:
- Adding min/max range limits to numeric settings
- Enforcing input type as number for better UX
- Ensures settings inputs have appropriate constraints
Validates timed count, delay, and note prompt settings with specific numeric ranges
Improves model dropdown handling with debounced settings save
Adds model list cache clearing functionality
Handles edge cases for model availability and selection
Introduces more robust error handling for model dropdowns
Provides user control over model list refreshing
Introduces debounce mechanism for settings saves to reduce unnecessary disk writes
Refactors settings change handlers to:
- Improve performance by debouncing save operations
- Simplify async method handling
- Prevent excessive API calls and disk writes
- Add more robust handling of model loading and settings updates
Enhances user experience by minimizing unnecessary background operations
Enhances model selection resilience by adding detailed fallback notifications
Adds model ID check before changing default model to prevent unnecessary updates
Improves user experience with more informative model unavailability notices
Removes redundant API key update and settings save operations
Supports dynamic model management on model refresh
Implements debounce timer to prevent excessive API calls when updating API key
Prevents rapid repeated model refreshes by:
- Adding a 500ms delay timer
- Clearing previous timers to avoid multiple concurrent requests
- Cleaning up timers when settings tab is hidden
Improves performance and reduces unnecessary API load during key entry
Refactors model loading to prevent UI blocking
Adds fallback mechanism for model selection
Ensures smooth dropdown population and model persistence
Handles cases where previously selected model may no longer be available
Adds null check when selecting fallback model to prevent potential errors
Ensures graceful handling when the current model becomes unavailable by verifying a fallback model exists before setting it
Handles scenario where previously selected AI model is no longer available
Automatically selects the first available model and notifies the user when their current model is removed, improving user experience and preventing potential configuration errors
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
- FreewritingPromptsData 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>
- Replace any types with proper Obsidian API types
- Add App type import for better type safety
- Add ButtonComponent type for settings button parameter
- Add null safety for button text content
- Remove redundant "Settings" from settings tab heading
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Move inline styles from TypeScript to CSS for better theme compatibility
- Remove "Freewriting" from command names to follow Obsidian conventions
- Fix TypeScript type casting by properly typing model as AnthropicModel
- Update to latest Claude models including Opus 4.1 and Sonnet 4
Changes:
• commands/staggeredPrompts.ts: Replace inline styles with CSS class
• main.ts: Rename commands to "Show Staggered Prompts" and "Add Note Prompts"
• settings.ts: Remove 'as any' cast and update default model
• styles.css: Add .freewriting-prompt-notice class with proper styling
• types.ts: Change model field type from string to AnthropicModel
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Updates the default staggered example prompt to provide a more open-ended starting point. This aims to encourage more creative and diverse initial responses from users.
Initial implementation of the Freewriting Prompts plugin.
This commit introduces the core functionality for generating
AI-powered writing prompts using Anthropic's Claude API.
It includes:
- API client for interacting with the Anthropic API
- Services for generating and caching prompts
- Commands for displaying staggered prompts and appending prompts to notes
- Settings tab for configuring the plugin