Update ESLint rules and resolve bot review feedback #8
No files matched your search
@@ -154,7 +154,20 @@ export class ModalRenderer {
|
||||
text: 'Export',
|
||||
|
|
||||
cls: 'mod-cta'
|
||||
});
|
||||
this.submitButton.addEventListener('click', () => void this.callbacks.onSubmit());
|
||||
this.submitButton.addEventListener('click', () => {
|
||||
this.setExportingState(true);
|
||||
Promise.resolve(this.callbacks.onSubmit()).catch(err => {
|
||||
// Log the error for debugging
|
||||
console.error('Export submission failed:', err);
|
||||
|
||||
// Show user-facing error feedback
|
||||
const errorMessage = err instanceof Error ? err.message : 'An unknown error occurred during export';
|
||||
this.showValidationErrors([errorMessage]);
|
||||
|
||||
// Re-enable buttons so user can try again or cancel
|
||||
this.setExportingState(false);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -75,7 +75,7 @@ export class GeneralSection implements ModalSection {
|
||||
|
||||
|
⚠️ Potential issue | 🟡 Minor Description contradicts absolute path handling. The description states "relative to vault root", but the code on lines 84-85 now accepts and preserves absolute paths. Either update the description to clarify that absolute paths are supported, or remove the absolute path handling to match the description. If absolute paths are intended, consider updating the description: 🤖 Prompt for AI Agents_⚠️ Potential issue_ | _🟡 Minor_
**Description contradicts absolute path handling.**
The description states "relative to vault root", but the code on lines 84-85 now accepts and preserves absolute paths. Either update the description to clarify that absolute paths are supported, or remove the absolute path handling to match the description.
If absolute paths are intended, consider updating the description:
```diff
- .setDesc('Location for exported PDF files (relative to vault root)')
+ .setDesc('Location for exported PDF files (relative to vault root, or absolute path)')
```
<details>
<summary>🤖 Prompt for AI Agents</summary>
```
In src/ui/modal/sections/GeneralSection.ts around line 78, the UI description
currently reads "Location for exported PDF files (relative to vault root)" but
the code now accepts and preserves absolute paths; update the description to
accurately reflect that both relative paths (resolved against vault root) and
absolute paths are supported (e.g., "Location for exported PDF files (relative
to vault root or absolute path)") or, if absolute paths are not intended, remove
the absolute-path handling in the code so the behavior matches the original
"relative" wording; ensure text is concise and consistent with the actual path
handling logic.
```
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
✅ Addressed in commits f0daebc to c1c02ee
|
||||
new Setting(this.container)
|
||||
.setName('Output folder')
|
||||
.setDesc('Location for exported PDF files (relative to vault root)')
|
||||
.setDesc('Location for exported PDF files (relative to vault root or absolute path)')
|
||||
.addText(text => {
|
||||
const input = text
|
||||
.setPlaceholder('PDF exports')
|
||||
|
||||
Reference in new issue
Block a user
⚠️ Potential issue | 🟠 Major
Handle potential promise rejection from async onSubmit.
The
voidoperator correctly discards the promise, but ifonSubmitis async and throws an error, it will result in an unhandled promise rejection. This could lead to unexpected behavior or silent failures.Apply this diff to add proper error handling:
🤖 Prompt for AI Agents
✅ Addressed in commits
f0daebctoc1c02ee