Commit Graph

83 Commits

Author SHA1 Message Date
kolaente bc2f7e5840
fix: break long continuous strings in editor to prevent overflow
Fixes https://github.com/go-vikunja/vikunja/issues/2266
2026-02-19 16:11:43 +01:00
kolaente e5da54e58a fix(editor): prevent crash when exiting edit mode in tiptap
Use v-show instead of v-if for EditorToolbar and BubbleMenu to avoid
a race condition between Vue's DOM reconciliation and tiptap's internal
DOM manipulation during unmount. This fixes the "Cannot read properties
of null (reading 'insertBefore')" error that occurred when saving a
task description.

Adds regression test to verify the fix.

Upstream issue: https://github.com/ueberdosis/tiptap/issues/7342
Fixes: https://github.com/go-vikunja/vikunja/issues/1770
2026-01-27 14:03:02 +01:00
kolaente ef1efbc29a
fix(editor): make sure checkbox lists are unique (#2007)
This fixes a checkbox persistence bug where toggling one checkbox would affect others with identical text. To make this work, a new unique `data-task-id` attribute was added to each task list item for reliable identification.

Fixes #293, #563

🐰 With nanoid's magic and IDs so fine,
Each checkbox now knows which line is mine,
No more lost state when the page reloads—
Tasks persist through every browser node!
2025-12-19 17:12:31 +01:00
kolaente 4993ea2bbe
fix(editor): prevent TypeError when typing mentions in comments (#1997)
Fix TypeError when typing `@` mentions in task comments, add null checks for `component` variable in `mentionSuggestion.ts` to handle race conditions where `onUpdate` or `onKeyDown` fire before `onStart` completes
2025-12-16 22:56:05 +00:00
kolaente 9626382667 fix(editor): close only editor when pressing escape
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.
2025-11-27 22:24:22 +01:00
kolaente 16790e19f9
fix(editor): preserve consecutive whitespace in comments in TipTap (#1893)
* 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>
2025-11-27 19:10:22 +00:00
kolaente 34575e4eb7 fix(editor): don't convert text that's pasted into a code block to markdown
Resolves https://community.vikunja.io/t/pasting-into-code-block-renders-markdown/4181
2025-11-26 23:27:33 +01:00
kolaente 719d06a991
feat(editor): automatically save draft comments locally (#1868)
Resolves https://github.com/go-vikunja/vikunja/issues/1867
2025-11-24 22:23:58 +00:00
kolaente fe9bc02d10 fix(components): use ts-expect-error in mentionSuggestion.ts
- Replace 'as any' with @ts-expect-error comment
- This is needed because projectId is used for URL replacement but not part of IAbstract
2025-11-22 17:23:03 +01:00
kolaente 412fd3a221 fix(components): add type assertions in MentionUser.vue
- Import IUser type
- Add type assertion for username from node.attrs.id
- Add type assertion for fetchAvatarBlobUrl return value
2025-11-22 17:23:03 +01:00
kolaente 642cd08b9d fix(components): add type annotations in MentionList.vue
- Import PropType and MentionNodeAttrs
- Add MentionItem interface
- Add PropType for items array and command function
2025-11-22 17:23:03 +01:00
kolaente 30101308ea fix(components): add type annotations in suggestion.ts
- 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
2025-11-22 17:23:03 +01:00
kolaente ddf018e791 fix(components): add type annotations in setLinkInEditor.ts
- Import Editor type from @tiptap/core
- Add DOMRect type for pos parameter
- Add Editor | null | undefined type for editor parameter
2025-11-22 17:23:03 +01:00
kolaente d46afda42b fix(components): add type annotations in commands.ts
- Import Editor and Range types from @tiptap/core
- Add CommandProps interface for command callback
- Add type annotations for command callback parameters
2025-11-22 17:23:03 +01:00
kolaente 3a52a86980 fix(components): add undefined checks in TipTap.vue
- Add null check for DataTransferItem from items array
- Add undefined checks for check.children[1] before accessing
- Extract secondChild variable for safer access
2025-11-22 17:23:03 +01:00
kolaente 0987e382e4 fix(components): add type annotations for event parameters in TipTap.vue
- 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
2025-11-22 17:23:03 +01:00
kolaente bff5ed6403 fix(components): use correct SetContentOptions in TipTap.vue
- Replace false with {emitUpdate: false} in setContent calls
- Fix 3 SetContentOptions type errors
2025-11-22 17:23:03 +01:00
kolaente eab1a211ae fix(components): fix clipboard data null checks in TipTap.vue
- Add proper null check for clipboardData.items before accessing length
- Replace for...of loop with indexed for loop to avoid iterator issue with DataTransferItemList
2025-11-22 17:23:03 +01:00
kolaente 278eae387c fix(components): add type guards and assertions in TipTap.vue
- Add HTMLImageElement instanceof check before accessing src property
- Add type assertions for getBlobUrl return value and cache access
2025-11-22 17:23:03 +01:00
kolaente 1275cb7fc5 fix(components): correct FontAwesome icon format in TipTap.vue
- Change icon format from ['fa', 'fa-bold'] to ['fas', 'bold']
- Fix 6 icon type errors by using correct IconPrefix and IconName format
2025-11-22 17:23:03 +01:00
kolaente 4cd53c204d fix: add proper type definitions for CommandItem in CommandsList.vue 2025-11-22 17:23:03 +01:00
kolaente cc76b87b89 fix: use proper FontAwesome icon types in EditorToolbar.vue 2025-11-22 17:23:03 +01:00
Weijie Zhao b3b420121d
fix(editor): prevent image insertion from triggering save (#1846)
Ensure inserting an image only updates editor content without firing implicit save or switching out of edit mode. This keeps user in edit flow and avoids unintended save events.
2025-11-21 15:22:46 +01:00
kolaente 435d029f33
feat: show avatar for mentioned users 2025-11-10 11:25:47 +01:00
kolaente 0d83a568ce
chore: reorganize mention setup 2025-11-10 11:24:45 +01:00
Weijie Zhao 43a5ae1309
feat: enable user mentions in task description & comments (#1754) 2025-11-09 19:42:38 +01:00
kolaente 03f04f0787
fix(task): slash menu appearing behind modals (#1752)
The slash menu in the editor was appearing behind task detail modals
(z-index 4000) because it had a z-index of only 1000. This made the
menu inaccessible when editing task descriptions in Kanban view.

Updated the z-index to 4700 to place it above modals while keeping
it below system notifications (z-index 9999).

Fixes #1746
2025-11-05 10:29:19 +00:00
Weijie Zhao d7d3078de5
fix: prevent keyboard events during IME composition (#1535) 2025-10-06 18:17:52 +02:00
kolaente a3200f4149
feat(editor): add message to list of allowed link protocols (#1284)
Resolves #1282
2025-08-13 09:35:17 +00:00
kolaente 63319e19ad fix: style issues 2025-08-06 10:55:23 +02:00
kolaente d5de5a4f0d
feat(deps): update tiptap to v3 (#1241) 2025-08-05 21:23:35 +02:00
kolaente a9924881c2 feat: replace bottom with logical properties 2025-08-03 15:05:48 +02:00
kolaente 0f5e0019ae feat: replace right with logical properties 2025-08-03 15:05:48 +02:00
kolaente 0159ddc313 feat: replace top with logical properties 2025-08-03 15:05:48 +02:00
kolaente 21943b61eb feat: replace border-top with logical properties 2025-08-03 15:05:48 +02:00
kolaente a25a4a00c9 feat: replace absolute left position with inset-inline-start 2025-08-03 15:05:48 +02:00
kolaente d290f2e99c feat: add logical utils 2025-08-03 15:05:48 +02:00
kolaente 16f7fa087a fix: convert all css properties to logical 2025-08-03 15:05:48 +02:00
kolaente 5a406b2ecc
chore: use bulma sr-only styles instead of tailwind's 2025-07-22 19:40:17 +02:00
Dominik Pschenitschni 495633d112
fix(editor): prevent links from extending after space (#1059) 2025-07-02 17:50:40 +02:00
Dominik Pschenitschni 454418ee63 chore: fix indentation 2025-06-19 10:53:35 +02:00
Dominik Pschenitschni a1655489ab
fix(frontend): mark only clicked task item (#891) 2025-06-16 22:43:54 +02:00
kolaente a9714f6a4a
fix: improve markdown paste detection (#939) 2025-06-13 09:05:08 +00:00
kolaente f487f81f52
fix(editor): pasted link capturing trailing text (#912) 2025-06-10 21:09:14 +02:00
Dominik Pschenitschni bb9dc03351
fix: add newline at end of line (#827) 2025-05-24 13:57:47 +02:00
kolaente ce3d49cc02
fix(editor): make pasting a file work again
It seems like only one paste handler is possible - with the change  inf52a321acf19b8925a5285abf09ae3ed51ea4ca8 the paste handler for the image paste did not work anymore.

Resolves https://community.vikunja.io/t/feature-suggestion-paste-images-directly-into-description-comment-from-clipboard/3656
2025-05-20 16:57:26 +02:00
kolaente 96ec7b17bc
fix(editor): upload image via toolbar button
Resolves https://community.vikunja.io/t/unable-to-add-task-attachments/3329
2025-03-09 12:52:16 +01:00
kolaente 4ba5aeb911
fix(editor): add rounded edges to code highlight 2025-03-09 09:27:18 +01:00
kolaente f52a321acf feat: convert pasted markdown to html so that it is correctly rendered (#3041)
Resolves https://community.vikunja.io/t/markdown-as-first-class-citizen/2975/4

Reviewed-on: https://kolaente.dev/vikunja/vikunja/pulls/3041
Co-authored-by: kolaente <k@knt.li>
Co-committed-by: kolaente <k@knt.li>
2025-02-21 15:53:47 +00:00
kolaente 32e97b8d6f
fix(a11y): add labels to editor buttons 2025-01-22 11:20:21 +01:00