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

Fix: Validate filenames consisting solely of extensions #1802

Merged
merged 6 commits into from
Jul 11, 2024

Conversation

LeonardoLarranaga
Copy link
Contributor

@LeonardoLarranaga LeonardoLarranaga commented Jul 9, 2024

Description

This pull request resolves an issue where supported files with only extensions (e.g., .env, .gitignore) were not displaying their correct icons.

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

Before:

icons file extensions error

After:

fixed pull request .env.local - .eslintrc.js fix

Leonardo Larrañaga added 4 commits July 8, 2024 20:00
0xWDG
0xWDG previously approved these changes Jul 10, 2024
Copy link
Collaborator

@thecoolwinter thecoolwinter left a comment

Choose a reason for hiding this comment

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

This looks good to me, there is one edge case created by taking the first result. For instance this file should be a yaml file icon. Could you reverse the check? So we first check if there's a valid file extension, then do your check for the prefixed filename. Then if that all fails we do a txt file.

Screenshot 2024-07-10 at 5 50 58 PM

@LeonardoLarranaga
Copy link
Contributor Author

@thecoolwinter Working on it!

Leonardo Larrañaga added 2 commits July 10, 2024 17:38
Copy link
Collaborator

@thecoolwinter thecoolwinter left a comment

Choose a reason for hiding this comment

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

Perfect!

@thecoolwinter thecoolwinter merged commit 8e098b6 into CodeEditApp:main Jul 11, 2024
2 checks passed
@thecoolwinter
Copy link
Collaborator

@allcontributors please add @LeonardoLarranaga for code

Copy link
Contributor

@thecoolwinter

I've put up a pull request to add @LeonardoLarranaga! 🎉

@austincondiff austincondiff added the enhancement New feature or request label Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request navigator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐞 Icons not displayed correctly for files with only extensions
6 participants