Skip to content

Commit 9dfa5cd

Browse files
authored
Merge pull request #23 from nventive/msyo/fix-promptitude-ui
Fix Windows compatibility and critical UI bugs in prompts view
2 parents 5e3781d + 490a983 commit 9dfa5cd

15 files changed

+1165
-376
lines changed

.github/copilot-instructions.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ Warn me about backward-incompatible changes.
1010
Architecture & key files
1111
- Entry/activation: src/extension.ts – activates on startup, wires ConfigManager, StatusBarManager, SyncManager; registers commands:
1212
promptitude.syncNow • promptitude.showStatus • promptitude.openPromptsFolder • promptitude.addAzureDevOpsPAT • promptitude.clearAzureDevOpsPAT • promptitude.clearAzureDevOpsCache
13-
- Sync: src/syncManager.ts – schedules by promptitude.frequency; per-repo (url or url|branch, default main) select provider via GitProviderFactory, authenticate, fetch tree, filter, download files. Filters chatmode/, instructions/, prompts/ and .md/.txt; writes files flat to the prompts directory using the basename (last write wins).
14-
- Configuration: src/configManager.ts – reads promptitude.*; repositoryConfigs parses url|branch; getPromptsDirectory returns OS-specific path; flags: enabled, syncOnStartup, showNotifications, debug, syncChatmode, syncInstructions, syncPrompt.
13+
- Sync: src/syncManager.ts – schedules by promptitude.frequency; per-repo (url or url|branch, default main) select provider via GitProviderFactory, authenticate, fetch tree, filter, download files. Filters agents/ (and legacy chatmodes/), instructions/, prompts/ and .md/.txt; writes files to repository storage then creates symlinks (or copies on Windows without admin/dev mode) to active prompts directory using unique names when conflicts exist across repos.
14+
- Configuration: src/configManager.ts – reads promptitude.*; repositoryConfigs parses url|branch; getPromptsDirectory returns OS-specific path; flags: enabled, syncOnStartup, showNotifications, debug, syncChatmode (supports agents/ and chatmodes/), syncInstructions, syncPrompt.
1515
- Providers: src/utils/github.ts (VS Code GitHub auth with scope repo; REST branches→sha→git/trees; contents for files). src/utils/azureDevOps.ts (PATs in SecretStorage; per-organization PAT index cached in globalState; supports dev.azure.com and legacy visualstudio.com; owner encoded as organization|project|baseUrl).
1616
- Utilities/UI: src/utils/fileSystem.ts (fs ops); src/utils/notifications.ts (messages + auth flows); src/utils/logger.ts (single "Promptitude" output channel; debug gated by setting); src/statusBarManager.ts (Idle/Syncing/Success/Error + last sync time; click triggers sync).
17+
- Storage: Repository files stored in {globalStorageUri}/repos/{encoded_url}/; active prompts symlinked (or copied on Windows) to {globalStorageUri}/prompts/. Cross-platform path handling normalizes separators (/ vs \).
1718
1819
Developer workflows
1920
- Build/package: npm install → npm run compile (or npm run watch) → npm run package (VSIX). Lint: npm run lint. Tests: npm run test.
@@ -24,7 +25,9 @@ Conventions & patterns (repo-specific)
2425
- Always use FileSystemManager for IO and NotificationManager for UX/auth prompts; do not duplicate provider auth logic.
2526
- Settings drive behavior; avoid hard-coded paths/branches; use ConfigManager.repositoryConfigs for url|branch parsing.
2627
- Provider code lives in GitApiManager implementations; select via GitProviderFactory.createFromUrl().
27-
- Duplicate filenames across repos overwrite by last processed repo (flat output). Allowed file types: .md, .txt.
28+
- Duplicate filenames across repos resolved with unique workspace names using repository identifiers.
29+
- Allowed file types: .md, .txt.
30+
- Cross-platform: Normalize path separators (replace \\ with / for comparisons); on Windows, symlink creation falls back to file copy if admin/dev mode unavailable; both symlinks and file copies tracked as "active" prompts.
2831
2932
Examples
3033
- settings.json:

CHANGELOG.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,19 @@ All notable changes to the "promptitude" extension will be documented in this fi
77
### Changed
88

99
- Renamed "chatmodes" to "agents" throughout the UI to align with VS Code's current terminology
10+
- Improved "Activate All" and "Deactivate All" operations to show progress notifications with individual prompt status.
1011

1112
### Fixed
1213

13-
- Improved prompt management UI with bug fixes and stability improvements
14-
- Fixed duplicate filename handling across multiple repositories
15-
- Enhanced cross-platform compatibility
16-
- Code quality improvements
14+
- Fixed UI bugs including Windows path handling, activate/deactivate button behavior, and cross-platform compatibility issues
15+
- Fixed prompt details view not opening for inactive prompts on Windows by correctly resolving repository storage paths
16+
- Fixed "Activate All" to properly create symlinks for all prompts instead of just updating state.
17+
- Fixed "Deactivate All" to efficiently remove all symlinks directly instead of looping through individual toggles, eliminating unnecessary counting behavior.
18+
- Fixed issue where prompts that were active before "Activate All" would be in a broken state after "Deactivate All".
19+
- Fixed prompt details view not refreshing when "Deactivate All" is clicked while viewing an active prompt.
20+
- Fixed duplicate repositories persisting in configuration by automatically removing them and updating settings when detected.
21+
- Fixed 'All Sources' dropdown preventing users from deselecting the only repository source by implementing sentinel value pattern to distinguish between "all sources" and "no sources selected" states.
22+
- Fixed Activity Bar icon not displaying by converting SVG to monochrome format with currentColor support for proper theme adaptation.
1723

1824
## [1.5.0] - 2025-11-12
1925

README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ The Promptitude Extension automatically synchronizes the latest GitHub Copilot p
1010

1111
- **🔄 Automatic Sync**: Configurable sync frequency (daily by default)
1212
- **📦 Multiple Repositories**: Support for syncing from multiple Git repositories simultaneously
13-
- **🌍 Cross-Platform**: Works on macOS, Windows, and Linux
13+
- **🌍 Cross-Platform**: Works on macOS, Windows, and Linux with intelligent symlink fallback
1414
- **⚙️ Configurable**: Customizable sync frequency and target directory
1515
- **🔐 Secure**: Uses your existing GitHub authentication from VS Code and secure PAT storage for Azure DevOps
1616
- **🌐 Multi-Provider**: Supports both GitHub and Azure DevOps repositories
1717
- **📦 Read-Only**: Safe pull-only synchronization (no risk of overwriting repositories)
1818
- **🎨 User-Friendly**: Simple setup with minimal configuration required
1919
- **📊 Status Indicators**: Clear feedback on sync status and last update time
2020
- **🛡️ Error Handling**: Graceful handling of repository conflicts and partial failures
21+
- **💻 Windows Compatibility**: Automatic fallback to file copies when symlinks aren't available (no admin rights needed)
2122

2223
## 🚀 Quick Start
2324

@@ -56,8 +57,8 @@ The Promptitude Extension automatically synchronizes the latest GitHub Copilot p
5657
| `promptitude.repositories` | Repositories with optional branch (use `url` or `url|branch`) | `[]` | array |
5758
| `promptitude.syncOnStartup` | Sync when VS Code starts | `true` | boolean |
5859
| `promptitude.showNotifications` | Show sync status notifications | `true` | boolean |
59-
| `promptitude.syncChatmode` | Sync chatmode prompts | `true` | boolean |
60-
| `promptitude.syncInstructions` | Sync instructions prompts | `false` | boolean |
60+
| `promptitude.syncChatmode` | Sync agent prompts (supports both agents/ and legacy chatmodes/ directories) | `true` | boolean |
61+
| `promptitude.syncInstructions` | Sync instructions prompts | `true` | boolean |
6162
| `promptitude.syncPrompt` | Sync prompt files | `true` | boolean |
6263

6364
### Sync Frequency Options
@@ -80,6 +81,23 @@ You can override this by setting a custom path in `promptitude.customPath`.
8081

8182
The extension will adapt this path automatically to function with non-default VS Code profiles.
8283

84+
### Platform-Specific Behavior
85+
86+
#### Windows Symlink Handling
87+
88+
On Windows, the extension intelligently handles file synchronization:
89+
90+
- **With Developer Mode or Admin Rights**: Creates symlinks for optimal performance (files stay in sync automatically)
91+
- **Without Special Permissions**: Automatically falls back to copying files (no admin rights required)
92+
- Both approaches work seamlessly - the extension detects and manages active prompts correctly
93+
94+
To enable symlinks on Windows 10/11 without admin rights:
95+
1. Go to Settings → Update & Security → For developers
96+
2. Enable "Developer Mode"
97+
3. Restart VS Code
98+
99+
**Note**: File copy mode works perfectly fine for most users and requires no special setup.
100+
83101
### Multiple Repository Configuration
84102

85103
The extension supports syncing from multiple Git repositories simultaneously. This is useful for organizations that maintain prompt collections across multiple repositories or for users who want to combine prompts from different sources.
@@ -133,7 +151,8 @@ The extension adds a status bar item showing:
133151
The extension syncs all prompt files from the repository subdirectories into a flattened structure:
134152

135153
```
136-
chatmodes/*.md → User/prompts/
154+
agents/*.md → User/prompts/
155+
chatmodes/*.md → User/prompts/ (legacy support)
137156
instructions/*.md → User/prompts/
138157
prompts/*.md → User/prompts/
139158
```

media/main.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@
6969
text-transform: capitalize;
7070
}
7171

72+
.type-badge.type-agents {
73+
background: var(--vscode-charts-blue);
74+
color: white;
75+
}
76+
77+
/* Legacy support for chatmode class */
7278
.type-badge.type-chatmode {
7379
background: var(--vscode-charts-blue);
7480
color: white;

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "promptitude-extension",
33
"displayName": "Promptitude",
44
"description": "Sync GitHub Copilot prompts, chatmodes and instructions from git repositories",
5-
"version": "1.5.1",
5+
"version": "1.5.2",
66
"publisher": "logientnventive",
77
"repository": {
88
"type": "git",
@@ -73,7 +73,7 @@
7373
"promptitude.syncChatmode": {
7474
"type": "boolean",
7575
"default": true,
76-
"description": "Sync chatmodes",
76+
"description": "Sync agent prompts (supports both agents/ and legacy chatmodes/ directories)",
7777
"order": 2
7878
},
7979
"promptitude.syncInstructions": {
@@ -250,4 +250,4 @@
250250
"@vscode/test-electron": "^2.3.0",
251251
"@vscode/vsce": "^2.19.0"
252252
}
253-
}
253+
}

resources/promptitude-icon.svg

Lines changed: 9 additions & 24 deletions
Loading

0 commit comments

Comments
 (0)