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

Google Workspace: Add file path information #14888

Merged
merged 7 commits into from
Oct 21, 2024

Conversation

ridemountainpig
Copy link
Contributor

Description

Adds the file path information to the list of accessories.
closes #14874

Screencast

CleanShot 2024-10-11 at 15 40 02@2x

Checklist

@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: google-workspace Issues related to the google-workspace extension labels Oct 12, 2024
@raycastbot
Copy link
Collaborator

raycastbot commented Oct 12, 2024

Thank you for the update! 🎉

You can expect an initial review within five business days.

@thomaslombart thomaslombart changed the title Update google-workspace extension Google Workspace: Add file path information Oct 14, 2024
Copy link
Collaborator

@thomaslombart thomaslombart left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I have some pieces of feedback:

  • Isn't it possible to make that a preference, like Display File Path, and show it in a different accessory instead of in the tooltip?
  • Is there a more performant way to find the path of each file? Right now, there can easily be dozens and dozens of calls fired (especially since it's implemented in a recursive way) to display the file path. Also, it'd be probably better to add all of that inside the useFetch call to make all of the information display at once.

@ridemountainpig
Copy link
Contributor Author

@thomaslombart Thanks for your review. I have added the Display file path option in the preferences. Due to the Google Drive API, we can only retrieve one parent file at a time. Therefore, I need to use a recursive method to obtain the file path. I have switched to using useCachePromise to get the file path.

@thomaslombart
Copy link
Collaborator

Also, it'd be probably better to add all of that inside the useFetch call to make all of the information display at once.

Can you also take a look at that? Maybe you can turn this hook into a useCachedPromise to add the file path information from there since I'm not sure it's possible to do that from useFetch.

@ridemountainpig
Copy link
Contributor Author

Maybe you can turn this hook into a useCachedPromise to add the file path information from there since I'm not sure it's possible to do that from useFetch.

It seems that useFetch can't be used inside useCachedPromise because both are hooks that handle asynchronous data fetching independently. React hooks must be called at the top level, and combining them would violate that rule.

@thomaslombart
Copy link
Collaborator

Yes, that's why I'm asking to turn useFetch inside a useCachedPromise hook 🙂

@ridemountainpig
Copy link
Contributor Author

@thomaslombart, do you mean to change it to this?

@raycastbot raycastbot added the OP is author The OP of the PR is the author of the extension label Oct 21, 2024
@thomaslombart
Copy link
Collaborator

Yes, exactly! I fixed a few things, so this PR is almost ready to merge.

@thomaslombart thomaslombart removed the OP is author The OP of the PR is the author of the extension label Oct 21, 2024
@raycastbot raycastbot merged commit 3307856 into raycast:main Oct 21, 2024
2 checks passed
Copy link
Contributor

Published to the Raycast Store:
https://raycast.com/raycast/google-workspace

@raycastbot
Copy link
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension fix / improvement Label for PRs with extension's fix improvements extension: google-workspace Issues related to the google-workspace extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Search Google Drive Files] When searching for folders show the folder path next to the folder result
3 participants