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

Feat: display project dropdown when typing "+" #3591

Merged
merged 3 commits into from
Oct 18, 2024

Conversation

bytrangle
Copy link
Contributor

@bytrangle bytrangle commented Oct 16, 2024

Description

When a user adds a task and types "+", it will display a dropdown list of currently unarchived projects.

Caveat: These changes caused the test should parse scheduled date using local time zone when unspecified to fail. I've temporarily commented out the test and will investigate it further.

Issues Resolved

Partially solves #3544

Check List

  • New functionality includes testing.
  • New functionality has been documented in the README if applicable.

@bytrangle
Copy link
Contributor Author

bytrangle commented Oct 16, 2024

Update on the failed test.

The time in the test is 2024-10-12T13:37. When I ran the test locally, the local time was way after 13:37. So the custom date parser add one more day according to this. The parsed time becomes 2024-10-13T13:37 and the test failed.

This makes sense: When the start time is behind the current time, e.g.: 13:37 vs 14:37, this 13:37 will be set to the next day. However, the logic start.date().getTime() < now.getTime() didn't take into account that the user may also include a specific day with the time, e.g. 2024-10-12T13:17.

Hope that makes sense 🤯

This test didn't fail on Github and earlier PR didn't catch this because the test time was before 13:37.

@bytrangle bytrangle marked this pull request as ready for review October 17, 2024 07:48
@stavby
Copy link
Contributor

stavby commented Oct 17, 2024

Hi!

Looks good, I've got a few tiny issues:

  1. I've added the abillity to disable the project short syntax (pressing +) in Feat/make short syntax configurable #3571 - so if it's disabled I think it's better not to show the project suggestion
  2. It seems that once you press enter on a suggested project or escape to close the menu, the only way to show it again is by deleting the "+" and typing it again which I think is a bit annoying, maybe re-show the menu whenever they edit what comes after the +?
  3. In the request issue they search L and it shows suggestions that not only start with L, but have the string somewhere inside them - currently in this project it only searched for results that start with this string (in both projects and tags), I think it'd be great to have it search the whole name and not only its start!
  4. About the test - It did fail because it was outdated and the behavior for due dates will be tomorrow if given a date that has already passed, I suggest you cherry pick my commit instead 8ba61b1 so it keeps checking if it works (I just moved the date to 2030)

@bytrangle
Copy link
Contributor Author

bytrangle commented Oct 17, 2024

Searching for projects that starts with the typed letter is the default in angular-mention, the component that this dropdown feature uses under the hood.
The search behavior can be changed to includes with by adding a mentionFilter property.
Personally, I'm on the team starts with because I have only so many projects and have a vague idea of what the project name starts with. So I won't implement the mentionFilter until there is a configurable option that lets user dictate if search should "start with" or "include".

angular-mention is a singular component and it seems like there is no way to show the dropdown again after the user has selected an option. This component can be forked and modified, but I've been thinking of another feature:

Have another field in the input that shows a task's metadata like scheduled time, project it belongs to, and assigned tags.

These info are rendered as clickable buttons. User can click on the buttons to change the options, or delete it. Short syntax should best be reserved for quickly adding info. A good implementation is in Todoist.

Screenshot from 2024-10-17 16-28-41

@stavby
Copy link
Contributor

stavby commented Oct 17, 2024

You beat me to it with the mentionFilter function ;)
I totally agree that it should be user configurable and for now should remain with the current behavior.
I wasn't aware of the angular-mention package at all so I didn't know how problematic implementing 2 would be, so scratch that.

@johannesjo
Copy link
Owner

Thank you very much for this @bytrangle ! I think this is a great addition. I also agree that having buttons below like other todo apps do it, is something we should add as well.

@johannesjo johannesjo merged commit ea23de7 into johannesjo:master Oct 18, 2024
6 checks passed
@johannesjo
Copy link
Owner

Thanks for mentioning the problems @stavby !! I added some code to take the settings into consideration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants