Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeating tasks in kanban views should be moved to the default bucket when done #347

Open
Ma27 opened this issue Nov 5, 2024 · 7 comments

Comments

@Ma27
Copy link
Contributor

Ma27 commented Nov 5, 2024

Description

So I have a saved filter that contains a bunch of tasks from different projects and has a relatively typical Kanban layout with an "In progress" & "Done" column (amongst others).

Now when moving a repeating task to "In progress" and doing ctrl-click when it's done, it doesn't make much sense to keep it in the In Progress column, instead I think it should go back into the default bucket.

I started writing a patch that actually does that, however I still fail to tell the frontend that the bucket has changed (I don't really understand how BucketID is set to the correct bucket ID - that one's different depending on which view you're using, right), so perhaps there's a patch ready soonish. Would you be interested in such a patch?

Vikunja Version

0.24.4

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

Please select

Screenshots

No response

@kolaente
Copy link
Member

kolaente commented Nov 7, 2024

Would love a patch.

The update for ctrl-click is done here:

https://github.com/go-vikunja/vikunja/blob/main/frontend/src/components/tasks/partials/KanbanCard.vue#L157-L171

which then triggers this function in the store:

https://github.com/go-vikunja/vikunja/blob/main/frontend/src/stores/kanban.ts#L152-L176

That checks where to move the bucket. The api has the same logic and would need an update accordingly:

https://github.com/go-vikunja/vikunja/blob/main/pkg/models/tasks.go#L993

@Ma27
Copy link
Contributor Author

Ma27 commented Nov 7, 2024

Oh btw speaking of which: does the frontend build work for you currently? I tried to do it in a devenv-shell and it fails like this:

❯ Projects/vikunja/frontend main* → pnpm run build

> [email protected] build /home/ma27/Projects/vikunja/frontend
> vite build && workbox copyLibraries dist/

Building "legacy" build with "@vitejs/plugin-legacy"
plugin-legacy overrode 'build.target'. You should pass 'targets' as an option to this plugin with the list of legacy browsers to support instead.
vite v5.4.10 building for production...
transforming (10) src/router/index.tsnode:events:497
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at afterWriteDispatched (node:internal/stream_base_commons:161:15)
    at writeGeneric (node:internal/stream_base_commons:152:3)
    at Socket._writeGeneric (node:net:954:11)
    at Socket._write (node:net:966:8)
    at writeOrBuffer (node:internal/streams/writable:570:12)
    at _write (node:internal/streams/writable:499:10)
    at Writable.write (node:internal/streams/writable:508:10)
    at AsyncCompiler.writeStdin (/home/ma27/Projects/vikunja/frontend/node_modules/.pnpm/[email protected]/node_modules/sass-embedded/dist/lib/src/compiler/async.js:30:28)
    at PacketTransformer.writeInboundBuffer (/home/ma27/Projects/vikunja/frontend/node_modules/.pnpm/[email protected]/node_modules/sass-embedded/dist/lib/src/compiler/async.js:112:18)
    at PacketTransformer.writeInboundProtobuf (/home/ma27/Projects/vikunja/frontend/node_modules/.pnpm/[email protected]/node_modules/sass-embedded/dist/lib/src/packet-transformer.js:66:18)
Emitted 'error' event on Socket instance at:
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}

Node.js v20.17.0
 ELIFECYCLE  Command failed with exit code 1.

Can also reproduce this issue when updating the pkgs.vikunja derivation from nixpkgs to latest master. I guess I'll try to undo the sass-embedded change temporarily.

@kolaente
Copy link
Member

kolaente commented Nov 7, 2024

Nope, I have the same issue. Works in CI, maybe this is a problem with devenv. Dev watcher seem to work fine though (with pnpm dev).

@Ma27
Copy link
Contributor Author

Ma27 commented Nov 9, 2024

It's not devenv-related, but a problem you'll always have with Nix:

[ma27@snens:~/Projects/vikunja/frontend]$ /home/ma27/Projects/vikunja/frontend/node_modules/.pnpm/[email protected]/node_modules/sass-embedded-linux-x64/dart-sass/src/dart
Could not start dynamically linked executable: /home/ma27/Projects/vikunja/frontend/node_modules/.pnpm/[email protected]/node_modules/sass-embedded-linux-x64/dart-sass/src/dart
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld

strace ftw, the error message didn't really help.

@kolaente
Copy link
Member

Huh I thought this was statically linked

Ma27 added a commit to Ma27/vikunja that referenced this issue Nov 10, 2024
Closes go-vikunja#347

The idea behind this is a kanban layout like this:

    | Backlog | In Progress | Done |

A recurring task is also moved into `In Progress`, however when it's
closed, it should be moved back into the default column (Backlog).

This patch effectively implements that by changing the bucket ID in the
saved view event hook for recurring tasks that were closed in the update
action. The frontend counterpart gets a condition to detect this case
and move the card to the right column in the UI.

This patch is a POC to see if this goes into the right direction, most
notably there's one part of the feature missing: I mostly care about
the Ctrl-Click case, the "move to 'Done'" case doesn't work. I'm happy
to implement that if the rest of the patch is fine for upstream.
@Ma27
Copy link
Contributor Author

Ma27 commented Nov 10, 2024

Btw I fixed it like this in the Nix expression for vikunja, feel free to copy when the next release comes and the package in nixpkgs requires an update:

diff --git a/pkgs/by-name/vi/vikunja/package.nix b/pkgs/by-name/vi/vikunja/package.nix
index 150b1abc8fb9..152238b62a16 100644
--- a/pkgs/by-name/vi/vikunja/package.nix
+++ b/pkgs/by-name/vi/vikunja/package.nix
@@ -28,6 +28,7 @@ let
     doCheck = true;
 
     postBuild = ''
+      find node_modules/.pnpm/sass-embedded-linux-*/node_modules/sass-embedded-linux-*/dart-sass/src -name dart -print0 | xargs -I {} -0 patchelf --set-interpreter "$(<$NIX_CC/nix-support/dynamic-linker)" {}
       pnpm run build
     '';
 

@Ma27
Copy link
Contributor Author

Ma27 commented Nov 13, 2024

First iteration available as PR in gitea: https://kolaente.dev/vikunja/vikunja/pulls/2841
Still needs some polishing, but I'd like to get some feedback first.

Ma27 added a commit to Ma27/vikunja that referenced this issue Nov 22, 2024
Closes go-vikunja#347

The idea behind this is a kanban layout like this:

    | Backlog | In Progress | Done |

A recurring task is also moved into `In Progress`, however when it's
closed, it should be moved back into the default column (Backlog).

This patch effectively implements that by changing the bucket ID in the
saved view event hook for recurring tasks that were closed in the update
action. The frontend counterpart gets a condition to detect this case
and move the card to the right column in the UI.

This patch is a POC to see if this goes into the right direction, most
notably there's one part of the feature missing: I mostly care about
the Ctrl-Click case, the "move to 'Done'" case doesn't work. I'm happy
to implement that if the rest of the patch is fine for upstream.
Ma27 added a commit to Ma27/vikunja that referenced this issue Nov 22, 2024
Closes go-vikunja#347

The idea behind this is a kanban layout like this:

    | Backlog | In Progress | Done |

A recurring task is also moved into `In Progress`, however when it's
closed, it should be moved back into the default column (Backlog).

This patch effectively implements that by changing the bucket ID in the
saved view event hook for recurring tasks that were closed in the update
action. The frontend counterpart gets a condition to detect this case
and move the card to the right column in the UI.

This patch is a POC to see if this goes into the right direction, most
notably there's one part of the feature missing: I mostly care about
the Ctrl-Click case, the "move to 'Done'" case doesn't work. I'm happy
to implement that if the rest of the patch is fine for upstream.
iworklee pushed a commit to iworklee/vikunja that referenced this issue Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants