Skip to content

Conversation

@AnastasiaSliusar
Copy link
Contributor

@AnastasiaSliusar AnastasiaSliusar commented Dec 11, 2025

This PR has the solution of #7

The result:
Screencast from 2025-12-15 17-20-24.webm

Screenshot from 2025-12-15 17-22-51 Screenshot from 2025-12-15 17-22-43

@AntoinePrv AntoinePrv changed the title feat: add file type icons feat: Add file type icons Dec 11, 2025
@AntoinePrv AntoinePrv linked an issue Dec 11, 2025 that may be closed by this pull request
@AnastasiaSliusar AnastasiaSliusar marked this pull request as ready for review December 12, 2025 15:25
Copy link
Member

@AntoinePrv AntoinePrv left a 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
Comment on lines 17 to 34
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;
Copy link
Member

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.

Copy link
Contributor Author

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 :)

Copy link
Member

@AntoinePrv AntoinePrv left a 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!

@AntoinePrv AntoinePrv changed the title feat: Add file type icons feat(client): Add file type icons Dec 15, 2025
@AntoinePrv
Copy link
Member

Integration tests are taking a while and not testing much yet. Going forward with merge.

@AntoinePrv AntoinePrv merged commit ba5e83a into QuantStack:main Dec 15, 2025
8 checks passed
@AntoinePrv AntoinePrv added the feature Add a new functionality to the project label Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Add a new functionality to the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add file type Icons

2 participants