Skip to content

Refactor duplicate extension helpers - #18

Open
aalmada wants to merge 1 commit into
mainfrom
refactor/deslop-codebase
Open

aalmada wants to merge 1 commit into
mainfrom
refactor/deslop-codebase

Conversation

@aalmada

@aalmada aalmada commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Pull request

Summary

Consolidate repeated webview controls, YAML editing helpers, marketplace refresh logic, and command redaction while preserving behavior and safety checks. No user-visible behavior changes are intended.

The local Deslop scan decreased from 27 to 4 warnings; six additional loosely similar informational matches remain where the behavior or validation differs.

Related issue (if any): None.

Validation

  • rtk npm run typecheck — passed.
  • rtk npm run lint — passed.
  • set -o pipefail; npm test | tail -15 — passed: 396 tests; 14 opt-in real, legacy, and private CLI tests skipped.
  • rtk npm run build — passed.
  • rtk npm run test:browser -- --output test-results/deslop-pr-0341af1f — passed: 13 tests.
  • rtk npm run docs:screenshots -- --output test-results/deslop-screenshots-0341af1f — passed; generated fictional screenshots match the committed images byte-for-byte (rtk bypass diff -qr docs/images test-results/deslop-screenshots-0341af1f).
  • npm run test:extension — not run locally; redirected HOME on macOS risks a Keychain prompt.
  • npm run package — not run; packaging is unchanged.

The screenshots below use fictional fixture data and are unchanged by this refactor:

Marketplace management

MCP server management

Checklist

  • I read CONTRIBUTING.md and kept the change focused.
  • I added or updated tests for changed behavior, or explained why none are needed. Focused redaction and marketplace-source regression cases were added.
  • I updated relevant user documentation, or explained why none is needed. The refactor does not change user-facing behavior; regenerated screenshots are unchanged.
  • I checked that logs, fixtures, and screenshots contain no credentials or private data. Screenshots use fictional fixtures, and no logs are attached.
  • If changing APM dependencies, I committed the manifest, lockfile, and APM-deployed files together without hand-editing generated files. Not applicable; APM dependencies are unchanged.

Share UI, YAML editing, command redaction, and refresh logic while preserving existing behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings December 2, 2026 20:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues blocking the shared-helper consolidation.

No open issues 🎉

What changed in this PR

Consolidates duplicate helpers across the APM VS Code extension, with no intended user-visible behavior changes.

Changes:

  • Reuses shared webview controls, YAML editing utilities, and validation helpers.
  • Centralizes marketplace refresh logic and command redaction.
  • Adds regression cases for command redaction and marketplace source parsing.
File Description
test/​config/​marketplaces.test.ts Adds marketplace ref-splitting regression cases.
test/​apm/​redact.test.ts Tests formatted command redaction.
src/​webview/​main.ts Consolidates repeated UI controls and rendering helpers.
src/​taskProvider.ts Extracts shared cancellation and trust checks.
src/​protocol.ts Reuses control-character validation.
src/​mcpManager.ts Shares input prompts and command redaction.
src/​marketplaceManager.ts Consolidates output summaries and authentication dispatch.
src/​manifestAssistance.ts Reuses YAML rendering and comment helpers.
src/​extension.ts Consolidates catalog refresh and command formatting.
src/​config/​sync.ts Reuses output summarization.
src/​config/​projectMarketplaces.ts Shares YAML editing and marketplace validation helpers.
src/​config/​mcpServers.ts Reuses object and control-character checks.
src/​config/​marketplaces.ts Exports local-source detection and shares validation.
src/​apm/​yamlAssistance.ts Adds shared YAML editing utilities.
src/​apm/​remoteMetadata.ts Reuses control-character validation.
src/​apm/​redact.ts Adds a shared redacted command formatter.
src/​apm/​adapters.ts Adds control-character and output-summary helpers.

Review effort: Balanced

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.

2 participants