andy-stack_vaultkeeper-ai/Modals/HelpModal.ts
Andrew Beal c9942e9ffa feat: add comprehensive help modal with guide and troubleshooting content
- Add detailed plugin guide covering modes, references, and instructions
- Add troubleshooting section with API key and rate limit solutions
- Add privacy documentation explaining data storage and exclusions
- Make "User Instructions" text clickable to open help modal
- Support opening help modal to specific topic via initialTopic prop
- Add internal link handling to navigate from help modal to vault files
- Update About section with GitHub link and contribution info
2025-11-09 19:59:41 +00:00

47 lines
No EOL
1.2 KiB
TypeScript

import type AIAgentPlugin from "main";
import { Modal } from "obsidian";
import { Resolve } from "Services/DependencyService";
import { Services } from "Services/Services";
import HelpModalSvelte from './HelpModalSvelte.svelte';
import { mount, unmount } from 'svelte';
import { Selector } from 'Enums/Selector';
export class HelpModal extends Modal {
private component: Record<string, any> | null = null;
public constructor() {
const plugin = Resolve<AIAgentPlugin>(Services.AIAgentPlugin);
super(plugin.app);
}
onOpen() {
const { contentEl, modalEl, containerEl } = this;
containerEl.addClass(Selector.HelpModal);
modalEl.addClass(Selector.HelpModal);
this.component = mount(HelpModalSvelte, {
target: contentEl,
props: {
onClose: () => this.close(),
initialTopic: (this as any).initialTopic
}
});
}
public open(initialTopic?: number): void {
(this as any).initialTopic = initialTopic;
super.open();
}
onClose() {
if (this.component) {
unmount(this.component);
this.component = null;
}
const { contentEl } = this;
contentEl.empty();
}
}