Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/integrations/misc/image-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export async function saveImage(dataUri: string) {
// Get workspace path or fallback to home directory
const workspacePath = getWorkspacePath()
const defaultPath = workspacePath || os.homedir()
const defaultFileName = `mermaid_diagram_${Date.now()}.${format}`
const defaultFileName = `img_${Date.now()}.${format}`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change! The generic img_ prefix is more appropriate since this function saves any type of image, not just Mermaid diagrams.

Have you considered making this prefix configurable? Something like:

Suggested change
const defaultFileName = `img_${Date.now()}.${format}`
const defaultFileName = `${options?.filenamePrefix || 'img'}_${Date.now()}.${format}`

This would allow callers to specify context-appropriate prefixes (e.g., "screenshot_", "diagram_") while maintaining "img_" as the default.

const defaultUri = vscode.Uri.file(path.join(defaultPath, defaultFileName))

// Show save dialog
Expand Down
Loading