Allow task with subtask as an option for pinned task lists#63
Conversation
Problem: current implementation explicitly expects pinned task lists to be task lists (Teamwork API explicitly differentiates between task lists and tasks with subtasks, and the current implementation does not account for this). Solution: update the implementation to allow pinned task lists to be either task lists or tasks with subtasks.
|
There was a problem hiding this comment.
Pull request overview
This PR updates the Teamwork pinned task list implementation so a pinned ID can represent either a Teamwork task list or a single task whose subtasks should be displayed, aligning WTC behavior with Teamwork’s API distinctions.
Changes:
- Refactors task response parsing to reuse a shared normalization function.
- Adds support for fetching and normalizing a task’s subtasks, plus a helper that chooses between task-list tasks vs subtasks for a pinned ID.
- Updates the generated project config template to document that pinned IDs may refer to task lists or tasks-with-subtasks.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/api/teamwork/task-list-tasks.ts | Adds shared normalization + new subtasks and “task list or subtasks” fetch path for pinned IDs. |
| src/api/config/templates.ts | Updates YAML template comment to document expanded pinned ID meaning. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Problem: current implementation explicitly expects pinned task lists to be task lists (Teamwork API explicitly differentiates between task lists and tasks with subtasks, and the current implementation does not account for this). Solution: update the implementation to allow pinned task lists to be either task lists or tasks with subtasks. - Resolving a direct conflict where both branches rewrote the getTeamworkTaskListTasks function. Main updated the function to try/catch and error on failure, while this update pulls the logic out into a shared normalizeTeamworkTasks function.
Summary
Problem: current implementation explicitly expects pinned task lists to be task lists (Teamwork API explicitly differentiates between task lists and tasks with subtasks, and the current implementation does not account for this).
Solution: update the implementation to allow pinned task lists to be either task lists or tasks with subtasks.
Type of Change
Local Verification
bun run fmtbun run lintbun run checkbun run buildRelease Impact
.changeset/