-
Notifications
You must be signed in to change notification settings - Fork 4
UX improvements and quick dalec spec generation #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c9969ce to
bb8bf99
Compare
There was a problem hiding this 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: trueto all input dialogs to prevent accidental dismissal when focus is lost - Removed terminal comment prefix output (simplified terminal display) and removed unused
getTerminalCommentPrefixfunction - 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
revisionfield 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 tocontext.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.
bb8bf99 to
285d89a
Compare
- 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>
285d89a to
27d8be2
Compare
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.