Commit Graph
10 Commits
Author SHA1 Message Date
AlexKucera e96ef65200 Added DocStrings 2025-10-24 13:09:10 +02:00
AlexKucera 92e109e2e8 Fixes timed prompts generation race condition
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
2025-10-24 12:59:19 +02:00
AlexKucera 6875a7c06c Adds user notification for ongoing timed prompts
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
2025-10-24 11:18:29 +02:00
AlexKucera b8b701d78b Simplifies cursor placement after prompt insertion
Removes conditional logic for setting the cursor position
after inserting a prompt. Now, the cursor is consistently
placed at the end of the inserted text, regardless of the
previous cursor location. This change ensures consistent behavior
and simplifies the code.
2025-09-26 08:20:00 +02:00
AlexKucera 9249897d27 Prevents race conditions in timed prompts
Adds a flag to prevent the timed prompt execution from running concurrently, avoiding potential race conditions and unexpected behavior.

Also, addresses edge case in the status check where the displayed current prompt number could be inaccurate.
2025-09-26 08:18:13 +02:00
Jarvis 143097a973 fix: improve TypeScript type safety
- 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>
2025-09-21 08:02:16 +02:00
Jarvis 4786e7647d refactor: rename "Staggered Prompts" to "Timed Prompts" for clarity
Renames command terminology throughout codebase to better reflect
regular interval delivery rather than irregular/staggered timing.

Changes:
- Rename staggeredPrompts.ts → timedPrompts.ts
- Update class StaggeredPromptsCommand → TimedPromptsCommand
- Update command IDs: staggered-prompts → timed-prompts
- Update user-facing labels in settings and README
- Update property names: staggeredCount → timedCount
- Update method names: generateStaggeredPrompts → generateTimedPrompts
- Update API constants and type annotations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-21 07:53:48 +02:00
AlexKucera eaab2012db Improves staggered prompt display timing
Ensures prompt notifications display correctly
by adjusting the notification duration based
on the configured delay. Prevents potential overlap
between successive prompts.
2025-09-20 10:52:41 +02:00
Jarvis 49e3f5523c fix: address Obsidian review bot issues
- 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>
2025-09-20 10:32:35 +02:00
AlexKucera 44936775cd Implements freewriting prompts plugin
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
2025-09-19 18:51:48 +02:00