diff --git a/main.ts b/main.ts index 7333261..e0cbc52 100644 --- a/main.ts +++ b/main.ts @@ -1,5 +1,5 @@ import { App, Plugin, PluginSettingTab, Setting } from 'obsidian'; -import { AppView, OBSIDIAN_INTELLIGENCE_VIEW_TYPE } from './src/ui/AppView'; +import { AppView, INTELLIGENCE_VIEW_TYPE } from './src/ui/AppView'; import OpenAI from 'openai'; import { IThread } from './src/ui/types'; @@ -25,25 +25,11 @@ export default class Intelligence extends Plugin { async onload() { await this.loadSettings(); - this.registerView(OBSIDIAN_INTELLIGENCE_VIEW_TYPE, (leaf) => new AppView(leaf, this)); - - const ribbonIconEl = this.addRibbonIcon( - 'bot', - 'Open Obsidian Intelligence', - (evt: MouseEvent) => { - this.activateView(); - }, - ); - // Perform additional things with the ribbon - ribbonIconEl.addClass('my-plugin-ribbon-class'); - - // This adds a status bar item to the bottom of the app. Does not work on mobile apps. - const statusBarItemEl = this.addStatusBarItem(); - statusBarItemEl.setText('Status Bar Text'); + this.registerView(INTELLIGENCE_VIEW_TYPE, (leaf) => new AppView(leaf, this)); this.addCommand({ - id: 'obsidian-intelligence-view-open', - name: 'Open Obsidian Intelligence', + id: 'intelligence-view-open', + name: 'Open Intelligence', callback: () => { this.activateView(); }, @@ -68,10 +54,10 @@ export default class Intelligence extends Plugin { } async activateView() { - this.app.workspace.detachLeavesOfType(OBSIDIAN_INTELLIGENCE_VIEW_TYPE); + this.app.workspace.detachLeavesOfType(INTELLIGENCE_VIEW_TYPE); await this.app.workspace.getRightLeaf(false).setViewState({ - type: OBSIDIAN_INTELLIGENCE_VIEW_TYPE, + type: INTELLIGENCE_VIEW_TYPE, active: true, }); @@ -79,7 +65,7 @@ export default class Intelligence extends Plugin { } async revealView() { this.app.workspace.revealLeaf( - this.app.workspace.getLeavesOfType(OBSIDIAN_INTELLIGENCE_VIEW_TYPE)[0], + this.app.workspace.getLeavesOfType(INTELLIGENCE_VIEW_TYPE)[0], ); } } diff --git a/manifest.json b/manifest.json index 6d09168..12f649a 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "name": "Intelligence", "version": "1.0.0", "minAppVersion": "0.15.0", - "description": "OpenAI GPT Assistants functionality inside Obsidian", + "description": "Integrate OpenAI GPT Assistants functionality", "author": "John Mavrick", "authorUrl": "https://beacons.ai/johnmavrick", "fundingUrl": "https://patreon.com/johnmavrick", diff --git a/package.json b/package.json index 2055559..d45fad6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "obsidian-intelligence", "version": "1.0.0", - "description": "AI-powered assistants inside Obsidian", + "description": "Integrate OpenAI GPT Assistants functionality", "main": "main.js", "scripts": { "dev": "node esbuild.config.mjs", diff --git a/src/ui/AppView.tsx b/src/ui/AppView.tsx index c7775e4..e85f9b0 100644 --- a/src/ui/AppView.tsx +++ b/src/ui/AppView.tsx @@ -6,7 +6,7 @@ import { App } from 'obsidian'; import Intelligence from '../../main'; import OpenAI from 'openai'; -export const OBSIDIAN_INTELLIGENCE_VIEW_TYPE = 'obsidian-intelligence-view'; +export const INTELLIGENCE_VIEW_TYPE = 'obsidian-intelligence-view'; @@ -55,11 +55,11 @@ export class AppView extends ItemView { } getViewType() { - return OBSIDIAN_INTELLIGENCE_VIEW_TYPE; + return INTELLIGENCE_VIEW_TYPE; } getDisplayText() { - return 'Obsidian Intelligence'; + return 'Intelligence'; } getIcon(): string { return 'bot'; diff --git a/src/utils/Logs.ts b/src/utils/Logs.ts index 19cf0de..9e4de83 100644 --- a/src/utils/Logs.ts +++ b/src/utils/Logs.ts @@ -1,5 +1,5 @@ import { Notice } from 'obsidian'; export const createNotice = (message: string, timeout = 5000): void => { - new Notice(`Obsidian Intelligence: ${message}`, timeout); + new Notice(`Intelligence: ${message}`, timeout); };