This fixes a bug where when the task was opened in a modal and the user was editing the description and then pressing escape it would also close the task modal instead of only escaping from the editor itself.
* fix(editor): preserve consecutive whitespace in comments in TipTap
Ensure multiple spaces in comment content are no longer collapsed when editing/saving by:
- Adding SetContentOptions with parseOptions.preserveWhitespace = 'full'
- Applying those options to all setContent calls (initial load, exit edit mode, post-upload cleanup)
- Enabling preserveWhitespace in editor parseOptions
Previously, repeated spaces were normalized away after setContent(false), causing comments with deliberate spacing to be altered unexpectedly.
No behavioral changes beyond whitespace retention; renders identical except space fidelity.
* fix(editor): use preserveWhitespace true instead of full to avoid duplicate checklist items
The 'full' mode preserves all whitespace including between block elements,
which caused the HTML parser to create extra empty list items from newlines
between <li> tags. Using 'true' preserves whitespace in inline content only,
which still achieves the goal of preserving consecutive spaces in text while
not creating spurious nodes from formatting whitespace.
---------
Co-authored-by: maggch <maggch@outlook.com>
This change fixes a few issues with the TickTick import:
1. BOM (Byte Order Mark) Handling: Added stripBOM() function to properly handle UTF-8 BOM at the beginning of CSV files
2. Multi-line Status Section: Updated header detection to handle the multi-line status description in real TickTick exports
3. CSV Parser Configuration: Made the CSV parser more lenient with variable field counts and quote handling
4. Test Infrastructure: Added missing logger initialization for tests
5. Field Mapping: Fixed the core issue where CSV fields weren't being mapped to struct fields correctly
The main problem was in the newLineSkipDecoder function where:
- Header detection calculated line skip count on BOM-stripped content
- CSV decoder was also stripping BOM and applying the same skip count
- This caused inconsistent positioning and empty field mapping
Rewrote the decoder to use a scanner-based approach with consistent BOM handling.
Resolves https://github.com/go-vikunja/vikunja/issues/1870
- Add type filters for label and project arrays to remove undefined values
- Add @ts-expect-error for projectId parameter in getAll call
- Add type assertion for userService.getAll empty object parameter
- Add default value for prefix in destructuring
- Add null check for match.index
- Add type assertions for union type property access (username/title)
- Add null check for autocompleteContext
- Fix Selection.near call with @ts-expect-error comment
- Add optional chaining for array access that could be undefined
- Import Editor and Range types from @tiptap/core
- Add TranslateFunction type for t parameter
- Add SuggestionProps interface for props parameter
- Add type annotations for all command callbacks
- Add null check for document.getElementById result
- Add null check for props.event in onKeyDown
- Import Editor and Range types from @tiptap/core
- Add CommandProps interface for command callback
- Add type annotations for command callback parameters
- Add null check for DataTransferItem from items array
- Add undefined checks for check.children[1] before accessing
- Extract secondChild variable for safer access
- Add Event type for triggerImageInput and addImage
- Add MouseEvent type for setLink and clickTasklistCheckbox
- Add KeyboardEvent type for setFocusToEditor
- Add type assertions for event.target as HTMLElement
- Add proper null check for clipboardData.items before accessing length
- Replace for...of loop with indexed for loop to avoid iterator issue with DataTransferItemList
- Remove BaseButtonProps extension to avoid complex union type
- Use @ts-expect-error to suppress TS2590 error caused by IconProp
- Add computed properties for variant, shadow, and wrap with proper defaults