Skip to content

[Espanso]: Add ability to display match labels to Search Matches command#9101

Merged
pernielsentikaer merged 22 commits intoraycast:mainfrom
nbbaier:ext/espanso
Nov 10, 2023
Merged

[Espanso]: Add ability to display match labels to Search Matches command#9101
pernielsentikaer merged 22 commits intoraycast:mainfrom
nbbaier:ext/espanso

Conversation

@nbbaier
Copy link
Contributor

@nbbaier nbbaier commented Nov 4, 2023

Description

  • Changes the method of getting matches for the Search Matches command, directly checking YAML files instead of using Espanso's shell command
  • Introduces the ability to display labels in search results and therefore resolves [Espanso] Copies "Label" field instead of "Replace" field. #8235 (labels overriding the replace of an Espanso match).
  • Improves the fetching of matches and match files, accounting for potential differences in configs that was not there before

Screencast

Checklist

nbbaier and others added 4 commits July 18, 2023 20:57
- added 'Toggle Espanso' command'
- added 'Add Match' command
- added commands to manifest
- added action to paste snippet to front application
- extracted types, messages from index.tsx
- add utils.ts
- added function to get matches to replace call to espanso match exec -j
- added some types
- added the ability to display label in search
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: espanso Issues related to the espanso extension OP is contributor The OP of the PR is a contributor of the extension labels Nov 4, 2023
@raycastbot
Copy link
Collaborator

raycastbot commented Nov 4, 2023

Thank you for your contribution! 🎉

🔔 @kud you might want to have a look.

@pernielsentikaer
Copy link
Collaborator

@nbbaier thanks for your contribution 🔥 Do you mind adding a CHANGELOG entry 🙂

@kud do you mind checking this 🙂

@pernielsentikaer pernielsentikaer self-assigned this Nov 4, 2023
@nbbaier
Copy link
Contributor Author

nbbaier commented Nov 4, 2023

@nbbaier thanks for your contribution 🔥 Do you mind adding a CHANGELOG entry 🙂

Done!

@kud
Copy link
Contributor

kud commented Nov 4, 2023

Hey, thanks for the PR. Could you please update the title of the PR to make it meaningful? 🙏

Regarding the PR itself, to understand it better, instead of using the shell command, are you checking the espanso YAML files? It seems legitimate to me. However, I didn't notice initially that the previous PR added "Add match," but it's broken. The issue lies in assuming that people use the default folders. For some reason that I haven't explained (maybe a legacy one), I don't use them, but I use ~/Library/Preferences/espanso.

I will change it to use the default ones now.

However, this means that the code is not secure enough. Could you please use something like espanso path to determine the location of the config? It would be safer. (Unless you know a better way to find the config files). Thanks.

@nbbaier nbbaier changed the title Update espanso extension [Espanso]: Add ability to display match labels to Search Matches command Nov 5, 2023
@nbbaier
Copy link
Contributor Author

nbbaier commented Nov 5, 2023

Hey, thanks for the PR. Could you please update the title of the PR to make it meaningful? 🙏

Done!

Regarding the PR itself, to understand it better, instead of using the shell command, are you checking the espanso YAML files? It seems legitimate to me.

Yes, exactly. I intended this both as a method to get the labels from the YAML files and to also allow for future addition of the displaying of variables in the list item detail view (since neither variables, forms, labels, etc are returned by espanso match list -j.

However, I didn't notice initially that the previous PR added "Add match," but it's broken. The issue lies in assuming that people use the default folders. For some reason that I haven't explained (maybe a legacy one), I don't use them, but I use ~/Library/Preferences/espanso. However, this means that the code is not secure enough. Could you please use something like espanso path to determine the location of the config? It would be safer. (Unless you know a better way to find the config files). Thanks.

Will do! I forgot about espanso path and this will be a nice way to do it.

@nbbaier
Copy link
Contributor Author

nbbaier commented Nov 5, 2023

@kud, those fixes have been made

@kud
Copy link
Contributor

kud commented Nov 9, 2023

Thanks. It's really neat now!

@nbbaier
Copy link
Contributor Author

nbbaier commented Nov 9, 2023

Thanks. It's really neat now!

Thanks for your suggestions! Still getting the hang of writing neat code haha

@kud
Copy link
Contributor

kud commented Nov 9, 2023

Hehe congrats!

@pernielsentikaer
Copy link
Collaborator

Thanks for handling @kud, and thanks @nbbaier for the enhancement

Copy link
Collaborator

@pernielsentikaer pernielsentikaer left a comment

Choose a reason for hiding this comment

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

Hi 👋

Looks good to me, approved 🔥

@pernielsentikaer pernielsentikaer merged commit 534ff84 into raycast:main Nov 10, 2023
@raycastbot
Copy link
Collaborator

Published to the Raycast Store:
https://raycast.com/kud/espanso

@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: espanso Issues related to the espanso extension extension fix / improvement Label for PRs with extension's fix improvements OP is contributor The OP of the PR is a contributor of the extension status: awaiting response from dev

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Espanso] Copies "Label" field instead of "Replace" field.

4 participants