feat: add VS Code and VS Code Insiders install buttons

- Fix VS Code install URL format to match README links
- Add separate buttons for VS Code and VS Code Insiders
- Support install links for agents, prompts, and instructions
- Add VS Code icon SVG to buttons
This commit is contained in:
Aaron Powell
2026-01-28 19:45:22 +11:00
parent 63f2080694
commit d0bcc226ba
4 changed files with 49 additions and 16 deletions

View File

@@ -46,7 +46,8 @@ export async function openFileModal(filePath: string, type: string): Promise<voi
const modal = document.getElementById('file-modal');
const title = document.getElementById('modal-title');
const contentEl = document.getElementById('modal-content')?.querySelector('code');
const installBtn = document.getElementById('install-vscode-btn') as HTMLAnchorElement | null;
const installBtn = document.getElementById('install-btn') as HTMLAnchorElement | null;
const installInsidersBtn = document.getElementById('install-insiders-btn') as HTMLAnchorElement | null;
if (!modal || !title || !contentEl) return;
@@ -58,14 +59,23 @@ export async function openFileModal(filePath: string, type: string): Promise<voi
contentEl.textContent = 'Loading...';
modal.classList.remove('hidden');
// Setup install button
const installUrl = getVSCodeInstallUrl(type, filePath);
// Setup install buttons (VS Code and VS Code Insiders)
const installUrl = getVSCodeInstallUrl(type, filePath, false);
const installInsidersUrl = getVSCodeInstallUrl(type, filePath, true);
if (installUrl && installBtn) {
installBtn.href = installUrl;
installBtn.style.display = 'inline-flex';
} else if (installBtn) {
installBtn.style.display = 'none';
}
if (installInsidersUrl && installInsidersBtn) {
installInsidersBtn.href = installInsidersUrl;
installInsidersBtn.style.display = 'inline-flex';
} else if (installInsidersBtn) {
installInsidersBtn.style.display = 'none';
}
// Fetch and display content
const fileContent = await fetchFileContent(filePath);