Commit Graph

188 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
renovate[bot] 662f3a1ea8
chore(deps): update dev-dependencies (major) (#1375) 2026-01-25 21:54:47 +01:00
kolaente e702785cf8
fix(filter): correct filter autocomplete for project names with spaces (#2012)
Filter expressions with multi-word values (such as project names with
spaces) are now automatically quoted to preserve them correctly as
single tokens in the filter syntax.

Fixes #2010

🐰 A filter's journey, refined with care,
Multi-word values now wear quotes fair,
Offsets aligned by the rabbit's precision,
Autocomplete flows with mathematical vision,
From comma to space, each boundary divine! 
2026-01-10 22:18:34 +01:00
kolaente f06e272225 test(frontend): add test for @keyup.enter forwarding in FormField
Verify that @keyup.enter modifier is properly forwarded to the inner
input element and only triggers for Enter key, not other keys.
2026-01-10 21:59:06 +01:00
kolaente 483ddc728d test(frontend): verify FormField generates unique IDs across instances
Mount multiple FormField components within the same Vue app to properly
test that useId() generates unique IDs for each instance. This validates
that labels correctly link to their respective inputs.
2026-01-10 21:59:06 +01:00
kolaente 8f0c7d504b test(frontend): add regression test for FormField $attrs event forwarding
Verify that FormField forwards $attrs event listeners (onKeyup, onFocusout)
to its inner input element. This ensures migrated templates using
@keyup.enter and @focusout continue to work correctly.
2026-01-10 21:59:06 +01:00
kolaente 182b0b63d1 fix(frontend): preserve numeric type in FormField v-model
When modelValue is a number, emit the value as a number instead of
coercing to string. This prevents subtle type bugs when using
FormField with numeric v-model bindings.
2026-01-10 21:59:06 +01:00
kolaente ac2f14945b feat(frontend): expose id via scoped slot in FormField
When using FormField with custom slot content, the slotted element
needs access to the generated inputId to ensure the label's for
attribute matches the input's id. This exposes the id via the
default slot: <template #default="{ id }">
2026-01-10 21:59:06 +01:00
kolaente 5ca600506b fix(frontend): expose focus method on FormField component
Components using FormField with a ref need to call .focus() on it.
Without exposing the method, these calls would fail since the ref
points to the component instance, not the underlying input element.
2026-01-10 21:59:06 +01:00
kolaente bb16500cb5 feat(frontend): add loading prop to FormField component
When loading is true, adds 'is-loading' class to the input element.
2026-01-10 21:59:06 +01:00
kolaente 3577ba5132 feat(frontend): add disabled prop to FormField component
When disabled is true, the component now automatically adds the
'disabled' CSS class and sets the native disabled attribute on the
input element.
2026-01-10 21:59:06 +01:00
kolaente bad314b5e3 fix(frontend): make FormField value binding conditional
When FormField is used without v-model (modelValue undefined), the
component was clearing user input on re-render. This broke login forms
that access the input value directly via refs for browser autofill
compatibility.

Now the value attribute is only bound when modelValue is explicitly
provided, allowing native input behavior when v-model isn't used.
2026-01-10 21:59:06 +01:00
kolaente eb1f852927 feat(frontend): add FormField component for form field abstraction
Introduces a reusable FormField component that abstracts Bulma's
field/control/input pattern into a single component. This provides
a consistent API for form fields and prepares the codebase for
future CSS framework migrations.

Features:
- v-model binding for form values
- label prop with automatic for attribute linking
- error prop for validation messages
- Default slot for custom inputs (selects, editors)
- addon slot for button addons
- Attribute passthrough via v-bind="$attrs"
- Exposed value getter for browser autofill workarounds

Includes 14 unit tests covering all functionality.
2026-01-10 21:59:06 +01:00
kolaente e5cfe3aa13 fix(button): fix button text color to #ffffff
Fixes regression introduced in cac2690fd6
2026-01-10 18:47:50 +01:00
kolaente b9ccc81ec0 fix(button): white color text for is-danger variant 2026-01-10 18:36:33 +01:00
kolaente cac2690fd6 fix(button): make sure button text color is always white 2026-01-10 18:31:18 +01:00
kolaente 9a3e79af8e
feat(frontend): add danger prop to XButton component (#2078)
The is-danger class no longer worked on XButton because the component uses scoped CSS. This adds a proper danger boolean prop that applies danger styling (red background) as a color modifier that works alongside any variant (primary, secondary, tertiary).
2026-01-10 17:22:19 +00:00
kolaente 745fde41ca
fix: prevent timezone field from overflowing container on smaller viewports (#2066)
Closes #2044
2026-01-08 14:30:04 +00:00
kolaente 909b35ea76
fix: multiselect clear button now properly clears the value (#2067)
Fixes #2045
2026-01-08 14:16:03 +00:00
kolaente ed0c9a8006 fix: invisible spinner 2026-01-08 13:23:38 +01:00
kolaente 40287a1570 refactor: move bulma button styles to button component 2026-01-08 13:23:38 +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 798ffc0582
fix: prevent emoji picker from closing when clicking search input (#1959)
Resolves
https://community.vikunja.io/t/cannot-search-for-reaction-emoji/4207/1

- Fixes the emoji reaction picker closing immediately when clicking
inside the search box
- The issue occurred because `vuemoji-picker` wraps
`emoji-picker-element` which uses Shadow DOM
- The `closeWhenClickedOutside` helper was using `parentElement`
traversal which doesn't cross shadow boundaries
2025-12-09 12:59:01 +01:00
kolaente dbb4046d51 fix(reaction): use the actual button element to compute rect, not the vue component
Resolves https://github.com/go-vikunja/vikunja/issues/1913
2025-12-01 15:48:59 +01: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 e7c0f5fab3 fix(components): fix all type errors in FilterAutocomplete.ts
- 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
2025-11-22 17:23:03 +01: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 ab8b93e9ab fix(components): suppress complex union type error in Button.vue
- 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
2025-11-22 17:23:03 +01:00
kolaente 59fedb6757 fix(components): add type guards and null checks in Multiselect
- Add null check for multiselectRoot before passing to closeWhenClickedOutside
- Add early return for null object in select function
- Add type guards for string vs object in setSelectedObject
- Add type guards for focus method in preSelect function
- Remove invalid length check on Element type
2025-11-22 17:23:03 +01:00
kolaente 81f85a3849 fix(components): add generic constraints and null checks in AutocompleteDropdown
- Add 'extends string' constraint to generic type T
- Add null check for model.value with nullish coalescing
- Add null check for scroller before accessing properties
- Add instanceof check for HTMLElement before accessing offsetTop
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
kolaente 508f91a97b fix: initialize date ref with null instead of undefined in Datepicker.vue 2025-11-22 17:23:03 +01:00
kolaente 3742234540 fix: add comprehensive null/undefined checks in Reactions.vue 2025-11-22 17:23:03 +01:00