Skip to content

Commit 285e75e

Browse files
authored
feat: Update Urgency for Lowest to make linear (#1984)
* vault: Add new priorities to tasks-plugin-complete-example.css * feat: Update Urgency score for Lowest priority to make very nearly linear * vault: Add new priorities to 'Sample Tasks for Styling Documentation.md' * docs: Add new priorities to Styling example
1 parent 6590e1d commit 285e75e

File tree

7 files changed

+16
-4
lines changed

7 files changed

+16
-4
lines changed

docs/Advanced/Styling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ For example:
196196

197197
### Priority as a Checkbox Color
198198

199-
The following rules remove the Tasks priority emoticon and render the tasks' checkboxes in red, orange, blue and cyan according to the tasks' priority:
199+
The following rules remove the Tasks priority emoticon and render the tasks' checkboxes in purple, red, orange, blue, cyan and green according to the tasks' priority:
200200

201201
<!-- snippet: resources/sample_vaults/Tasks-Demo/.obsidian/snippets/tasks-plugin-priority-as-checkbox-color.css -->
202202
```css

docs/Advanced/Urgency.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ The scores are as follows:
8080
</tr>
8181
<tr>
8282
<td>Lowest</td>
83-
<td><code>-0.6</code></td>
83+
<td><code>-1.8</code></td>
8484
</tr>
8585
<tr>
8686
<td rowspan="3">Scheduled</td>
35.2 KB
Loading

resources/sample_vaults/Tasks-Demo/.obsidian/snippets/tasks-plugin-complete-example.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ span.tasks-list-text {
2424
}
2525

2626
/* Represent tasks' priority with colorful round checkboxes instead of the priority emoticons */
27+
.task-list-item[data-task-priority="highest"] input[type=checkbox] {
28+
box-shadow: 0px 0px 2px 2px var(--color-purple);
29+
border-color: var(--color-purple);
30+
}
31+
2732
.task-list-item[data-task-priority="high"] input[type=checkbox] {
2833
box-shadow: 0px 0px 2px 2px var(--color-red);
2934
border-color: var(--color-red);
@@ -44,6 +49,11 @@ span.tasks-list-text {
4449
border-color: var(--color-cyan);
4550
}
4651

52+
.task-list-item[data-task-priority="lowest"] input[type=checkbox] {
53+
box-shadow: 0px 0px 2px 2px var(--color-green);
54+
border-color: var(--color-green);
55+
}
56+
4757
/* This part removes the regular priority emoticon */
4858
span.task-priority {
4959
display: none;

resources/sample_vaults/Tasks-Demo/Styling/Sample Tasks for Styling Documentation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ group by heading
1313

1414
## Priority
1515

16+
- [ ] #task Lowest priority example task ⏬
1617
- [ ] #task Low priority example task 🔽
1718
- [ ] #task Normal priority example task
1819
- [ ] #task Medium priority example task 🔼
1920
- [ ] #task High priority example task ⏫
21+
- [ ] #task Highest priority example task 🔺
2022

2123
## Custom Statuses
2224

src/Urgency.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class Urgency {
6060
// no modification for "Low" priority
6161
// Lowest
6262
case '5':
63-
urgency -= 0.1 * Urgency.priorityCoefficient;
63+
urgency -= 0.3 * Urgency.priorityCoefficient;
6464
break;
6565
}
6666

tests/Query/Urgency.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe('urgency - priority component', () => {
5252
testUrgency(builder.priority(Priority.Medium), 3.9);
5353
testUrgency(builder.priority(Priority.None), 1.95);
5454
testUrgency(builder.priority(Priority.Low), 0.0);
55-
testUrgency(builder.priority(Priority.Lowest), -0.6);
55+
testUrgency(builder.priority(Priority.Lowest), -1.8);
5656
});
5757
});
5858

0 commit comments

Comments
 (0)