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

Gallery - the previews from #Preview is not sorted #217

Open
bill-florio opened this issue Jan 8, 2025 · 6 comments
Open

Gallery - the previews from #Preview is not sorted #217

bill-florio opened this issue Jan 8, 2025 · 6 comments

Comments

@bill-florio
Copy link

The screens form #Preview is not sorted and the custom name is not spliced

Simulator Screenshot - iPhone 16 - 2025-01-08 at 16 48 15

@noahsmartin
Copy link
Member

Hi @bill-florio thanks for reporting! Could you share more details like a code sample of what you are trying to do and what you would expect to see? Thanks!

@bill-florio
Copy link
Author

for example, here is same previews' creation:

#Preview {
    UpdateView()
}

#Preview {
    LinkButton(text: "Click me", action: {
    })
}

the project is mixed with PreviewProvider and #Preview, maybe the source of issue.

@fruitcoder
Copy link

Does it work if you specify a Display Name in the #Preview definition?

@bill-florio
Copy link
Author

@fruitcoder no it does not. e.g. the first row here, the code is :

#Preview("HomeView Preview - German Locale")
Screenshot 2025-01-13 at 15 28 37

@noahsmartin
Copy link
Member

For #Preview the name in this row is the file name, ie HomeView.swift - we just remove the .swift. IIRC the expected behavior is for multiple previews in the same file to group into one row, then when you tap on the row to see the display name for each. Will take a look and see if this is still working

@bill-florio
Copy link
Author

I suggest adding a search bar to find out the item quickly. My app has > 200 previews, and it is not easy to find the one I want to check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants