"pop" sound is played every time a "done" task is updated in any way #2030

Closed
opened 2023-03-23 16:22:10 +00:00 by WofWca · 6 comments
Contributor

Description

I.e. change its description, rearrange it in the bucket or the list.

The responsible code:
befa6f27bb/src/stores/tasks.ts (L123-L125)

I have tried to do this:

const originalTask = tasks.value[task.id]
if (task.done && (!originalTask || originalTask.done === false)) {
	playPop()
}

but this doesn't solve it e.g. for rearranging it in the buckets since tasks is empty.

Vikunja Frontend Version

02971f6f

Vikunja API Version

v0.20.4+28-6aadaaaffc

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

Yes

Screenshots

No response

### Description I.e. change its description, rearrange it in the bucket or the list. The responsible code: https://kolaente.dev/vikunja/frontend/src/commit/befa6f27bb607a57eb8ed49d0152b85cdab4cb95/src/stores/tasks.ts#L123-L125 I have tried to do this: ```typescript const originalTask = tasks.value[task.id] if (task.done && (!originalTask || originalTask.done === false)) { playPop() } ``` but this doesn't solve it e.g. for rearranging it in the buckets since `tasks` is empty. ### Vikunja Frontend Version 02971f6f ### Vikunja API Version v0.20.4+28-6aadaaaffc ### Browser and version _No response_ ### Can you reproduce the bug on the Vikunja demo site? Yes ### Screenshots _No response_
WofWca added the
kind/bug
label 2023-03-23 16:22:10 +00:00
Member

but this doesn't solve it e.g. for rearranging it in the buckets since tasks is empty.

Yeah that's a bit weird right now. The tasks should only be at one place in the frontend. You can prevent that

I don't have a good idea how to solve this right now either without touching a lot (which I would like to prevent if it's only for this simple feature).

> but this doesn't solve it e.g. for rearranging it in the buckets since tasks is empty. Yeah that's a bit weird right now. The tasks should only be at one place in the frontend. You can prevent that I don't have a good idea how to solve this right now either without touching a lot (which I would like to prevent if it's only for this simple feature).
Owner

So I guess we'd have to move the check for the pop sound to the various places where the task is being marked as done? (with a new function and then calling that from there) Because there we have access to the old state.

From the top of my head, this is the case in these places:

So I guess we'd have to move the check for the pop sound to the various places where the task is being marked as done? (with a new function and then calling that from there) Because there we have access to the old state. From the top of my head, this is the case in these places: * [Task detail view](https://kolaente.dev/vikunja/frontend/src/branch/main/src/views/tasks/TaskDetailView.vue#L755) * [Task in list view](https://kolaente.dev/vikunja/frontend/src/branch/main/src/components/tasks/partials/singleTaskInProject.vue#L235) * [Kanban card](https://kolaente.dev/vikunja/frontend/src/branch/main/src/components/tasks/partials/kanban-card.vue#L108)
Author
Contributor

move the check for the pop sound to the various places where the task is being marked as done

It used to be the case: ce0f58c783

Perhaps passing the old value of done (or oldTask, or playPop) to the update function could work.

> move the check for the pop sound to the various places where the task is being marked as done It used to be the case: ce0f58c7833bbb37974709112cdedad88ae07cc8 Perhaps passing the old value of `done` (or `oldTask`, or `playPop`) to the `update` function could work.
Member

If you are fine with it I would like not to fix this right now. Moving it back or passing the old task is adding complexity and creates new dependencies that makes it harder to unify the task management.

I know it's annoying but users can help themselves by disabling thw sound via the setting - yes it will be resetted on logout.

If you are fine with it I would like not to fix this right now. Moving it back or passing the old task is adding complexity and creates new dependencies that makes it harder to unify the task management. I know it's annoying but users can help themselves by disabling thw sound via the setting - yes it will be resetted on logout.
Author
Contributor

is adding complexity

Idk, making the said parameter optional sounds benign to me.

> is adding complexity Idk, making the said parameter optional sounds benign to me.
Owner

We might need to go the extra route and remove the call to playPop from the store becuase Safari does not allow playing audio without user interaction. We might even need to move the whole content of the function to the function attached to the "click" or other event on the task done button.

Related issue in Sentry: https://vikunja.sentry.io/share/issue/e2ff7231c7a1491fbd7cb8ff479becaf/

For now, I've added a try catch block to ignore the error (929d4f4023)

We might need to go the extra route and remove the call to playPop from the store becuase Safari does not allow playing audio without user interaction. We might even need to move the whole content of the function to the function attached to the "click" or other event on the task done button. Related issue in Sentry: https://vikunja.sentry.io/share/issue/e2ff7231c7a1491fbd7cb8ff479becaf/ For now, I've added a try catch block to ignore the error (https://kolaente.dev/vikunja/frontend/commit/929d4f402342de309dd8e453252d22fcb9f362a6)
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#2030
No description provided.