|
273 | 273 | border-bottom: 1px solid #dee2e6; |
274 | 274 | } |
275 | 275 |
|
| 276 | + /* IDE Selector Styles */ |
| 277 | + .ide-selector { |
| 278 | + display: flex; |
| 279 | + align-items: center; |
| 280 | + gap: 8px; |
| 281 | + margin-bottom: 20px; |
| 282 | + flex-wrap: wrap; |
| 283 | + } |
| 284 | + |
| 285 | + .ide-selector-label { |
| 286 | + font-size: 0.9em; |
| 287 | + color: #495057; |
| 288 | + font-weight: 500; |
| 289 | + } |
| 290 | + |
| 291 | + .ide-buttons { |
| 292 | + display: flex; |
| 293 | + gap: 8px; |
| 294 | + flex-wrap: wrap; |
| 295 | + } |
| 296 | + |
| 297 | + .ide-btn { |
| 298 | + padding: 4px 12px; |
| 299 | + border: 1px solid #dee2e6; |
| 300 | + border-radius: 4px; |
| 301 | + background: white; |
| 302 | + color: #495057; |
| 303 | + font-size: 0.8em; |
| 304 | + font-weight: 500; |
| 305 | + cursor: pointer; |
| 306 | + transition: all 0.2s ease; |
| 307 | + display: flex; |
| 308 | + align-items: center; |
| 309 | + gap: 4px; |
| 310 | + } |
| 311 | + |
| 312 | + .ide-btn:hover { |
| 313 | + border-color: #667eea; |
| 314 | + background: #f0f4ff; |
| 315 | + } |
| 316 | + |
| 317 | + .ide-btn.active { |
| 318 | + border-color: #667eea; |
| 319 | + background: #667eea; |
| 320 | + color: white; |
| 321 | + } |
| 322 | + |
| 323 | + .ide-btn .ide-icon { |
| 324 | + font-size: 1.1em; |
| 325 | + } |
| 326 | + |
276 | 327 | .search-input-wrapper { |
277 | 328 | position: relative; |
278 | 329 | width: 100%; |
@@ -564,6 +615,16 @@ <h2>🤖 Phase 2 (TL;DR) - AI Triage Summary</h2> |
564 | 615 | <!-- Findings Section --> |
565 | 616 | <div class="section"> |
566 | 617 | <h2>📋 Findings ({{FINDINGS_COUNT}})</h2> |
| 618 | + <!-- IDE Selector --> |
| 619 | + <div class="ide-selector"> |
| 620 | + <span class="ide-selector-label">Open in:</span> |
| 621 | + <div class="ide-buttons"> |
| 622 | + <button class="ide-btn" data-ide="vscode" title="Open in VS Code">💻 VS Code</button> |
| 623 | + <button class="ide-btn" data-ide="cursor" title="Open in Cursor">⚡ Cursor</button> |
| 624 | + <button class="ide-btn" data-ide="augment" title="Open in Augment">🔮 Augment</button> |
| 625 | + <button class="ide-btn" data-ide="file" title="Use file:// protocol">📁 File</button> |
| 626 | + </div> |
| 627 | + </div> |
567 | 628 | {{FINDINGS_HTML}} |
568 | 629 | </div> |
569 | 630 |
|
@@ -630,8 +691,60 @@ <h2>✓ Checks Summary</h2> |
630 | 691 | }); |
631 | 692 | } |
632 | 693 |
|
| 694 | + // IDE Protocol Configuration |
| 695 | + const ideProtocols = { |
| 696 | + vscode: { prefix: 'vscode://file', format: (file, line) => line ? `vscode://file${file}:${line}` : `vscode://file${file}` }, |
| 697 | + cursor: { prefix: 'cursor://file', format: (file, line) => line ? `cursor://file${file}:${line}` : `cursor://file${file}` }, |
| 698 | + augment: { prefix: 'augment://file', format: (file, line) => line ? `augment://file${file}:${line}` : `augment://file${file}` }, |
| 699 | + file: { prefix: 'file://', format: (file, line) => `file://${file}` } |
| 700 | + }; |
| 701 | + |
| 702 | + // IDE Selector functionality |
| 703 | + function initIdeSelector() { |
| 704 | + const ideButtons = document.querySelectorAll('.ide-btn'); |
| 705 | + const ideLinks = document.querySelectorAll('.ide-link'); |
| 706 | + |
| 707 | + // Load saved preference or default to 'file' |
| 708 | + const savedIde = localStorage.getItem('wp-code-check-ide') || 'file'; |
| 709 | + |
| 710 | + // Set initial active state and update links |
| 711 | + updateIdeSelection(savedIde, ideButtons, ideLinks); |
| 712 | + |
| 713 | + // Add click handlers to IDE buttons |
| 714 | + ideButtons.forEach(btn => { |
| 715 | + btn.addEventListener('click', function() { |
| 716 | + const ide = this.dataset.ide; |
| 717 | + localStorage.setItem('wp-code-check-ide', ide); |
| 718 | + updateIdeSelection(ide, ideButtons, ideLinks); |
| 719 | + }); |
| 720 | + }); |
| 721 | + } |
| 722 | + |
| 723 | + function updateIdeSelection(ide, buttons, links) { |
| 724 | + // Update button states |
| 725 | + buttons.forEach(btn => { |
| 726 | + if (btn.dataset.ide === ide) { |
| 727 | + btn.classList.add('active'); |
| 728 | + } else { |
| 729 | + btn.classList.remove('active'); |
| 730 | + } |
| 731 | + }); |
| 732 | + |
| 733 | + // Update all links |
| 734 | + const protocol = ideProtocols[ide] || ideProtocols.file; |
| 735 | + links.forEach(link => { |
| 736 | + const file = link.dataset.file; |
| 737 | + const line = link.dataset.line; |
| 738 | + if (file) { |
| 739 | + link.href = protocol.format(file, line); |
| 740 | + } |
| 741 | + }); |
| 742 | + } |
| 743 | + |
633 | 744 | // Convert UTC timestamp to local time |
634 | 745 | document.addEventListener('DOMContentLoaded', function() { |
| 746 | + // Initialize IDE selector |
| 747 | + initIdeSelector(); |
635 | 748 | // Get the UTC timestamp from the page |
636 | 749 | const utcTimestamp = '{{TIMESTAMP}}'; |
637 | 750 |
|
|
0 commit comments