Skip to content

Commit ea4d0be

Browse files
fix: pr comments
1 parent ac3c8a4 commit ea4d0be

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

src/syncManager.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ export class SyncManager {
295295
}
296296

297297
const filePath = this.fileSystem.joinPath(promptsDir, fileName);
298-
const matchingPrompt = allPrompts.find(prompt => prompt.name === fileName);
298+
// Match on both prompt.name and prompt.workspaceName to handle disambiguated files (e.g., prompt@org-repo.md)
299+
const matchingPrompt = allPrompts.find(prompt => prompt.name === fileName || prompt.workspaceName === fileName);
299300

300301
// Remove file if prompt exists but is not active
301302
if (matchingPrompt && !matchingPrompt.active) {
@@ -1238,7 +1239,6 @@ export class SyncManager {
12381239
*/
12391240
private async validatePromptSize(): Promise<void> {
12401241
try {
1241-
const fs = require('fs').promises;
12421242
const promptsDir = this.config.getPromptsDirectory();
12431243

12441244
// Ensure the prompts directory exists
@@ -1254,8 +1254,7 @@ export class SyncManager {
12541254
for (const file of promptFiles) {
12551255
try {
12561256
const filePath = this.fileSystem.joinPath(promptsDir, file);
1257-
const stats = await fs.stat(filePath);
1258-
totalSize += stats.size;
1257+
totalSize += await this.fileSystem.getFileSize(filePath);
12591258
activeCount++;
12601259
} catch {
12611260
// Skip files that can't be stat'd

src/utils/fileSystem.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ export class FileSystemManager {
5858
}
5959
}
6060

61+
async getFileSize(filePath: string): Promise<number> {
62+
const stats = await stat(filePath);
63+
return stats.size;
64+
}
6165

6266
joinPath(...paths: string[]): string {
6367
return path.join(...paths);

src/utils/notifications.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export class NotificationManager {
180180
);
181181

182182
if (result === 'Manage Prompts') {
183-
vscode.commands.executeCommand('promptitude-prompts.focus');
183+
vscode.commands.executeCommand('promptitude.cards.focus');
184184
} else if (result === 'Open Settings') {
185185
vscode.commands.executeCommand('workbench.action.openSettings', 'promptitude');
186186
}

0 commit comments

Comments
 (0)