Skip to content

[extensions/get-favicon] new feature: specify icon size#17472

Merged
raycastbot merged 12 commits intoraycast:mainfrom
ViGeng:getfavicon/size
Mar 3, 2025
Merged

[extensions/get-favicon] new feature: specify icon size#17472
raycastbot merged 12 commits intoraycast:mainfrom
ViGeng:getfavicon/size

Conversation

@ViGeng
Copy link
Contributor

@ViGeng ViGeng commented Mar 1, 2025

Description

  • Added support for specifying icon size, you can set the size of the icon in the settings.
  • Minor refactoring: extracted common interfaces and preferences to separate files.
image

@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: get-favicon Issues related to the get-favicon extension labels Mar 1, 2025
@raycastbot
Copy link
Collaborator

raycastbot commented Mar 1, 2025

Thank you for your contribution! 🎉

🔔 @vimtor @robotdestroy @LeonChenWenJia you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

Due to our current reduced availability, the initial review may take up to 10-15 business days

@ViGeng ViGeng changed the title Add size feature and perform npm audit [extensions/get-favicon] new feature: specify icon size Mar 1, 2025
@ViGeng ViGeng marked this pull request as ready for review March 1, 2025 16:04
@pernielsentikaer pernielsentikaer self-assigned this Mar 1, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Added support for specifying favicon icon size in settings, with minor refactoring to extract common interfaces and preferences to a separate file.

  • Added new default_icon_size preference in package.json with dropdown options from 16x16 to 256x256
  • Created new common.tsx file to centralize interfaces for Arguments and Preferences
  • Implemented size parameter in getFavicon calls in copy.ts and copy-url.ts, but missing in download.ts
  • Left debugging console.log statements in all three command files that should be removed
  • Updated README.md with configuration options, but contains a typo "commond" in the roadmap section

7 file(s) reviewed, 6 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +1 to +8
export interface Arguments {
url: string;
}

export interface Preferences {
default_icon_size: number;
downloadDirectory: string;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, Preference can be removed.
I don't understand the second one. How should I use the argument? Thanks.

ViGeng and others added 4 commits March 1, 2025 18:10
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.

You're right, it uses an very old version of @raycast/api

Can you try to update with npx @raycast/migration@latest . and fix if any errors occurs?

That should give you raycast-env.d.ts which has the type for Preference and Arguments

@pernielsentikaer
Copy link
Collaborator

Do you need help fixing the errors?

@ViGeng
Copy link
Contributor Author

ViGeng commented Mar 3, 2025

You're right, it uses an very old version of @raycast/api

Can you try to update with npx @raycast/migration@latest . and fix if any errors occurs?

That should give you raycast-env.d.ts which has the type for Preference and Arguments
At very beginning I was trying to use the type from the generated Arguments types in "raycast-env.d.ts".
But it's reporting it can not find the type. That's why I ask how I can use the arguments.

Finally I found the generated "raycast-env.d.ts" is not included in the tsconfig.json.
It's a bit confusing for a frontend layman 😅 But thanks to ChatGPT.

image

@ViGeng
Copy link
Contributor Author

ViGeng commented Mar 3, 2025

Do you need help fixing the errors?

Hi, @pernielsentikaer , I need some help regarding the dependencies. For example, run npm run fix-lint. I have no idea what is going on there. thx!

@pernielsentikaer
Copy link
Collaborator

Now we're back with errors, do you want to handle them @ViGeng

@ViGeng ViGeng requested a review from pernielsentikaer March 3, 2025 11:22
@ViGeng
Copy link
Contributor Author

ViGeng commented Mar 3, 2025

Now we're back with errors, do you want to handle them @ViGeng

Hi, I think it is working now. I skipped the 'any' type checking by applying a rule.
let me know if you think it needs further modifications.

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 🔥

@raycastbot raycastbot merged commit 718d9a9 into raycast:main Mar 3, 2025
2 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2025

Published to the Raycast Store:
https://raycast.com/vimtor/get-favicon

@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: get-favicon Issues related to the get-favicon extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants