DCsunset / taskwarrior-webui

Self-hosted Responsive Web UI for Taskwarrior based on Vue.js and Koa.js
GNU General Public License v3.0
188 stars 24 forks source link

sort on urgency doesnt work on mobile browser #68

Closed gitjax closed 1 year ago

gitjax commented 1 year ago

great app :-)

sort on urgency doesn't work on mobile browser (safari) on iOS.

Constantin1489 commented 1 year ago

It doesn't work on Safari os macOS, too.

I ran the wui by

docker run -d -p 8888:80 --name taskwarrior-webui \
    -v $HOME/.taskrc:/.taskrc -v $HOME/.task:/.task \
    dcsunset/taskwarrior-webui

system info

System Version: macOS 13.2.1 (22D68) Kernel Version: Darwin 22.3.0

Constantin1489 commented 1 year ago

git log -p -S 'sort: (a: number, b: number)'

Output

commit 41fabce38503138dbe4944338b950f2ed6f09b93
Author: Lukas Wölfer <lukas.woelfer@rwth-aachen.de>
Date:   Thu Feb 9 17:46:07 2023 +0100

    Sorting urgent by most urgent first

diff --git a/frontend/components/TaskList.vue b/frontend/components/TaskList.vue
index 0ae6fe8..85b9652 100644
--- a/frontend/components/TaskList.vue
+++ b/frontend/components/TaskList.vue
@@ -289,7 +289,7 @@ export default defineComponent({
                                : [{ text: 'Wait', value: 'wait' }]),
                        { text: 'Until', value: 'until' },
                        { text: 'Tags', value: 'tags' },
-                       { text: 'Urgency', value: 'urgency' },
+                       { text: 'Urgency', value: 'urgency', sort: (a: number, b: number) => !(a > b) },
                        { text: 'Actions', value: 'actions', sortable: false }
                ]);

git log -p -S urge

Output


commit a3a1ca8d6084dc449faf75b7c9aee46014a4e4ff
Author: Ruben De Smet <ruben.de.smet@rubdos.be>
Date:   Wed Mar 3 13:12:32 2021 +0100

    Add Urgency as column to task view.

diff --git a/frontend/components/TaskList.vue b/frontend/components/TaskList.vue
index 9260fdd..e3fe125 100644
--- a/frontend/components/TaskList.vue
+++ b/frontend/components/TaskList.vue
@@ -130,6 +130,10 @@
                                </v-chip>
                        </template>

+                       <template v-slot:item.urgency="{ item }">
+                               {{ item.urgency }}
+                       </template>
+
                        <template v-slot:item.actions="{ item }">
                                <v-icon
                                        v-show="status === 'pending'"
@@ -247,6 +251,7 @@ export default defineComponent({
                                : [{ text: 'Wait', value: 'wait' }]),
                        { text: 'Until', value: 'until' },
                        { text: 'Tags', value: 'tags' },
+                       { text: 'Urgency', value: 'urgency' },
                        { text: 'Actions', value: 'actions', sortable: false }
                ]);

I don't have any knowledge of the language used. But Because the commit a3a1ca8d6084dc449faf75b7c9aee46014a4e4ff worked for almost two years, I believe that the problem is the commit 41fabce38503138dbe4944338b950f2ed6f09b93 which is the first one.

DCsunset commented 1 year ago

Hi, is there any error log in in your browser? It seems that maybe the sort function doesn't work for some reason.

Constantin1489 commented 1 year ago

I don't know about the language but I tried this article Debugging in the browser.

This is the local variable of the part I mention.


a: 4.29315

b: 2.67123

this: Object

urgency: function(a,b)

arguments: TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in this context.

caller: TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in this context.

length: 2

name: "sort"

prototype: sort

constructor: function(a,b)

arguments: TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in this context.

caller: TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in this context.

length: 2

name: "sort"

prototype: sort {}
Constantin1489 commented 1 year ago

Before the fix come out, I made temporarily reverted the commit repo.

https://github.com/Constantin1489/taskwarrior-webui-reverted-41fabce

You can find a temporary docker image there too.

This won't be updated because of respecting the original Github project.

If there is a fix for the 41fabce commit, I would mention it.

The forked repo I made is here which is archived.

Also if there is taskwarrior-webui cache in your browser, then it may not work properly. To fix it, remove the cache in your browser.

DCsunset commented 1 year ago

Hi, it seems to be a compatibility issue with iOS or MacOS browsers. I tried to fix this issue in urg-sort branch. Could you check if it works on your browser?

Constantin1489 commented 1 year ago

Hi @DCsunset. I added the urg-sort branch's code in docker. As a result, the browsers show the code in the source tab in each browser's development window. This is the docker image.

But, The urg-sort function still doesn't work in macOS.

This is Safari's log.

a: 2.68219
b: 4.30411
this: Object
urgency: function(a,b)
arguments: TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in this context.
caller: TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in this context.
length: 2
name: "sort"
    prototype: sort
    constructor: function(a,b)
    arguments: TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in this context.
    caller: TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in this context.
    length: 2
    name: "sort"
    prototype: sort
        constructor: function(a,b)
        arguments: TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in this context.
        caller: TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in this context.
        length: 2
        name: "sort"
        prototype: sort
            <REPEAT>

So you may be right.

Constantin1489 commented 1 year ago

I leave a useful reference here. I hope this helps. ajax error typeerror arguments callee and caller cannot be accessed in this context

if you are in V8-base or firefox, browser, the error will be “‘caller’, ‘callee’, and ‘arguments’ properties may not be accessed on strict mode functions or the arguments objects for calls to them”.

Paraidomat commented 1 year ago

Hi, I'm using chrome on Windows and I'm having the same issue.

DCsunset commented 1 year ago

It seems like a common issue now. But I don't have MacOS or Windows systems, it is still impossible for me to reproduce it or fix it easily. Any help would be appreciated.

Paraidomat commented 1 year ago

I'd be glad to support. I just need some pointers on "how"?

DCsunset commented 1 year ago

Thanks @Paraidomat. I think we need to find some way to get rid of using the anonymous function in sort or use it in a way that works on other systems (probably because of old browsers)

Motoma commented 1 year ago

Chiming in. Sort on urgency isn't working in Chromium or Brave on Ubuntu. I'm using the docker hub latest image.