Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions apps/obsidian/PLUGIN_STORE_SUBMISSION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Obsidian Plugin Store Submission Fixes

This document tracks all the changes made to address failed criteria from the [Obsidian Plugin Submission Requirements](https://docs.obsidian.md/Plugins/Releasing/Submission+requirements+for+plugins) and [Plugin Guidelines](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines).

## Index of Addressed Criteria

### Submission Requirements

#### Keep plugin descriptions short and simple
[Docs](https://docs.obsidian.md/Plugins/Releasing/Submission+requirements+for+plugins#Keep+plugin+descriptions+short+and+simple)
- **Issue**: Description "Discourse Graph Plugin for Obsidian" doesn't start with a verb and is missing a trailing period
- **Fix**: Changed to "Add semantic structure to your notes with the Discourse Graph protocol."
- **Files affected**: `manifest.json`

### Plugin Guidelines - General

#### Avoid unnecessary logging to console
[Docs](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Avoid+unnecessary+logging+to+console)
- **Issue**: ~87 console statements (`console.log`, `console.warn`, `console.debug`)
- **Fix**: Removed console statements; retained `console.error` for legitimate error handling
- **Files affected**:
- `src/services/QueryEngine.ts`
- `src/utils/syncDgNodesToSupabase.ts`
- `src/utils/importNodes.ts`
- `src/utils/fileChangeListener.ts`
- `src/components/canvas/TldrawView.tsx`
- `src/components/canvas/utils/relationJsonUtils.ts`
- `src/utils/templates.ts`
- `src/utils/publishNode.ts`

### Plugin Guidelines - UI Text

#### Only use headings under settings if you have more than one section
[Docs](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Only+use+headings+under+settings+if+you+have+more+than+one+section.)
- **Issue**: `Settings.tsx` renders a top-level `<h2>Discourse Graph Settings</h2>` heading
- **Fix**: Removed top-level heading (also addresses "Avoid 'settings' in settings headings")
- **Files affected**: `src/components/Settings.tsx`

### Plugin Guidelines - Commands

#### Avoid setting a default hotkey for commands
[Docs](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Avoid+setting+a+default+hotkey+for+commands)
- **Issue**: `registerCommands.ts` sets `hotkeys: [{ modifiers: ["Mod"], key: "\\" }]` on `open-node-type-menu`
- **Fix**: Removed default hotkey (users can set their own in Obsidian settings)
- **Files affected**: `src/utils/registerCommands.ts`

### Plugin Guidelines - Workspace

#### Avoid accessing workspace.activeLeaf directly
[Docs](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Avoid+accessing+%60workspace.activeLeaf%60+directly)
- **Issue**: 2 instances of `workspace.activeLeaf` in `registerCommands.ts`
- **Fix**: Replaced with `workspace.getActiveViewOfType()`
- **Files affected**: `src/utils/registerCommands.ts`

### Plugin Guidelines - Vault

#### Prefer Vault.process instead of Vault.modify for background edits
[Docs](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Prefer+%60Vault.process%60+instead+of+%60Vault.modify%60+to+modify+a+file+in+the+background)
- **Issue**: 3 instances of `vault.modify()` used on non-active files
- **Fix**: Replaced with `vault.process()` for atomic background file modifications
- **Files affected**:
- `src/components/BulkIdentifyDiscourseNodesModal.tsx`
- `src/utils/importNodes.ts`

#### Replace deprecated getFrontMatterInfo
- **Issue**: `templates.ts` uses deprecated `getFrontMatterInfo()` from Obsidian API
- **Fix**: Replaced with a custom `parseFrontmatterFromString()` helper that returns the same `{ exists, contentStart }` shape
- **Files affected**: `src/utils/templates.ts`

## Verification Checklist

After applying all fixes, verify:

- [ ] Plugin builds without errors
- [ ] All settings tabs render correctly
- [ ] Commands work as expected (without default hotkeys)
- [ ] File operations work correctly with new Vault API methods
- [ ] No console logging in production code
- [ ] Plugin can be loaded and unloaded without errors
2 changes: 1 addition & 1 deletion apps/obsidian/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Discourse Graph",
"version": "0.1.0",
"minAppVersion": "1.7.0",
"description": "Discourse Graph Plugin for Obsidian",
"description": "Add semantic structure to your notes with the Discourse Graph protocol.",
"author": "Discourse Graphs",
"authorUrl": "https://discoursegraphs.com",
"isDesktopOnly": false
Expand Down
2 changes: 1 addition & 1 deletion apps/obsidian/src/components/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Settings = () => {

return (
<div className="flex flex-col gap-4">
<h2 className="dg-h2">Discourse Graph Settings</h2>
{/* [PG-UI7, PG-UI8] Removed top-level heading per plugin guidelines */}
<div className="border-modifier-border flex w-full overflow-x-auto border-b p-2">
<button
onClick={() => setActiveTab("general")}
Expand Down
1 change: 0 additions & 1 deletion apps/obsidian/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ export default class DiscourseGraphPlugin extends Plugin {
this.fileChangeListener.cleanup();
this.fileChangeListener = null;
}

this.app.workspace.detachLeavesOfType(VIEW_TYPE_DISCOURSE_CONTEXT);
}
}
9 changes: 6 additions & 3 deletions apps/obsidian/src/utils/registerCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { syncAllNodesAndRelations } from "./syncDgNodesToSupabase";
import { publishNode } from "./publishNode";
import { addRelationIfRequested } from "~/components/canvas/utils/relationJsonUtils";
import type { DiscourseNode } from "~/types";
import { TldrawView } from "~/components/canvas/TldrawView";

type ModifyNodeSubmitParams = {
nodeType: DiscourseNode;
Expand Down Expand Up @@ -60,7 +61,7 @@ export const registerCommands = (plugin: DiscourseGraphPlugin) => {
plugin.addCommand({
id: "open-node-type-menu",
name: "Open node type menu",
hotkeys: [{ modifiers: ["Mod"], key: "\\" }],
// [PG-C14] Removed default hotkey - users can set their own
editorCallback: (editor: Editor) => {
const hasSelection = !!editor.getSelection();

Expand Down Expand Up @@ -187,7 +188,8 @@ export const registerCommands = (plugin: DiscourseGraphPlugin) => {
id: "switch-to-tldraw-edit",
name: "Switch to discourse markdown edit",
checkCallback: (checking: boolean) => {
const leaf = plugin.app.workspace.activeLeaf;
// [PG-W16] Use getActiveViewOfType instead of activeLeaf
const leaf = plugin.app.workspace.getActiveViewOfType(TldrawView)?.leaf;
if (!leaf) return false;

if (!checking) {
Expand All @@ -204,7 +206,8 @@ export const registerCommands = (plugin: DiscourseGraphPlugin) => {
id: "switch-to-tldraw-preview",
name: "Switch to Discourse Graph canvas view",
checkCallback: (checking: boolean) => {
const leaf = plugin.app.workspace.activeLeaf;
// [PG-W16] Use getActiveViewOfType instead of activeLeaf
const leaf = plugin.app.workspace.getActiveViewOfType(MarkdownView)?.leaf;
if (!leaf) return false;

if (!checking) {
Expand Down
Loading