fix: address Obsidian Review Bot feedback for plugin submission
- Replace hardcoded '.obsidian' paths with Vault#configDir for proper config directory support - Move inline styles to CSS classes for better theme compatibility - Remove unnecessary type casting by using proper type predicates - Add proper TypeScript type narrowing for filtered arrays This addresses all required issues identified by the Obsidian Review Bot: * TempDirectoryManager now accepts configDir parameter from app.vault.configDir * PdfToImageConverter uses configDir instead of hardcoded '.obsidian' * ExportConfigModal uses CSS classes (.export-progress-visible, .export-form-hidden) instead of inline styles * Progress bar width controlled via CSS custom property --progress-width * Removed 'as TFile[]' casting by implementing isMarkdownFile type predicate 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
6 files changed
+37
-20
No files matched your search
@@ -7,6 +7,8 @@ import { PLUGIN_DIRS } from './constants';
|
||||
export interface TempDirectoryOptions {
|
||||
/** Base path for the vault */
|
||||
vaultPath: string;
|
||||
/** Configuration directory path (from Vault#configDir) */
|
||||
configDir: string;
|
||||
/** Plugin directory name (defaults to 'typst-pdf-export') */
|
||||
pluginName?: string;
|
||||
}
|
||||
@@ -15,10 +17,12 @@ export class TempDirectoryManager {
|
||||
private readonly fs = require('fs');
|
||||
private readonly path = require('path');
|
||||
private readonly vaultPath: string;
|
||||
private readonly configDir: string;
|
||||
private readonly pluginName: string;
|
||||
|
||||
constructor(options: TempDirectoryOptions) {
|
||||
this.vaultPath = options.vaultPath;
|
||||
this.configDir = options.configDir;
|
||||
this.pluginName = options.pluginName || 'typst-pdf-export';
|
||||
}
|
||||
|
||||
@@ -26,7 +30,7 @@ export class TempDirectoryManager {
|
||||
* Get the plugin directory path
|
||||
*/
|
||||
private getPluginDir(): string {
|
||||
return this.path.join(this.vaultPath, '.obsidian', 'plugins', this.pluginName);
|
||||
return this.path.join(this.vaultPath, this.configDir, 'plugins', this.pluginName);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,10 +87,10 @@ export class TempDirectoryManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Static helper to create manager from vault path
|
||||
* Static helper to create manager from vault path and configDir
|
||||
*/
|
||||
public static create(vaultPath: string, pluginName?: string): TempDirectoryManager {
|
||||
return new TempDirectoryManager({ vaultPath, pluginName });
|
||||
public static create(vaultPath: string, configDir: string, pluginName?: string): TempDirectoryManager {
|
||||
return new TempDirectoryManager({ vaultPath, configDir, pluginName });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user