mirror of
https://github.com/taskgenius/taskgenius-plugin.git
synced 2026-07-22 06:40:25 +00:00
Implements path-based recognition for FileSource, allowing users to designate specific directories as task directories. Files within these paths are automatically recognized as tasks. Features: - Three matching modes: prefix, glob, and regex patterns - Configurable task paths via settings UI - Dynamic examples based on selected matching mode - Support for multiple path patterns The glob mode supports standard patterns: - * matches any chars except / - ** matches any chars including / - ? matches single char This completes the Phase 2 path strategy implementation for FileSource.
2 KiB
2 KiB
Test Path Strategy
This is a simple test to verify that the Path strategy implementation is working correctly.
Implementation Summary
1. FileSource.ts Updates
- ✅ Added
PathRecognitionConfigimport - ✅ Implemented
matchesPathStrategymethod with support for:- prefix mode: Simple prefix matching (e.g.,
Projects/matchesProjects/App.md) - regex mode: Regular expression matching
- glob mode: Glob pattern matching (supports
*,**,?)
- prefix mode: Simple prefix matching (e.g.,
- ✅ Added
matchGlobPatternhelper method for glob pattern conversion - ✅ Updated strategy evaluation to include path strategy
2. FileSourceSettings.ts Updates
- ✅ Replaced placeholder with full Path strategy configuration UI
- ✅ Added TextArea for entering task paths (one per line)
- ✅ Added Dropdown for selecting matching mode
- ✅ Added dynamic examples based on selected mode
- ✅ Kept Template strategy placeholder for future implementation
Features
Path Matching Modes
-
Prefix Mode
- Simplest mode for basic directory matching
- Example:
Projects/matches all files under Projects folder
-
Glob Mode
- Supports standard glob patterns
*matches any characters except/**matches any characters including/?matches single character- Examples:
Projects/**/*.md- all .md files in Projects and subfoldersTasks/*.task.md- files ending with .task.md in Tasks folder
-
Regex Mode
- Full regular expression support for advanced users
- Example:
^Tasks/\d{4}-\d{2}-\d{2}- files starting with date in Tasks
Configuration
Users can now:
- Enable Path-based Recognition in Settings > Index > File as Task
- Enter multiple task paths (one per line)
- Choose matching mode (prefix, glob, or regex)
- See context-sensitive examples for the selected mode
Build Status
✅ Build completed successfully ✅ TypeScript compilation passed (with expected Jest type conflicts) ✅ All functionality integrated into existing codebase