Compare commits

..

11 Commits

Author SHA1 Message Date
Ralph Khreish
b594795238 chore: run format to resolve CI issues 2025-08-01 00:14:25 +03:00
Carl Mercier
8f97b6aead refactor: normalize IDs once when loading JSON instead of scattered calls
- Normalize all tags' data when creating _rawTaggedData in readJSON
- Add support for handling malformed dotted subtask IDs (e.g., "5.1" -> 1)
- Remove redundant normalizeTaskIds calls from set-task-status, add-task, and move-task
- Add comprehensive test for mixed ID formats (string IDs and dotted notation)
- Cleaner, more maintainable solution that normalizes IDs at load time

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 00:14:25 +03:00
Carl Mercier
3f31c34f8d Simplified implementation 2025-08-01 00:14:25 +03:00
Carl Mercier
ef23beac0d fix: normalize task IDs to numbers on load to fix comparison issues
- Added normalizeTaskIds function to convert string IDs to numbers
- Applied normalization in readJSON for all code paths
- Fixed set-task-status, add-task, and move-task to normalize IDs when working with raw data
- Exported normalizeTaskIds function for use in other modules
- Added test case for string ID normalization

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 00:14:25 +03:00
Carl Mercier
077cbb99de Update scripts/modules/utils.js
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-08-01 00:14:25 +03:00
Carl Mercier
ee2af1760f Update scripts/modules/utils.js
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-08-01 00:14:25 +03:00
Carl Mercier
2421c205c4 Update scripts/modules/utils.js
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-08-01 00:14:25 +03:00
Carl Mercier
33208388bd Fix formatting once and for all 2025-08-01 00:14:25 +03:00
Carl Mercier
3fa0c7f7af Don't mess up formatting 2025-08-01 00:14:25 +03:00
Carl Mercier
0609b9ae28 Added test 2025-08-01 00:14:25 +03:00
Carl Mercier
b79eb4f7a2 fix: normalize task IDs to numbers on load to fix comparison issues
When tasks.json contains string IDs (e.g., "5" instead of 5), task lookups
fail because the code uses parseInt() and strict equality (===) for comparisons.

This fix normalizes all task and subtask IDs to numbers when loading the JSON,
ensuring consistent comparisons throughout the codebase without requiring
changes to multiple comparison locations.

Fixes task not found errors when using string IDs in tasks.json.
2025-08-01 00:14:25 +03:00

Diff Content Not Available