Skip to content

Improve Things Extension - #418

Merged
mattisssa merged 22 commits into
raycast:mainfrom
loris:things-2
Dec 3, 2021
Merged

mattisssa merged 22 commits into
raycast:mainfrom
loris:things-2

Conversation

@loris

@loris loris commented Nov 23, 2021 •

Copy link
Copy Markdown
Contributor

Description

  • Add complete/cancel/delete actions
  • Add "Add New To-Do" command and fallback action
  • Add "Search in Things" fallback action
  • Fix i18n issue ([Extension Bug] Things extension doesn't work when Things is not in English #299)
  • Add todos count in section subtitle
  • Replace built-in list filtering with better one
  • Display tags in List subtitle (instead of notes)
  • Add project and area in actions
  • Search in project and area tags

Type of change

  • Bug fix / improvement for my extension

Screencast

image

image

Checklist

@mattisssa mattisssa added the extension fix / improvement Label for PRs with extension's fix improvements label Nov 24, 2021
@mattisssa
mattisssa removed the request for review from pernielsentikaer November 24, 2021 18:51
@loris

loris commented Nov 28, 2021

Copy link
Copy Markdown
Contributor Author

@mattisssa @pernielsentikaer Hi guys, the PR is now ready for review! Thanks

@pernielsentikaer pernielsentikaer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @loris 👋

Thanks for the update, it's going to add so much value!

Tested it and only found a single comment, maybe I'm just wrong 😄

  • I'm not sure that I can see the todo count in section subtitle, maybe I'm not doing it the right way? Does it require more than one list

W4ZJ1IzfMCAUCSsO

Request a new review when you are ready, feel free to contact me here or at Slack if you have any questions.

@loris

loris commented Nov 29, 2021

Copy link
Copy Markdown
Contributor Author

Hi @pernielsentikaer Thanks a lot for the review!
Interesting feedback, Right now the count is displayed on the List.Section items which are displayed when grouping to-dos by their parent projects. So orphan to-dos (like on your screenshot) are at the top level of the List component and thus no count is displayed.
I missed it because I tends to classify all my todos in projects.
One idea could be to add them in a "No project" section or something like this, what do you think?
image

Or maybe add a global count in the navigation title?
image

@pernielsentikaer

Copy link
Copy Markdown
Contributor

Hi @loris 👋

I'm actually not sure what would be the best output, it doesn't add much value to add “No Project” since a lot also uses it without a project — Guess it's better to keep as is — thanks for the clarification 🙏

Comments:

  • When a new item is added, it changes the view to the list. However, most of the time I would personally go to another action, and then I have to hit escape twice to go “out”
  • When hitting one escape (to go back) the form is not “cleared”

If anything above is unclear, feel free to catch me in Slack 😄

@loris

loris commented Nov 30, 2021

Copy link
Copy Markdown
Contributor Author

@pernielsentikaer as discussed on Slack, I ensured the form values are cleared on form submission and added a secondary form action to allow the user to go to the todo list:

image

@pernielsentikaer pernielsentikaer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @loris 👋

Thanks for the correction, it seems like its a lot better - first time I ran the "Add New To-Do" command it gave me this error:

2021-12-02 09:37:00.783 F  Raycast[85192:182593] [com.raycast.extensions.things:add-new-todo] The above error occurred in the <AddNewTodo> component:

    at null.AddNewTodo (/Users/pernielsentikaer/Desktop/rc2/extensions/things/src/add-new-todo.tsx:68:18)
    at ray-navigation-stack
    at nm (/Applications/Raycast.app/Contents/Resources/RaycastCommands_RaycastCommands.bundle/Contents/Resources/api/node_modules/@raycast/api/index.js:24:10558)
    at al (/Applications/Raycast.app/Contents/Resources/RaycastCommands_RaycastCommands.bundle/Contents/Resources/api/node_modules/@raycast/api/index.js:24:10663)
    at Is (/Applications/Raycast.app/Contents/Resources/RaycastCommands_RaycastCommands.bundle/Contents/Resources/api/node_modules/@raycast/api/index.js:24:9779)
    at QO (/Applications/Raycast.app/Contents/Resources/RaycastCommands_RaycastCommands.bundle/Contents/Resources/api/node_modules/@raycast/api/index.js:24:8740)
    at ray-root
    at Ef (/Applications/Raycast.app/Contents/Resources/RaycastCommands_RaycastCommands.bundle/Contents/Resources/api/node_modules/@raycast/api/index.js:24:10083)

React will try to recreate this component tree from scratch using the error boundary you provided, InternalErrorBoundary.
2021-12-02 09:37:00.800 F  Raycast[85192:182593] [com.raycast.extensions.things:add-new-todo]
TypeError: Cannot read properties of undefined (reading 'map')

AddNewTodo:add-new-todo.tsx:68:18

---
65:
66: export default function AddNewTodo(props: { title?: string; listName?: string }) {
67:   const defaultValues: FormValues = {
68:     title: props.title || '',
69:     notes: '',
70:     tags: [],
71:     list: props.listName?.toLowerCase(),
---

    at ray-navigation-stack
nm:index.js:24:10558
al:index.js:24:10663
Is:index.js:24:9779
QO:index.js:24:8740
    at ray-root
Ef:index.js:24:10083

After this crash it seems like it was working as expected - can you look into above? 😄

@loris

loris commented Dec 2, 2021

Copy link
Copy Markdown
Contributor Author

@pernielsentikaer Thanks! it happens if Things is not running, I just pushed a better error hander to replace the stacktrace error with a Markdown Detail View (in addition to the Toast, which is not very visible):

image

@pernielsentikaer

Copy link
Copy Markdown
Contributor

Hi @loris 👋

There is now a flicker for every command showing the right data before showing that Things is not installed, can we look into this? For me it was only a problem when Things was not open when I added - I'm not sure if its the same for you?

Can we do something about this?

@pernielsentikaer pernielsentikaer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi again @loris 🔥

Thanks for the conversation, and as we spoke about we have the “flicker” issue on the list to find a better solution when it's possible for now people have things open anyway.

I have accepted it, and we await final review before merging 🚀

Thanks for your update!

@mattisssa
mattisssa merged commit b33af66 into raycast:main Dec 3, 2021
@raycastbot

Copy link
Copy Markdown
Collaborator

MaheshtheDev added a commit to MaheshtheDev/raycast-extensions that referenced this pull request Sep 25, 2025