copy to clipboard context

This commit is contained in:
Chris Lettieri 2026-02-22 15:45:52 -05:00
parent 5777473171
commit 4123d93c4e

View file

@ -1,4 +1,4 @@
import { App, Modal, Setting } from 'obsidian';
import { App, Modal, Notice, Setting } from 'obsidian';
import { GatheredContext } from '../types/context';
export class ContextPreviewModal extends Modal {
@ -129,6 +129,14 @@ export class ContextPreviewModal extends Modal {
.setButtonText('Back')
.onClick(() => this.close())
)
.addButton(button => button
.setButtonText('Copy to Clipboard')
.setTooltip('Copy the gathered context to clipboard')
.onClick(async () => {
await navigator.clipboard.writeText(this.context.aggregatedContent);
new Notice('Context copied to clipboard!');
})
)
.addButton(button => button
.setButtonText('Save Raw Context')
.setTooltip('Save the gathered context as a note without AI processing')