mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-05-06 03:27:53 -05:00
Sorting oftentimes not working on filtered views #2221
Closed
opened 2026-03-22 13:58:02 -05:00 by GiteaMirror
·
16 comments
No Branch/Tag Specified
main
renovate/dev-dependencies
feat-v2-foundation
dependabot/npm_and_yarn/frontend/axios-1.15.2
spike-huma-openapi3
claude/investigate-swagger3-support-nyyUa
feat-list-view-buckets
ci-mysql-8-test
codex/analyze-codebase-for-email-task-feature
feat-project-templates
csv-import-feature
claude/email-reply-comments-wpdcQ
fix-oidc-pkce-support
fix/overview-subtasks-expand
feat/bucket-select-task-detail
feat-soft-delete-projects
claude/review-bot-design-plan-cf5C3
claude/project-scoped-api-tokens-KTqR3
claude/explore-openclaw-integration-KQEzg
claude/project-scoped-api-tokens-yv5KS
fix-duplicate-close-button
feat-list-view-sorting
feat/official-vite-sentry-plugin
feat/highlight-overdue-tasks
feat/add-enter-key-form-submission-handling
feat/TipTap-nits
feat/update-caldavtimetotimestamp-parsing
feat-phosphor-icons
wip-plans
claude/investigate-issue-2173-llKme
fix-description-text-drag
feat-custom-keyboard-shortcuts
pr-1845-ci
codex/fix-drag-and-drop-behavior-inconsistency
copilot/add-clickable-labels-for-filtering
copilot/fix-issue-1786
playwright-migration
fix-kanban-repeating-wip
copilot/fix-1498
feature/replace-axios
codex/upgrade-to-tailwind-4.1.8-using-pnpm
codex/add-cypress-test-for-avatar-types
feature/biome
feature/oxc
codex/update-flexsearch-to-0.8.205
4r6ni9-codex/fix-deprecated-sass-@import-usage
codex/fix-deprecated-sass-@import-usage
codex/add-cypress-test-for-task-list-refresh-fix
codex/fix-quick-add-magic-not-adding-tasks
codex/fix-all-type-errors
codex/fix-mimetype-for-docs.json
feature/caldav-from-scratch
feature/gh-actions-hetzner
fix-ci
feat/new-logger
jyte-better-dev-config
feat/add-team-member-with-enter
fix/button-and-icon-types
fix/notifications-component-name-collision
feature/null-time
renovate/tailwindcss-4.x
feature/unplugin-vue-router
fix/deprecated-import
feature/zod-schema
renovate/golangci-golangci-lint-1.x
fix/tiptap-editor-reactive-destructuring
release/0.24
feat/improve-add-task
fix/saved-filter-search
feat/webp-and-avif-attachment-previews
feature/migrate-back-to-bulma
fix/sass-add-missing-list-import
feature/sticky-demo-bar
fix/gantt-view-switch
feature/typesense-position-join
feature/focus-visible
dependencies/golangci-lint
feature/better-filter-syntax
fix/tiptap-task-list
renovate/github.com-golang-jwt-jwt-v4-5.x
feature/hide-forbidden-related-tasks
renovate/golang-1.x
release/0.20
release/0.17
release/0.16
release/0.15
release/0.14
v2.3.0
v2.2.2
v2.2.1
v2.2.0
v2.1.0
v2.0.0
v1.1.0
v1.0.0
v1.0.0-rc4
v1.0.0-rc3
v1.0.0-rc2
v1.0.0-rc1
v1.0.0-rc0
v0.24.6
v0.24.5
v0.24.4
v0.24.3
v0.24.2
v0.24.1
v0.24.0
v0.23.0
v0.22.1
v0.22.0
0.21.0
v0.21.0
v0.20.4
v0.20.5
v0.20.3
v0.20.2
v0.20.1
v0.20.0
v0.19.2
v0.19.1
v0.19.0
vue3
v0.18.1
v0.18.0
v0.17.1
v0.17.0
v0.16.1
v0.16.0
v0.15.1
v0.15.0
v0.14.1
v0.14.0
v0.13.1
v0.13
v0.12
v0.11
v0.10
v0.9
v0.8
v0.7
v0.6
v0.5
v0.4
v0.3
v0.2
v0.1
Labels
Clear labels
area/api
area/attachments
area/auth
area/avatars
area/backup-restore
area/caldav
area/calendar-view
area/comments
area/config
area/database
area/desktop
area/docker
area/email
area/favorites
area/filters
area/frontend
area/gantt
area/i18n
area/import-export
area/internal-code
area/kanban
area/labels
area/list-view
area/mobile
area/notifications
area/permissions
area/projects
area/pwa
area/recurring-tasks
area/reminders
area/search
area/shortcuts
area/subtasks
area/sync
area/table-view
area/task-editor
area/task-metadata
area/task-relations
area/teams
area/theming
area/time-tracking
area/typesense
area/views
area/webhooks
bug
changes requested
concern/accessibility
concern/performance
concern/regression
concern/ux
confirmed
db/mysql
dependencies
enhancement
good first issue
help wanted
integration/inbound
integration/outbound
kind/bug
kind/feature
needs reproduction
pull-request
question
security
support
upstream issue
waiting for reply
wontfix
Mirrored from GitHub Pull Request
No Label
area/filters
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/vikunja#2221
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @fritzbauer on GitHub (May 1, 2025).
Description
Expected behavior
When sorting tasks via drag and drop on the list view of a saved filter the sort order should be persisted.
Actual behavior
Sorting via Drag and Drop works fine, however when changing to a different page and going to the filtered view again, the sorting is in a different sort order as it was DragNDropped before.
Steps to replicate
Replicated on try.vikunja.io & local git repo:
done = false && dueDate > now+2d/projects/:project/views/:view/tasksendpoint --> All tasks will have position: 0https://try.vikunja.io/api/v1/tasks/244/positionwith position 0:{"task_id":244,"project_view_id":369,"position":0}Issue details
Sorting is not persisted properly whenever there are tasks with position 0 involved. Proper sorting is not possible without any initial position values. So it seems the root cause is that
projects/:project/views/:view/tasksdoes return position values "0".Solution ideas
I am not familiar with all concepts, therefore I hesitated to create a PR for this. My initial idea would be to use
calculateNewPositionForTask()in tasks.go:addMoreInfoToTask() whenever there is no position value in the map for a specific task.Thank you very much for providing this awesome task management tool!
Vikunja Version
Version: v0.24.1-1119-7b626cd2
Browser and version
Not a frontend problem - replicated in Chrome & Edge
Can you reproduce the bug on the Vikunja demo site?
Yes
Screenshots
No response
@kolaente commented on GitHub (May 9, 2025):
Do you only see this with saved filters?
@fritzbauer commented on GitHub (May 15, 2025):
I need to admit, in my daily workflow I usually do not sort on project level, but I was not able to replicate the problem on projects itself.
@kolaente commented on GitHub (Aug 31, 2025):
I've tried replicating this again on the demo just now - it seems to work as expected.
Here's what I did:
done = false(the actual filter should not matter here)Does this work for you?
@fritzbauer commented on GitHub (Aug 31, 2025):
The problem still occurs. My replication steps above still work - just tested.
In your replication steps you forgot to create any Tasks ;-)
Thanks for your help!
@kolaente commented on GitHub (Aug 31, 2025):
There have been tasks in the filter. Does that mean the bug only appears when creating new tasks between reordering?
@fritzbauer commented on GitHub (Sep 1, 2025):
Yes, when you create a new task it will have an initial position value of 0.
This is not a problem if you only create a single task, as soon as you sort it it will retrieve a position value which can be calculated from all the other tasks which have position values.
But if many or all tasks do not have a position, it struggles to reorder my task with position 0 after this other task with position 0, but before some more tasks with position 0.
In my workflow I use multiple date based filtered views: today, tomorrow, etc.
When you create a task for a future date it will not be part of the "today" view.
But at some point several of my previously created tasks become a "today" task. And all of them will have a position of 0 initially. So when I do my daily planning I'll sort the tasks just to find a sorting mess after refresh. When ordering for the second time it works since all currently active tasks received a position. When spontaneously adding new tasks for today they will be broken and unsortable.
@kolaente commented on GitHub (Sep 1, 2025):
Thanks for clarifying. Does this loosing of the position only affect new tasks (for example, those which "become" today at some point) or all of the tasks already in the filter?
@fritzbauer commented on GitHub (Sep 1, 2025):
@kolaente commented on GitHub (Sep 11, 2025):
This should be fixed in https://github.com/go-vikunja/vikunja/pull/1477, please check with the next unstable build (should be ready for deployment in ~30min, also on try).
@fritzbauer commented on GitHub (Sep 12, 2025):
Unfortunately, it did not help. I just confirmed it on try.vikunja.io and my private instance. Both on Version: v1.0.0-rc2.
Original replication steps still work and network trace also shows that the initial position parameter for new tasks is 0.
@vikunja-bot-app[bot] commented on GitHub (Dec 16, 2025):
This issue has been fixed in #1996, please check with the next unstable build (should be ready for deployment in ~30min, also on the demo).
@fritzbauer commented on GitHub (Dec 17, 2025):
Unfortunately, it did not help. I just confirmed it on try.vikunja.io with Version: v1.0.0-rc3-108-8adf0ef0
Original replication steps still work and network trace also shows that the initial position parameter for new tasks is 0.
@kolaente commented on GitHub (Jan 11, 2026):
I've tried to reproduce this again with the steps originally posted here, but it seems to work - are you still able to reproduce it consistently? Please share your steps.
@fritzbauer commented on GitHub (Jan 11, 2026):
Thank you very much that you continue to follow-up on issues which are hard to trace to its cause!
Good news: I just tried to replicate on try.vikunja.io again and it did not occur anymore.
(Seems the deployment was delayed when I tested it after your comment last month. As mentioned try.vikunja was on v1.0.0-rc3-108-8adf0ef0 and it seems this version did not contain your fixes from December 16th yet: https://github.com/go-vikunja/vikunja/commits/8adf0ef0 )
I am fine to close this issue.
Just to be fair wanted to provide some background info:
@kolaente commented on GitHub (Jan 11, 2026):
Glad this is solved! I'll close the issue then.
For recurring task patterns, you might be interested in this PR: https://github.com/go-vikunja/vikunja/pull/2032
It will still take a while until that gets merged, but it might solve your need for a scheduled job.
@vikunja-bot-app[bot] commented on GitHub (Jan 11, 2026):
This issue has been fixed in #1996, please check with the next unstable build (should be ready for deployment in ~30min, also on the demo).