Skip to content

fix(vscode): harden extension commands with overwrite flows, shared PR service, and UX polish#26

Merged
digitarald merged 1 commit intomainfrom
vscode-ext-hardening
Feb 17, 2026
Merged

fix(vscode): harden extension commands with overwrite flows, shared PR service, and UX polish#26
digitarald merged 1 commit intomainfrom
vscode-ext-hardening

Conversation

@digitarald
Copy link
Copy Markdown
Owner

Summary

Hardens the VS Code extension with consistent error handling, overwrite confirmation flows, a shared local PR service, and several UX improvements.

Changes

Bug fixes

  • Codicon rendering$(check) / $(error) don't render in progress.report(), replaced with /
  • Swallowed errors — auto-analyze .catch(() => {}) now logs with console.error
  • Generate overwrite — wrapped in try/catch to show "overwrite failed" instead of silently dropping

UX consistency

  • Overwrite flows — init, generate, and instructions commands now try force: false first, prompt "Overwrite" when all files exist, and use force: true on confirmation — with dedicated try/catch in each
  • File count in messages — all overwrite warnings now include the count ("All N files already exist")
  • Judge model config — added primer.judgeModel setting (no default, falls back to primer.model)
  • PR file picker — QuickPick with pre-selected Primer files before commit
  • Empty-files guard — PR command warns with actionable message when no Primer files found

Architecture

  • src/services/localPr.ts — extracted shared service for local PR workflows:
    • isPrimerFile() — pattern matching with Windows backslash normalization
    • detectGitHubRemote() — parse owner/repo from origin
    • getBranchInfo() — current + default branch (anchored origin/ regex)
    • getPrimerFilesFromStatus() — filtered git status
    • commitAndPush() — uses pushBranch() from git.ts for credential sanitization, accepts optional token
  • Extension PR command refactored to use shared service (removed direct simple-git import)
  • totalFiles / totalSkipped — instructions overwrite counts only areas with non-empty content

Tests

  • 11 new tests for isPrimerFile covering exact matches, suffixes, rejection, substring, and Windows backslash paths
  • All 275 tests pass, both typechecks clean

@digitarald digitarald marked this pull request as ready for review February 17, 2026 04:41
@digitarald digitarald merged commit 03c3446 into main Feb 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant