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
36 changes: 14 additions & 22 deletions src/__tests__/file-source/FileSource.basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,41 +94,33 @@ describe('FileSource', () => {
});

it('should not initialize when disabled', () => {
const consoleSpy = jest.spyOn(console, 'log').mockImplementation();

fileSource.initialize();

expect(consoleSpy).not.toHaveBeenCalledWith(expect.stringContaining('[FileSource] Initializing'));

consoleSpy.mockRestore();

expect(fileSource.getStats().initialized).toBe(false);
});

it('should initialize when enabled', () => {
const consoleSpy = jest.spyOn(console, 'log').mockImplementation();

// Enable FileSource
fileSource.updateConfiguration({ enabled: true });
fileSource.initialize();

expect(consoleSpy).toHaveBeenCalledWith(expect.stringContaining('[FileSource] Initializing'));

consoleSpy.mockRestore();

expect(fileSource.getStats().initialized).toBe(true);
});

it('should not initialize twice', () => {
const consoleSpy = jest.spyOn(console, 'log').mockImplementation();

const scanSpy = jest.spyOn(
fileSource as unknown as { performInitialScan(): Promise<void> },
'performInitialScan'
);

fileSource.updateConfiguration({ enabled: true });
fileSource.initialize();
fileSource.initialize(); // Second call

// Should only log once
const initLogs = consoleSpy.mock.calls.filter((call: any[]) =>
call[0]?.includes('[FileSource] Initializing')
);
expect(initLogs).toHaveLength(1);

consoleSpy.mockRestore();

// Should only run the initial scan once
expect(scanSpy).toHaveBeenCalledTimes(1);

scanSpy.mockRestore();
});
});

Expand Down
8 changes: 4 additions & 4 deletions src/bootstrap/registerViewShellModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ export function registerTaskViewShells(plugin: TaskProgressBarPlugin): void {
try {
registerTaskGeniusBasesViews(plugin);
} catch (error) {
console.log("Failed to register Bases views:", error);
console.error("Failed to register Bases views:", error);
}

try {
registerWidgetViews(plugin);
} catch (error) {
console.log("Failed to register Widget views:", error);
console.error("Failed to register Widget views:", error);
}
}

Expand Down Expand Up @@ -69,13 +69,13 @@ export function registerViewShellCommands(plugin: TaskProgressBarPlugin): void {
try {
registerWidgetCommands(plugin);
} catch (error) {
console.log("Failed to register Widget commands:", error);
console.error("Failed to register Widget commands:", error);
}

try {
registerWidgetCodeBlock(plugin);
} catch (error) {
console.log(
console.error(
"Failed to register Widget codeblock processor:",
error,
);
Expand Down
3 changes: 0 additions & 3 deletions src/cache/local-storage-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ export class LocalStorageCache {
// to keep noise down on first load after an upgrade with thousands
// of cache entries.
if (!LocalStorageCache._versionMismatchLogged) {
console.log(
`[LocalStorageCache] Cache version mismatch (cached=${data.version}, current=${this.currentVersion}); treating as cache miss and pruning stale entries on access.`,
);
LocalStorageCache._versionMismatchLogged = true;
}
// Prune the stale entry so we don't keep paying the read cost.
Expand Down
6 changes: 0 additions & 6 deletions src/cache/project-data-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,6 @@ export class ProjectDataCache {
}

if (staleFiles.length > 0) {
console.log(
`Refreshing ${staleFiles.length} stale project data cache entries`
);
await this.getBatchProjectData(staleFiles);
}
}
Expand All @@ -577,9 +574,6 @@ export class ProjectDataCache {
);

if (uncachedFiles.length > 0) {
console.log(
`Preloading project data for ${uncachedFiles.length} recent files`
);
await this.getBatchProjectData(uncachedFiles);
}
}
Expand Down
1 change: 0 additions & 1 deletion src/components/features/calendar/algorithm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export function calculateEventLayout(
timeRangeStart?: Date,
timeRangeEnd?: Date
): EventLayout[] {
console.log("Calculating event layout (stub)", events);
// Basic Stub: Return simple layout (no overlap calculation yet)
return events.map((event, index) => ({
id: event.id,
Expand Down
1 change: 0 additions & 1 deletion src/components/features/changelog/ChangelogView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export class ChangelogView extends ItemView {
const isBeta = manifestVersion.toLowerCase().includes("beta");
const cached = getCachedChangelog(manifestVersion, isBeta, this.app);

console.log("[TG]", cached);
if (!cached) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,6 @@ export class TopNavigation extends Component {
buttonEl: buttonContainer,
config: config,
});

console.log(
`[FluentTopNavigation] Registered custom button: ${config.id}`,
);
}

/**
Expand All @@ -499,8 +495,6 @@ export class TopNavigation extends Component {

// Remove from map
this.customButtons.delete(id);

console.log(`[FluentTopNavigation] Unregistered custom button: ${id}`);
}

/**
Expand All @@ -518,8 +512,6 @@ export class TopNavigation extends Component {

// Clear map
this.customButtons.clear();

console.log("[FluentTopNavigation] Cleared all custom buttons");
}

/**
Expand Down
17 changes: 0 additions & 17 deletions src/components/features/fluent/managers/FluentActionHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,20 +223,10 @@ export class FluentActionHandlers extends Component {
task: Task,
newStatusMark: string
): Promise<void> {
console.log(
`[FluentActionHandlers] Processing kanban status update for task ${task.id}`
);
console.log(
`[FluentActionHandlers] Status change: ${task.status} -> ${newStatusMark}`
);

const isCompleted = this.isCompletedMark(newStatusMark);
const completedDate = isCompleted ? Date.now() : undefined;

if (task.status !== newStatusMark || task.completed !== isCompleted) {
console.log(
"[FluentActionHandlers] Status change detected, calling handleTaskUpdate..."
);
await this.handleTaskUpdate(task, {
...task,
status: newStatusMark,
Expand All @@ -246,11 +236,6 @@ export class FluentActionHandlers extends Component {
completedDate: completedDate,
},
});
console.log("[FluentActionHandlers] handleTaskUpdate completed");
} else {
console.log(
"[FluentActionHandlers] No status change needed, skipping update"
);
}
}

Expand Down Expand Up @@ -1083,7 +1068,6 @@ export class FluentActionHandlers extends Component {
if (viewId === "new-task") {
new QuickCaptureModal(this.app, this.plugin).open();
} else {
console.log(`[FluentAction] handleNavigate to ${viewId}`);
this.onNavigateToView?.(viewId);
}
}
Expand All @@ -1099,7 +1083,6 @@ export class FluentActionHandlers extends Component {
* Handle project selection
*/
handleProjectSelect(projectId: string, includeSubprojects = false): void {
console.log(`[FluentAction] Project selected: ${projectId}`);
this.onProjectSelected?.(projectId, includeSubprojects);
}

Expand Down
Loading
Loading