feat: improving Task API#180
Merged
tnaum-ms merged 11 commits intoJun 18, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances task management by introducing a simulated DemoTask, exporting it for wider use, and adding localized messages to support task lifecycle states.
- Introduce
DemoTaskclass with progress updates, optional failure simulation, and cleanup logic - Export
DemoTaskin the tasks index for external consumption - Add new localization keys for task initialization, progress, completion, failure, and stopping
- Update contributor guidelines regarding test file placement
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/services/tasks/DemoTask.ts | Implements DemoTask class that simulates work, reports progress, and optionally fails |
| src/services/taskService.test.ts | Adds comprehensive unit tests for TaskService and task state flows |
| l10n/bundle.l10n.json | Adds localized strings for task states and operations |
| .github/copilot-instructions.md | Revises testing guideline for test file placement |
Comments suppressed due to low confidence (2)
src/services/tasks/DemoTask.ts:16
- Newly introduced
DemoTasklacks dedicated unit tests. Consider adding tests to verify its progress reporting, cleanup behavior, and failure simulation.
export class DemoTask extends Task {
.github/copilot-instructions.md:239
- [nitpick] This update may conflict with the repository's convention of placing tests under the
test/folder mirroring source structure. Clarify whether tests should be co-located with code or in a separatetest/directory.
- Keep tests in the same directory as the code they test.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces new task-related features and updates localization strings to support task management and progress tracking. The most significant changes include the addition of a
DemoTaskclass to demonstrate task handling and progress updates, and new localized strings for task states and operations.Task Management Enhancements:
src/services/tasks/DemoTask.ts: Added aDemoTaskclass that simulates a task with progress updates and optional failure for testing purposes. It includes initialization, cleanup, and error handling logic.src/services/tasks/index.ts: Exported theDemoTaskclass to make it accessible for use in other parts of the application.Localization Updates:
l10n/bundle.l10n.json: Added several new localized strings related to task states and operations, including messages for task initialization, progress tracking, completion, failure, and stopping. [1] [2] [3] [4] [5] [6]