-
Notifications
You must be signed in to change notification settings - Fork 108
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
Paparazzi + Showkase Integration - java.io.FileNotFoundException (File name too long) #340
Comments
Ran into this as well, leaving some notes on how this can be improved:
public val MyPreviewNameGroup: List<ShowkaseBrowserComponent> =
PreviewStyle()
.values
.iterator()
.asSequence()
.mapIndexed(::spacingPreviewSpacingExtrasSDKSpacingValues)
.toList()
private fun myPreviewNameGroup(index: Int, previewParam: Param): ShowkaseBrowserComponent {
return ShowkaseBrowserComponent(
group = "Group"
componentName = "Name",
componentKDoc = "",
componentKey = ...,
isDefaultStyle = false,
component = @Composable { MyPreview(param = previewParam) }
)
} |
@evant The reason all this info is added is because you can you repeated annotations and a single function can actually end up being multiple previews depending on how you are using the preview annotations. I do think that I need to figure out an alternate way to solve this though as hitting this issue could be common if you are using longer and more descriptive names. For example, here's a file that Paparazzi generated in the sample project --
I wonder if I can somehow get rid of the earlier portion of the name that's added by Paparazzi by default i.e |
Could you generate multiple properties in the same file or generate a single property that's a list of the components? |
Actually, just realized that this issue is about the generated paparazzi name. This name is purely generated from the test name so the fix would be separate, happy to open a new issue for generated showkase class names if that makes more sense. |
I'm getting this as well with just Showkase (although actually we plan to use Paparazzi soon as well). Is there a possible workaround? We have a lot of previews and need descriptive names. |
This reduces the length of the filename because a disambiguated property name can be quite long. Looking at the files gerenated in the sample app, before this change the longest is 161 chars, after it's 102. Partially addresses airbnb#340
I am using
showkase-screenshot-testing-paparazzi
from #294 to auto-generate snapshots for Composable Previews. For certain previews that have long names, I am running into this issue from Paparazzi cashapp/paparazzi#734. Since the test name and png file name is being generated on Showkase, not sure if there is something I can do on my end.I am able to get around it by renaming the Preview to something shorter, but would be great to have a fix for this in Showkase itself.
The text was updated successfully, but these errors were encountered: