Skip to content

Commit

Permalink
fix: Enable 'High priority' to be selected easily in Auto Suggest
Browse files Browse the repository at this point in the history
Fixes #1943

The order of priorities in auto suggestion is now

- high
- medium
- low
- highest
- lowest

This retains the original order, for people's muscle memory. And it means that the
longer names are after the shorter ones, which also makes it possible to type both,
and it means that typing parts of names selects the same result as before
highest and lowest were added.
  • Loading branch information
claremacrae committed May 30, 2023
1 parent 47b565c commit 5aea3c2
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/Getting Started/Auto-Suggest.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ Similarly, you can type some fraction of the word `start` (of whatever length is
| Searchable Text | Text that is added |
| ----------------------------- | -------------------------- |
| ⏎ | \<new line> |
| πŸ”Ί highest priority | πŸ”Ί |
| ⏫ high priority | ⏫ |
| πŸ”Ό medium priority | πŸ”Ό |
| πŸ”½ low priority | πŸ”½ |
| πŸ”Ί highest priority | πŸ”Ί |
| ⏬️ lowest priority | ⏬️ |
| πŸ” recurring (repeat) | πŸ” |
| every | πŸ” every |
Expand Down
8 changes: 4 additions & 4 deletions src/Suggestor/Suggestor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ function addTaskPropertySuggestions(
appendText: `${symbols.scheduledDateSymbol} `,
});
if (!hasPriority(line)) {
genericSuggestions.push({
displayText: `${symbols.prioritySymbols.Highest} highest priority`,
appendText: `${symbols.prioritySymbols.Highest} `,
});
genericSuggestions.push({
displayText: `${symbols.prioritySymbols.High} high priority`,
appendText: `${symbols.prioritySymbols.High} `,
Expand All @@ -99,6 +95,10 @@ function addTaskPropertySuggestions(
displayText: `${symbols.prioritySymbols.Low} low priority`,
appendText: `${symbols.prioritySymbols.Low} `,
});
genericSuggestions.push({
displayText: `${symbols.prioritySymbols.Highest} highest priority`,
appendText: `${symbols.prioritySymbols.Highest} `,
});
genericSuggestions.push({
displayText: `${symbols.prioritySymbols.Lowest} lowest priority`,
appendText: `${symbols.prioritySymbols.Lowest} `,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
| due:: due date | due:: |
| start:: start date | start:: |
| scheduled:: scheduled date | scheduled:: |
| priority:: highest highest priority | priority:: highest |
| priority:: high high priority | priority:: high |
| priority:: medium medium priority | priority:: medium |
| priority:: low low priority | priority:: low |
| priority:: highest highest priority | priority:: highest |
| priority:: lowest lowest priority | priority:: lowest |
| repeat:: recurring (repeat) | repeat:: |
| created:: created today (2022-07-11) | created:: 2022-07-11 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
| πŸ“… due date | πŸ“… |
| πŸ›« start date | πŸ›« |
| ⏳ scheduled date | ⏳ |
| πŸ”Ί highest priority | πŸ”Ί |
| ⏫ high priority | ⏫ |
| πŸ”Ό medium priority | πŸ”Ό |
| πŸ”½ low priority | πŸ”½ |
| πŸ”Ί highest priority | πŸ”Ί |
| ⏬ lowest priority | ⏬ |
| πŸ” recurring (repeat) | πŸ” |
| βž• created today (2022-07-11) | βž• 2022-07-11 |
Expand Down
2 changes: 1 addition & 1 deletion tests/Suggestor/Suggestor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ describe.each([
{ displayText: `${dueDateSymbol} due date`, appendText: `${dueDateSymbol} ` },
{ displayText: `${startDateSymbol} start date`, appendText: `${startDateSymbol} ` },
{ displayText: `${scheduledDateSymbol} scheduled date`, appendText: `${scheduledDateSymbol} ` },
{ displayText: `${prioritySymbols.Highest} highest priority`, appendText: `${prioritySymbols.Highest} ` },
{ displayText: `${prioritySymbols.High} high priority`, appendText: `${prioritySymbols.High} ` },
{ displayText: `${prioritySymbols.Medium} medium priority`, appendText: `${prioritySymbols.Medium} ` },
]);
});

Expand Down

0 comments on commit 5aea3c2

Please sign in to comment.