# TaskNotes 3.21.0

## New Features

### Custom User Fields System

**Custom User Fields Mapping** - Added ability to define custom frontmatter properties for task filtering, grouping, and sorting. Users can configure field mappings in Settings → Advanced → User Fields with support for text, number, date, boolean, and list field types. List fields preserve wikilinks and quoted tokens, while numeric fields intelligently parse mixed text-number values like "2-Medium" as numeric 2. *Contributed by @renatomen*

**Group and Sort by Custom User Fields** - Extended grouping and sorting functionality to work with user-defined custom fields. Includes type-aware comparators for each field type and proper group header ordering when grouping and sorting by the same field. *Contributed by @renatomen*

**User Fields in Task Modals** - Added custom user field support to task creation and edit modals with autocomplete suggestions from existing field values. Fields are stored as frontmatter properties and include change detection for edit scenarios. *Contributed by @callumalpass*

### Enhanced Task Interaction

**Configurable Click Behavior** - Added option to configure single-click and double-click behavior for task cards and inline task widgets. Users can choose between opening the edit modal or the source note file for each click type. Includes shared click handler utility with 250ms detection delay. *Contributed by @fastrick*

### Calendar Integration Enhancements

**Calendar Event Filename Templates** - Added separate filename template configuration for notes created from calendar events. Supports ICS-specific template variables including `{icsEventTitle}`, `{icsEventLocation}`, `{icsEventDescription}`, and `{icsEventTitleWithDate}`. The `{title}` variable now uses clean event titles without date suffixes. *Fixes issue #362 reported by @bepolymathe*

**Chronological ICS Event Sorting** - Fixed ICS calendar events to display in chronological order by start time within each day in the agenda view. Applied to both grouped and flat agenda view modes. *Fixes issue #472 reported by @Crunchnuggetz*

## Bug Fixes

### API Endpoint Improvements

**Custom Status Configuration Support** - Fixed API endpoints (`/api/nlp/parse` and `/api/nlp/create`) not respecting custom status configurations. API now uses proper default status logic matching the UI instead of hardcoded 'todo' values, with proper handling of boolean status values. *Fixes issue #487 reported by @23maverick23*

**Task Creation Defaults** - Fixed REST API endpoint (`POST /api/tasks`) missing default properties like scheduled dates, tags, and reminders. API-created tasks now receive the same defaults as UI-created tasks. *Fixes issue reported by @nightroman*

### Project Management Fixes

**Project Consolidation and Display** - Fixed project grouping to consolidate different formats pointing to the same file (e.g., `[[project]]` and `[[project|alias]]` now group together). Improved display formatting with clickable headers showing absolute paths without `.md` extensions and proper wikilink alias parsing. Task cards preserve original formats while grouping logic ignores display aliases. *Fixes issues #448 reported by @minchinweb and #469 reported by @anareaty*

### User Experience Improvements

**Tag Input Sanitization** - Added automatic sanitization to remove `#` prefixes from tag input, preventing duplicate tags like `#tag1` and `##tag1`. Applied to task creation, editing, and real-time input handling. *Fixes issue #331 reported by @AndreMonthy*

## Contributors

Special recognition goes to **@renatomen** for the extensive custom user fields system that forms the core of this release, including field mapping, filtering, grouping, and sorting capabilities.

Thanks to **@fastrick** for implementing the configurable click behavior feature.

Thanks to the following community members for their bug reports and feature requests:

- **@23maverick23** - Reported API custom status configuration issues with detailed technical analysis
- **@Crunchnuggetz** - Identified ICS calendar event sorting problem in agenda view
- **@minchinweb** - Reported project consolidation issues with wikilink variations  
- **@anareaty** - Identified project display formatting problems in kanban view
- **@bepolymathe** - Requested calendar event filename template functionality
- **@AndreMonthy** - Reported tag input sanitization issues with clear examples
- **@nightroman** - Reported API issues where defaults were not being applied