Skip to content
Merged
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
46 changes: 6 additions & 40 deletions src/commands.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
/**
* ClawVault Commands
* Command palette registrations
*
* Canvas dashboards removed — Kanban plugin is the task UI.
* Plugin focuses on: status panel, task creation, vault stats.
*
* Plugin focuses on vault health monitoring + quick capture.
*/

import { Notice, TFile, TFolder } from "obsidian";
import { Notice } from "obsidian";
import type ClawVaultPlugin from "./main";
import { COMMAND_IDS, STATUS_VIEW_TYPE } from "./constants";
import {
BlockedModal,
CaptureModal,
OpenLoopsModal,
TaskModal,
} from "./modals";
import { CaptureModal } from "./modals";

/**
* Register all ClawVault commands
Expand All @@ -23,36 +17,17 @@
// Quick Capture command
plugin.addCommand({
id: COMMAND_IDS.QUICK_CAPTURE,
name: "ClawVault: Quick Capture",

Check failure on line 20 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

Use sentence case for UI text

Check failure on line 20 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI

Check failure on line 20 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Use sentence case for UI text

Check failure on line 20 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI

Check failure on line 20 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Use sentence case for UI text

Check failure on line 20 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI

Check failure on line 20 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

Use sentence case for UI text

Check failure on line 20 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI
hotkeys: [{ modifiers: ["Ctrl", "Shift"], key: "c" }],

Check failure on line 21 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

Don't provide a default hotkey, as they might conflict with other hotkeys the user has already set, or that are included with Obsidian by default

Check failure on line 21 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Don't provide a default hotkey, as they might conflict with other hotkeys the user has already set, or that are included with Obsidian by default

Check failure on line 21 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Don't provide a default hotkey, as they might conflict with other hotkeys the user has already set, or that are included with Obsidian by default

Check failure on line 21 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

Don't provide a default hotkey, as they might conflict with other hotkeys the user has already set, or that are included with Obsidian by default
callback: () => {
new CaptureModal(plugin.app).open();
},
});

// Add Task command
plugin.addCommand({
id: COMMAND_IDS.ADD_TASK,
name: "ClawVault: Add Task",
hotkeys: [{ modifiers: ["Ctrl", "Shift"], key: "t" }],
callback: () => {
new TaskModal(plugin.app).open();
},
});

// View Blocked command
plugin.addCommand({
id: COMMAND_IDS.VIEW_BLOCKED,
name: "ClawVault: View Blocked Tasks",
callback: () => {
new BlockedModal(plugin.app, plugin.vaultReader).open();
},
});

// Open Status Panel command
plugin.addCommand({
id: COMMAND_IDS.OPEN_STATUS_PANEL,
name: "ClawVault: Open Status Panel",

Check failure on line 30 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

Use sentence case for UI text

Check failure on line 30 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI

Check failure on line 30 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Use sentence case for UI text

Check failure on line 30 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI

Check failure on line 30 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Use sentence case for UI text

Check failure on line 30 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI

Check failure on line 30 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

Use sentence case for UI text

Check failure on line 30 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI
callback: () => {
void activateStatusView(plugin);
},
Expand All @@ -60,8 +35,8 @@

// Open Kanban Board command
plugin.addCommand({
id: "clawvault-open-kanban",
id: COMMAND_IDS.OPEN_KANBAN_BOARD,
name: "ClawVault: Open Kanban Board",

Check failure on line 39 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

Use sentence case for UI text

Check failure on line 39 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI

Check failure on line 39 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Use sentence case for UI text

Check failure on line 39 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI

Check failure on line 39 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Use sentence case for UI text

Check failure on line 39 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI

Check failure on line 39 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

Use sentence case for UI text

Check failure on line 39 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI
callback: () => {
void plugin.app.workspace.openLinkText("Board.md", "", "tab");
},
Expand All @@ -70,25 +45,16 @@
// Force Refresh Stats command
plugin.addCommand({
id: COMMAND_IDS.REFRESH_STATS,
name: "ClawVault: Refresh Stats",

Check failure on line 48 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

Use sentence case for UI text

Check failure on line 48 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI

Check failure on line 48 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Use sentence case for UI text

Check failure on line 48 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI

Check failure on line 48 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Use sentence case for UI text

Check failure on line 48 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI

Check failure on line 48 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

Use sentence case for UI text

Check failure on line 48 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI
callback: () => {
void plugin.refreshAll();
},
});

// Show Open Loops command
plugin.addCommand({
id: COMMAND_IDS.SHOW_OPEN_LOOPS,
name: "ClawVault: Show Open Loops",
callback: () => {
new OpenLoopsModal(plugin.app, plugin.vaultReader).open();
},
});

// Setup Graph Colors command
plugin.addCommand({
id: "clawvault-setup-graph-colors",
id: COMMAND_IDS.SETUP_GRAPH_COLORS,
name: "ClawVault: Setup graph colors (neural style)",

Check failure on line 57 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI

Check failure on line 57 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI

Check failure on line 57 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI

Check failure on line 57 in src/commands.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

The command name should not include the plugin name, the plugin name is already shown next to the command name in the UI
callback: () => {
void setupGraphColors(plugin);
},
Expand Down
39 changes: 2 additions & 37 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

// View type identifier for the status panel
export const STATUS_VIEW_TYPE = "clawvault-status-view";
export const TASK_BOARD_VIEW_TYPE = "clawvault-task-board";

// Default category colors for graph nodes
export const DEFAULT_CATEGORY_COLORS: Record<string, string> = {
Expand All @@ -20,34 +19,6 @@ export const DEFAULT_CATEGORY_COLORS: Record<string, string> = {
default: "#7f8c8d", // default gray
};

// Task status values
export const TASK_STATUS = {
OPEN: "open",
IN_PROGRESS: "in-progress",
BLOCKED: "blocked",
DONE: "done",
} as const;

export type TaskStatus = typeof TASK_STATUS[keyof typeof TASK_STATUS];

// Task priority values
export const TASK_PRIORITY = {
CRITICAL: "critical",
HIGH: "high",
MEDIUM: "medium",
LOW: "low",
} as const;

export type TaskPriority = typeof TASK_PRIORITY[keyof typeof TASK_PRIORITY];

// Status icons for display
export const STATUS_ICONS: Record<TaskStatus, string> = {
[TASK_STATUS.OPEN]: "○",
[TASK_STATUS.IN_PROGRESS]: "●",
[TASK_STATUS.BLOCKED]: "⊘",
[TASK_STATUS.DONE]: "✓",
};

// Default refresh interval in milliseconds (60 seconds)
export const DEFAULT_REFRESH_INTERVAL = 60000;

Expand All @@ -58,21 +29,15 @@ export const CLAWVAULT_GRAPH_INDEX = ".clawvault/graph-index.json";
// Default folders
export const DEFAULT_FOLDERS = {
INBOX: "inbox",
TASKS: "tasks",
BACKLOG: "backlog",
} as const;

// Command IDs
export const COMMAND_IDS = {
GENERATE_DASHBOARD: "clawvault-generate-dashboard",
QUICK_CAPTURE: "clawvault-quick-capture",
ADD_TASK: "clawvault-add-task",
VIEW_BLOCKED: "clawvault-view-blocked",
OPEN_STATUS_PANEL: "clawvault-open-status-panel",
OPEN_TASK_BOARD: "clawvault-open-task-board",
GENERATE_CANVAS_FROM_TEMPLATE: "clawvault-generate-canvas-from-template",
OPEN_KANBAN_BOARD: "clawvault-open-kanban",
REFRESH_STATS: "clawvault-refresh-stats",
SHOW_OPEN_LOOPS: "clawvault-show-open-loops",
SETUP_GRAPH_COLORS: "clawvault-setup-graph-colors",
} as const;

export const CANVAS_TEMPLATE_IDS = {
Expand Down
18 changes: 1 addition & 17 deletions src/decorations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { TFile } from "obsidian";
import type ClawVaultPlugin from "./main";
import { DEFAULT_FOLDERS, STATUS_ICONS, TaskStatus, TASK_STATUS } from "./constants";
import { DEFAULT_FOLDERS } from "./constants";

/**
* Manages file explorer decorations
Expand Down Expand Up @@ -140,14 +140,6 @@ export class FileDecorations {
return "📥";
}

// Check if file is a task
if (this.isInFolder(file, DEFAULT_FOLDERS.TASKS)) {
const status = await this.plugin.vaultReader.getTaskStatus(file);
if (status) {
return STATUS_ICONS[status] ?? STATUS_ICONS[TASK_STATUS.OPEN];
}
}

return null;
}

Expand Down Expand Up @@ -192,14 +184,6 @@ export class FileDecorations {
switch (decoration) {
case "📥":
return "Inbox item";
case STATUS_ICONS[TASK_STATUS.OPEN]:
return "Open task";
case STATUS_ICONS[TASK_STATUS.IN_PROGRESS]:
return "Active task";
case STATUS_ICONS[TASK_STATUS.BLOCKED]:
return "Blocked task";
case STATUS_ICONS[TASK_STATUS.DONE]:
return "Completed task";
default:
return "";
}
Expand Down
4 changes: 2 additions & 2 deletions src/graph-enhancer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { TFile } from "obsidian";
import type ClawVaultPlugin from "./main";
import { DEFAULT_CATEGORY_COLORS, TASK_PRIORITY } from "./constants";
import { DEFAULT_CATEGORY_COLORS } from "./constants";

export class GraphEnhancer {
private plugin: ClawVaultPlugin;
Expand Down Expand Up @@ -143,7 +143,7 @@ export class GraphEnhancer {
}

const priority = this.getPriority(frontmatter);
const isCritical = priority === TASK_PRIORITY.CRITICAL;
const isCritical = priority === "critical";
graphNode.classList.toggle("clawvault-node-critical", isCritical);
}

Expand Down
14 changes: 3 additions & 11 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ import { Plugin, WorkspaceLeaf } from "obsidian";
import { ClawVaultSettings, ClawVaultSettingTab, DEFAULT_SETTINGS } from "./settings";
import { VaultReader } from "./vault-reader";
import { ClawVaultStatusView } from "./status-view";
// Task board view removed — Kanban plugin handles task visualization
import { FileDecorations } from "./decorations";
import { GraphEnhancer } from "./graph-enhancer";
import { registerCommands } from "./commands";
import {
COMMAND_IDS,
DEFAULT_CATEGORY_COLORS,
STATUS_VIEW_TYPE,
// TASK_BOARD_VIEW_TYPE removed — using Kanban plugin
} from "./constants";

export default class ClawVaultPlugin extends Plugin {
Expand All @@ -37,8 +36,6 @@ export default class ClawVaultPlugin extends Plugin {
return new ClawVaultStatusView(leaf, this);
});

// Task board view removed — Kanban plugin is the task UI

// Add ribbon icon
this.addRibbonIcon("database", "ClawVault status", () => {
void this.activateStatusView();
Expand Down Expand Up @@ -87,7 +84,7 @@ export default class ClawVaultPlugin extends Plugin {
try {
// Trigger the setup command programmatically
(this.app as unknown as { commands: { executeCommandById: (id: string) => void } })
.commands.executeCommandById("clawvault-setup-graph-colors");
.commands.executeCommandById(COMMAND_IDS.SETUP_GRAPH_COLORS);

// Mark as configured so we don't repeat
this.settings.graphColorsConfigured = true;
Expand Down Expand Up @@ -160,8 +157,6 @@ export default class ClawVaultPlugin extends Plugin {
}
}

// Task board view removed — use Kanban plugin + Board.md

/**
* Update status bar visibility based on settings
*/
Expand All @@ -183,9 +178,8 @@ export default class ClawVaultPlugin extends Plugin {

try {
const stats = await this.vaultReader.getVaultStats();
const activeTaskCount = stats.tasks.active + stats.tasks.open;
this.statusBarItem.setText(
`🐘 ${stats.nodeCount.toLocaleString()} nodes · ${activeTaskCount} tasks`
`🐘 ${stats.nodeCount.toLocaleString()} nodes · ${stats.edgeCount.toLocaleString()} edges`
);
} catch {
this.statusBarItem.setText("🐘 ClawVault");
Expand Down Expand Up @@ -234,8 +228,6 @@ export default class ClawVaultPlugin extends Plugin {
}
}

// Task board removed — Kanban plugin handles task visualization

// Update file decorations
if (this.fileDecorations) {
await this.fileDecorations.decorateAllFiles();
Expand Down
Loading
Loading