Skip to content

Conversation

@ashu8912
Copy link
Member

What this PR does / why we need it:

This PR tackles various UX issues like showing notification when a dalec build request is received also trims unnecessary output from terminal when asking for a build. It also adds a quick way to generate dalec spec.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the user experience of the Dalec VS Code extension by adding notification messages when builds start, improving dialog persistence with ignoreFocusOut, and removing verbose terminal output. It also introduces a new command and snippets for quickly generating Dalec spec files, along with improvements to path handling for better debugging support.

Changes:

  • Added notification messages when build/debug/rerun actions start to provide better user feedback
  • Added ignoreFocusOut: true to all input dialogs to prevent accidental dismissal when focus is lost
  • Removed terminal comment prefix output (simplified terminal display) and removed unused getTerminalCommentPrefix function
  • Implemented new "Dalec: New Spec" command and added code snippets for scaffolding Dalec specifications
  • Modified path handling to use absolute paths for Docker commands and added DAP message rewriting for proper breakpoint support
  • Auto-save dirty documents before building/debugging
  • Added artifact target detection to output RPM/DEB builds to local directories
  • Simplified JSON schema for the revision field to use a simpler type array syntax

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/extension.ts Registered new createNewSpec command for generating Dalec spec templates
src/commands/createNewSpec/createNewSpec.ts New command implementation that opens a YAML document with a basic Dalec spec template
src/commands/runBuildCurrentSpecCommand/runBuildCommand.ts Added auto-save, notification messages, absolute path handling, DAP message rewriting, and debug image metadata resolution
src/commands/runBuildCurrentSpecCommand/helpers/dapHelpers.ts Refactored DAP message handling to rewrite paths between absolute (VS Code) and relative (Docker) formats
src/commands/runBuildCurrentSpecCommand/helpers/targetHelpers.ts Added ignoreFocusOut: true to target picker dialogs
src/commands/runBuildCurrentSpecCommand/helpers/contextHelpers.ts Added ignoreFocusOut: true to context and args input dialogs
src/commands/runBuildCurrentSpecCommand/utils/pathHelpers.ts Modified getWorkspaceRootForUri to fallback to file directory for non-workspace files; updated getWorkspaceRelativeFsPath to handle workspace-relative paths
src/commands/runBuildCurrentSpecCommand/utils/dockerHelpers.ts Changed to use absolute paths for spec files and context, added artifact target detection with local output, commented out noCache functionality
src/commands/runBuildCurrentSpecCommand/utils/terminalHelpers.ts Removed unused getTerminalCommentPrefix function
src/commands/reRunLastAction/reRunLastAction.ts Added notification message and removed terminal comment output
snippets/dalec.code-snippets Added code snippets for Dalec spec scaffolding, git sources, docker image sources, and build steps
schemas/spec.schema.json Simplified revision field type definition from oneOf structure to simple type array
package.json Added breakpoints configuration for YAML, registered new createNewSpec command, and added snippets configuration
Comments suppressed due to low confidence (1)

src/extension.ts:75

  • Command registrations on lines 63, 67, 69-74 are not added to context.subscriptions, but the first command registration (line 59) is. This inconsistency could lead to resource leaks when the extension is deactivated, as these commands won't be properly disposed. All command registrations should be added to context.subscriptions.push() for proper cleanup.
	vscode.commands.registerCommand('dalec-vscode-tools.debugCurrentSpec', (uri?: vscode.Uri) =>
      runDebugCommand(uri, tracker, lastAction),
    );

	vscode.commands.registerCommand('dalec-vscode-tools.createNewSpec', () => createNewSpec());

	vscode.commands.registerCommand('dalec-vscode-tools.rerunLastAction', () => rerunLastAction(tracker, lastAction)),
    vscode.commands.registerCommand('dalec-vscode-tools.rerunLastActionBuild', () =>
      rerunLastAction(tracker, lastAction, 'build'),
    ),
    vscode.commands.registerCommand('dalec-vscode-tools.rerunLastActionDebug', () =>
      rerunLastAction(tracker, lastAction, 'debug'),
    ),

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Tatsinnit Tatsinnit requested a review from DannyBrito January 27, 2026 01:49
- Add ignoreFocusOut to all input boxes and quick picks to prevent accidental dialog dismissal
- Auto-save document before build/debug operations
- Add informational messages when starting build/debug operations
- Remove redundant terminal comments in favor of cleaner output
- Improve user feedback during build and debug workflows

Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
- Rename and refactor rewriteSourcePathsForBreakpoints to rewriteOutboundMessage
- Add rewriteInboundMessage to handle stackTrace responses from DAP server
- Fix path rewriting to work with both absolute and relative paths
- Ensure source paths in breakpoints and stack frames are correctly mapped
- Support bidirectional path translation between VS Code and Docker DAP

Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
- Use absolute paths for spec files and contexts to align with VS Code's file handling
- Add support for artifact targets (rpm, deb) with local output directories
- Improve target detection to apply image tagging to all non-artifact targets
- Add resolveDalecImageMetadata function to query package metadata from spec files
- Resolve image name and tag for debug sessions to avoid anonymous images
- Remove unused getTerminalCommentPrefix function
- Improve workspace path resolution for files outside workspace folders
- Add comprehensive JSDoc for resolveDalecImageMetadata function

Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
- Consolidate revision field type to accept both string and integer
- Remove redundant oneOf wrapper for cleaner schema definition
- Maintain backward compatibility with existing specs

Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
- Add new command 'Dalec: New Spec' to create template spec files
- Implement createNewSpec function to generate spec with common fields
- Add comprehensive code snippets for Dalec specs:
  - dalec-spec: Full spec skeleton with all common fields
  - dalec-source-git: Git source template
  - dalec-source-image: Docker image source template
  - dalec-step: Build step template
- Register createNewSpec command in extension activation
- Improve developer experience with quick scaffolding

Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
- Register breakpoint support for YAML language files
- Add Dalec code snippets contribution for YAML files
- Register 'Dalec: New Spec' command in command palette
- Configure snippets path to ./snippets/dalec.code-snippets
- Enable debugging experience for Dalec spec files

Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
@Tatsinnit Tatsinnit merged commit 4aa4980 into project-dalec:main Jan 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants