From 49e3f5523c0242268256fd633345cf5c0d5f9606 Mon Sep 17 00:00:00 2001 From: Jarvis Date: Sat, 20 Sep 2025 10:32:35 +0200 Subject: [PATCH] fix: address Obsidian review bot issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- commands/staggeredPrompts.ts | 6 +----- main.ts | 12 ++++++------ settings.ts | 4 ++-- styles.css | 15 +++++++++------ types.ts | 13 +++++++------ 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/commands/staggeredPrompts.ts b/commands/staggeredPrompts.ts index fed2229..d27bdfe 100644 --- a/commands/staggeredPrompts.ts +++ b/commands/staggeredPrompts.ts @@ -86,13 +86,9 @@ export class StaggeredPromptsCommand { 8000 // Show for 8 seconds ); - // Add some styling to make it more prominent + // Add CSS class for styling const noticeEl = notice.noticeEl; if (noticeEl) { - noticeEl.style.maxWidth = '400px'; - noticeEl.style.whiteSpace = 'pre-wrap'; - noticeEl.style.fontSize = '14px'; - noticeEl.style.lineHeight = '1.4'; noticeEl.addClass('freewriting-prompt-notice'); } } diff --git a/main.ts b/main.ts index f22f5ac..916ba97 100644 --- a/main.ts +++ b/main.ts @@ -59,19 +59,19 @@ export default class FreewritingPromptsPlugin extends Plugin { // MARK: - Command Registration private registerCommands() { - // Staggered Freewriting Prompts command + // Staggered prompts command this.addCommand({ - id: 'staggered-freewriting-prompts', - name: 'Staggered Freewriting Prompts', + id: 'staggered-prompts', + name: 'Show Staggered Prompts', callback: async () => { await this.executeStaggeredPrompts(); } }); - // Freewriting Prompt command (editor-based) + // Note prompt command (editor-based) this.addCommand({ - id: 'freewriting-prompt', - name: 'Freewriting Prompt', + id: 'note-prompts', + name: 'Add Note Prompts', editorCallback: async (editor: Editor, view: MarkdownView) => { await this.executeNotePrompts(editor, view); } diff --git a/settings.ts b/settings.ts index 20436db..1603522 100644 --- a/settings.ts +++ b/settings.ts @@ -7,7 +7,7 @@ import { FreewritingPromptsSettings, ANTHROPIC_MODELS } from './types'; export const DEFAULT_SETTINGS: FreewritingPromptsSettings = { apiKey: '', - model: 'claude-3-haiku-20240307', + model: 'claude-3-5-haiku-latest' as const, staggeredCount: 10, delaySeconds: 6, noteCount: 3, @@ -194,7 +194,7 @@ export class FreewritingPromptsSettingTab extends PluginSettingTab { try { const client = this.plugin.promptGenerator.anthropicClient; - const result = await client.testApiKey(this.plugin.settings.model as any); + const result = await client.testApiKey(this.plugin.settings.model); if (result.success) { // Success - show detailed information diff --git a/styles.css b/styles.css index 71cc60f..8a03090 100644 --- a/styles.css +++ b/styles.css @@ -1,8 +1,11 @@ /* - -This CSS file will be included with your plugin, and -available in the app when your plugin is enabled. - -If your plugin does not need CSS, delete this file. - +Freewriting Prompts Plugin Styles */ + +/* Styling for staggered prompt notifications */ +.freewriting-prompt-notice { + max-width: 400px !important; + white-space: pre-wrap !important; + font-size: 14px !important; + line-height: 1.4 !important; +} diff --git a/types.ts b/types.ts index 15ee859..8c5e05a 100644 --- a/types.ts +++ b/types.ts @@ -3,7 +3,7 @@ export interface FreewritingPromptsSettings { apiKey: string; - model: string; + model: AnthropicModel; staggeredCount: number; delaySeconds: number; noteCount: number; @@ -47,11 +47,12 @@ export interface GeneratedPrompt { } export const ANTHROPIC_MODELS = [ - 'claude-3-haiku-20240307', - 'claude-3-sonnet-20240229', - 'claude-3-opus-20240229', - 'claude-3-5-sonnet-20241022', - 'claude-3-5-haiku-20241022' + 'claude-opus-4-1-20250805', + 'claude-opus-4-20250514', + 'claude-sonnet-4-20250514', + 'claude-3-7-sonnet-latest', + 'claude-3-5-haiku-latest', + 'claude-3-haiku-20240307' ] as const; export type AnthropicModel = typeof ANTHROPIC_MODELS[number]; \ No newline at end of file