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

Tag coefficient not applied when multiple tags exist on a task #3726

Open
davidolrik opened this issue Dec 17, 2024 · 0 comments
Open

Tag coefficient not applied when multiple tags exist on a task #3726

davidolrik opened this issue Dec 17, 2024 · 0 comments
Labels
type:bug Something isn't working

Comments

@davidolrik
Copy link

Given the following configuration:

data.location=.
hooks.location=./hooks

urgency.uda.tags.foo.coefficient=10
urgency.uda.tags.bar.coefficient=5

We can show that the tag coefficient is not applied when more than one tag exists on a task.

To see the problem in action create a taskrc file with the above config in an empty directory and run the following commands:

# Create task with one tag and now additional urgency
$ task rc:taskrc add Test +baz
TASKRC override: taskrc
Created task 1.

# Show list of tasks where urgency is as expected
$ task rc:taskrc
TASKRC override: taskrc

ID Age   Tag Description Urg
 1 14s   baz Test         0.8

1 task

# Add tag bar, expecting the urgency to go up
$ task rc:taskrc 1 modify +bar
Modifying task 1 'Test'.
Modified 1 task.
TASKRC override: taskrc
$ task rc:taskrc
TASKRC override: taskrc

ID Age  Tag     Description Urg
 1 2min bar baz Test         0.9

1 task

# Show task 1 (With non-important part stripped out) - urgency did not go up
$ task rc:taskrc 1
TASKRC override: taskrc

Name          Value
ID            1
Urgency       0.9
[tag_bar      x]
[tag_baz      x]

    tags    0.9 *    1 =    0.9
                         ------
                            0.9

# Remove tag baz, so only one tag with a coefficient is present
$ task rc:taskrc 1 modify -baz
Modifying task 1 'Test'.
Modified 1 task.
TASKRC override: taskrc

# Show task 1 (With non-important part stripped out)  - urgency is as expected
$ task rc:taskrc 1
TASKRC override: taskrc

Name          Value
ID            1
Urgency       5.8
[tag_bar      x]

    tags            0.8 *    1 =    0.8
    UDA tags.bar      1 *    5 =      5
                                 ------
                                    5.8

# Add second tag with coefficient - expecting urgency to be 15+
$ task rc:taskrc 1 modify +foo
Modifying task 1 'Test'.
Modified 1 task.
TASKRC override: taskrc

# Show task 1 (With non-important part stripped out) - urgency is incorrect
$ task rc:taskrc 1
TASKRC override: taskrc

Name          Value
ID            1
Description   Test
Status        Pending
Entered       2024-12-17 13:54:58 (7min)
Last modified 2024-12-17 14:01:53 (21s)
Tags          bar foo
Virtual tags  LATEST PENDING READY TAGGED UNBLOCKED
UUID          6cac55d8-89da-440d-b8e7-1aa676963fe5
Urgency       0.9
[tag_bar      x]
[tag_foo      x]

    tags    0.9 *    1 =    0.9
                         ------
                            0.9

Output of task diag

$ task rc:taskrc diag
TASKRC override: taskrc

task 3.1.0
   Platform: Darwin

Compiler
    Version: Apple LLVM 16.0.0 (clang-1600.0.26.3)
       Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64
 Compliance: C++17

Build Features
      CMake: 3.30.3
    libuuid: libuuid + uuid_unparse_lower
 Build type: Release

Configuration
       File: taskrc (found), 149 bytes, mode 100644
       Data: . (found), dir, mode 40755
         GC: Enabled
    $EDITOR: hx
Hooks
     System: Enabled
   Location: ./hooks
             (-none-)

Tests
   Terminal: 252x75
 Broken ref: Scanned 2 tasks for broken references:
             No broken references found

As a sidenote: My terminal is 170x61 and not 252x75 as seen in the diag output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

2 participants