Recomputes pagination first and last IDs after sorting models to ensure consistent
ID references match the sorted array order.
Prevents potential misalignment between sorted model list and pagination metadata
Adjusts notification display duration calculation for more predictable behavior
Improves timing logic for prompts with different delay intervals:
- Ensures notifications end 500ms before next tick for delays >1s
- Maintains minimum 300ms display time to prevent flickering
- Keeps existing logic for short delay intervals
Prevents potential formatting issues by ensuring prompts are single-line and trimmed
Collapses multiple whitespaces and trims prompt text to maintain clean, uniform list rendering in markdown output
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
Enhances API ping check to handle multiple text content blocks
Modifies response text extraction to:
- Process all text content blocks
- Support multiple text segments
- Normalize and validate ping response more comprehensively
Increases reliability of API connection verification
Enhances notification display logic to prevent flicker and ensure minimum visibility
- Adds floor of 0 for delay milliseconds to prevent negative values
- Ensures minimum notification duration of 300ms to improve user experience
- Maintains existing logic for longer delay times
Adds sorting for model dropdown to ensure consistent user experience across sessions
Enhances prompt extraction by supporting more list prefix formats, improving robustness of text parsing
Refactors cursor handling to use setCursor instead of setSelection when collapsing selections
Improves timestamp generation by using environment's default locale automatically instead of manually specifying language
Enhances code clarity and simplifies locale handling for timestamp formatting
Clears model cache when API key changes to ensure accurate model list access
Prevents potential issues with stale model entitlements when switching API keys programmatically
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
Extracts common model fetching logic into shared method to prevent duplicate API calls
Improves error handling and caching for model retrieval by:
- Creating a centralized fetchWithDeduplication method
- Adding model type filtering in cache update
- Resetting fallback notice flag during cache clearing
Enhances reliability of model list retrieval across multiple service methods
Adds robust pagination handling for Anthropic model retrieval:
- Implements duplicate model filtering
- Adds iteration limit to prevent infinite loops
- Introduces cursor advancement validation
- Fixes potential API pagination edge cases
Ensures more reliable and predictable model list retrieval
Prevents duplicate API calls by tracking in-flight requests
Ensures consistent prompt generation under high concurrency
Mitigates potential race conditions in prompt retrieval
Improves performance and reliability of prompt generation service
Updates model type to use ModelId type for stronger type safety
Improves hardcoded model list with TODO for keeping it current
Removes outdated comments and simplifies model list annotations
Prepares for more dynamic model handling with explicit update guidance
Refines notification display timing logic to prevent flickering and ensure smoother user experience
Adjusts notification duration calculation for short delays, using a more nuanced approach that:
- Caps notification time at 900ms or delay-100ms for very short intervals
- Maintains existing behavior for longer delays
Centralizes API base URL and version configuration for improved maintainability
Adds constants for API base URL and version to prevent potential drift
Normalizes API version header usage across request methods
Improves ping validation to handle variations in response text
Supports more robust and consistent API client configuration
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
Uses the user's preferred language locale for timestamp formatting, enhancing regional customization and user experience
Allows automatic fallback to 'en-US' if navigator language is unavailable
Adds comprehensive error handling for plugin data loading to prevent potential startup failures
Implements graceful fallback to default settings when data loading fails or is corrupted
Ensures plugin can initialize even with invalid or missing persistent data
Separates model cache extraction to prevent type drift and improve data integrity
Adds deduplication of concurrent API calls to prevent redundant requests
Enhances error handling by preferring stale cache over hardcoded fallback models
Introduces new getStaleCacheModels method to provide more robust model retrieval
Prevents multiple simultaneous model fetch attempts with in-flight request tracking
Updates ESLint configuration to:
- Use latest globals for Node.js and browser environments
- Enable type-aware TypeScript ESLint rules
- Improve parser and ecmaVersion settings
- Add explicit TypeScript ESLint plugin
Increases code quality and type safety for the project
Enhances execution flow to prevent race conditions during async prompt generation
Refines inProgress flag management to ensure reliable concurrent execution:
- Sets flag before async work begins
- Guarantees flag reset in finally block
- Prevents potential state inconsistencies during rapid command triggers
Clarifies code comments explaining concurrency protection mechanism
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
Improves settings loading and saving by preventing model cache merging and tracking API key changes
Prevents type drift in settings by destructuring saved data
Adds tracking of last API key to avoid unnecessary prompt generator updates
Ensures only meaningful settings are merged with defaults
Reduces redundant operations and improves plugin performance
Trims generated prompts to requested count
Ensures consistent user experience by slicing array if model over-generates
Prevents potential cache key mismatches due to inconsistent prompt counts
Adds a session-based flag to prevent repeated fallback notices during API failures
Implements model list deduplication to handle potential duplicate entries
Prevents spamming users with repeated error notifications
Resets notice flag on successful model fetches to allow future warnings
Enhances API client with more reliable pagination and response handling:
- Uses URLSearchParams for clearer parameter management
- Increases pagination limit to 1000 to reduce API calls
- Adds more robust content parsing for multi-block responses
- Implements stricter API health check validation
Ensures more predictable and resilient API interactions
Refactors active note validation into a dedicated static method for improved readability and reusability
Enhances code maintainability by centralizing the check for valid editor and view
Refines notification display duration for timed prompts to handle both short and long delay intervals
Adjusts duration calculation to:
- Cap notifications at 500ms for very short delays
- Subtract 500ms from longer delays to prevent prompt overlap
- Ensures smoother user experience during prompt sequences
Refreshes hardcoded fallback model list with recent Claude AI model releases
Adds newest model versions:
- Sonnet 4.5
- Haiku 4.5
- Opus 4.1
Reorganizes model list for clarity, keeping legacy models for backward compatibility
Migrates ESLint configuration to new flat config format
Upgrades TypeScript and ESLint dependencies to latest versions
Removes legacy .eslintignore and .eslintrc files
Consolidates linting configuration into a single eslint.config.mjs file
Improves project code quality and linting consistency
Refines text insertion handling for writing prompts:
- Collapses text selection before insertion
- Adds more intelligent newline management
- Uses Intl.DateTimeFormat for consistent timestamp generation
Enhances edge case handling for cursor and text positioning
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
Enhances models fetching to handle paginated API responses
Implements robust pagination mechanism to retrieve all available models
- Continues fetching pages while 'has_more' is true
- Accumulates models across multiple API calls
- Preserves first and last page identifiers
- Ensures complete model list retrieval
Improves error handling and response validation
Enhances type checking and validation for API response structure
Adds more robust type validation to ensure:
- Correct response object structure
- Presence of required model fields
- Type safety for model data retrieval
Prevents potential runtime errors by implementing stricter type checks
Improves models API response handling by adding structural validation
Ensures that the API response contains an array of model data before processing
Prevents potential runtime errors from unexpected response formats
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
Reorders initialization of in-progress flag to prevent potential race conditions during timed prompt generation
Ensures that the in-progress status is set before stopping existing sequences and generates prompts
Reduces max tokens for timed prompts to improve latency and cost-efficiency
Introduces dynamic max_tokens configuration based on prompt type, using a smaller token limit for time-sensitive requests
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
Improves model retrieval by adding API key validation check for both model fetching methods
Adds fallback to predefined models when no API key is present
Sorts model lists alphabetically by display name for consistent presentation
Enhances robustness of model service handling
Introduces ModelId type alias to clarify model ID intent
Refines prompt generator type to support specific prompt types
Improves type safety for model and prompt configuration
Enforces Claude model selection as a mandatory setting
Prevents configuration submission without specifying a valid Claude model to ensure proper API interaction and prevent potential errors
Combines data loading for settings and model cache
Reduces redundant data loading steps and improves initialization efficiency
Supports dynamic model handling on the dynamic-models branch
Updates error notification to provide clearer feedback when API model retrieval fails
Enhances user experience by making the fallback model list error message more descriptive and informative
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
Prevents multiple simultaneous timed prompt generations by displaying a notice when an operation is already in progress
Improves user experience by providing clear feedback during concurrent prompt generation attempts
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>