Skip to content

Comments

Add draw hierarchy setting interface#151

Merged
BarredEwe merged 6 commits intoBarredEwe:mainfrom
stotic-dev:add_draw_Hierarchy_setting_interface
Jan 31, 2026
Merged

Add draw hierarchy setting interface#151
BarredEwe merged 6 commits intoBarredEwe:mainfrom
stotic-dev:add_draw_Hierarchy_setting_interface

Conversation

@stotic-dev
Copy link
Contributor

@stotic-dev stotic-dev commented Dec 20, 2025

Short description 📝

Describe here the purpose of your PR.

To get a snapshot of a Liquid Glass component, you need to modify the template and set drawHierarchyInKeyWindow to true as mentioned in #136. However, this is a bit of a hassle, so we've made it possible to set drawHierarchyInKeyWindow to true as an optional setting in prefire.yaml.

Solution 📦

Describe the solution you came up with and the reasons that led you to that solution. If you thought about other solutions don't forget about mentioning them.

The use case we wanted to solve was making it easy to obtain Liquid Glass components. Because Liquid Glass affects the entire app, we determined that there was no setting to switch drawHierarchyInKeyWindow for each Preview. Therefore, our current solution makes it possible to specify a common setting for drawHierarchyInKeyWindow for all Previews.

If there are some use cases where you want to set drawHierarchyInKeyWindow to false, we believe that a separate solution would be to make it possible to specify drawHierarchyInKeyWindow with the snapshot modifier.

Implementation 👩‍💻👨‍💻

Detail in a checklist the steps that you took to implement the PR.

  • Modify the test_configuration in Example/.prefire.yml as follows:
    • Set required_os to 26
    • Add draw_hierarchy_in_key_window_default_enabled: true
  • Add the following Preview under Example/Shared/Examples
#Preview("LiquidGlass") {
    NavigationStack {
        Text("Liquid Glass View")
            .toolbar {
                ToolbarItem(placement: .topBarTrailing) {
                    Button {} label: {
                        Image(systemName: "plus")
                    }
                }
            }
    }
}
  • Run the PrefireExampleTests test and confirm that the LiquidGlass snapshot has the LiquidGlass effect as shown below.
image
  • Modify the test_configuration in Example/.prefire.yml as follows:
    • remove draw_hierarchy_in_key_window_default_enabled: true
  • Run the PrefireExampleTests tests to verify that your LiquidGlass snapshot has no LiquidGlass effects.

@BarredEwe
Copy link
Owner

Thanks a lot for the improvements!

@stotic-dev stotic-dev requested a review from BarredEwe January 31, 2026 05:23
@BarredEwe BarredEwe merged commit 78834e8 into BarredEwe:main Jan 31, 2026
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants