-
Notifications
You must be signed in to change notification settings - Fork 2
feat(client): Add file type icons #8
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
Just a few ideas to see if we can refactor the file types a bit more, but I man not sure if this will work and/or produce more organized code. No need to spend a lot of time on it.
I have taken the liberty to update your PR on main for the CI failures.
src/labicons.ts
Outdated
| export const getIcon = (iconName: string, isLight: boolean) => { | ||
| let icon: LabIcon | undefined; | ||
| switch (iconName) { | ||
| case "parquet": | ||
| icon = getLabIcon(iconName, isLight ? parquetSvgLight : parquetSvgDark); | ||
| break; | ||
| case "arrowipc": | ||
| icon = getLabIcon(iconName, isLight ? arrowIPCSvg : arrowIPCDarkSvg); | ||
| break; | ||
| case "orc": | ||
| icon = getLabIcon(iconName, isLight ? orcLightSvg : orcDarkSvg); | ||
| break; | ||
| case "avro": | ||
| icon = getLabIcon(iconName, isLight ? avroSvg : avroSvg); | ||
| break; | ||
| } | ||
| return icon; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this could be handled with global constants since we are aware in the code of which one to use. For instance, we already know we need a parquet icon when calling this function for the Parquet file type.
const PARQUET_ICON = getLabIcon("parquet", parquetSvgLight);
const PARQUET_DARK_ICON = getLabIcon("parquet", parquetSvgDark);
...Or maybe as many functions as file types
export const getParquetIcon = (isLight: boolean) => {
...
}
...This is so we avoid confusion between all the strings we have for the file types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @AntoinePrv I tried to use the approach of constants but it did not work. I created videos where I showed the issue with it. Instead of this, to fix it, I created functions for each file type.
Screencast from 2025-12-15 16-33-17.webm
Screencast from 2025-12-15 16-29-47.webm
Thank you for your attention :)
e3ccf70 to
401297f
Compare
AntoinePrv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great!
|
Integration tests are taking a while and not testing much yet. Going forward with merge. |
This PR has the solution of #7
The result:
Screencast from 2025-12-15 17-20-24.webm