Repository: CodeEditApp/CodeEdit
File: CodeEdit/TabBar/TabBarItem.swift (Swift)

Code before:
    // is possible to make a customized Button (which may solve the clicking conflict,
    // but I am not sure). I will try that in the future.
    var body: some View {
        Button(action: switchAction) {
            content
        }
        .buttonStyle(TabBarItemButtonStyle())
        .keyboardShortcut(
            workspace.getTabKeyEquivalent(item: item),
            modifiers: [.command]
        )
        .background {
            if prefs.preferences.general.tabBarStyle == .xcode {
                Color(nsColor: isActive ? .selectedControlColor : .clear)
                    .opacity(colorScheme == .dark ? 0.70 : 0.50)
                    .background(
                        // This layer of background is to hide dividers of other tab bar items
                        // because the original background above is translucent (by opacity).
                        Color(nsColor: .controlBackgroundColor)
                    )
                    .animation(.easeInOut(duration: 0.08), value: isHovering)
            } else {
                EffectView(
                    material: NSVisualEffectView.Material.titlebar,
                    blendingMode: NSVisualEffectView.BlendingMode.withinWindow
                )
                .background(
                    // This background is used to avoid color-split between title bar and tab bar.
                    // The material will tint the color hind, which will result in a color-split.
                    Color(nsColor: .controlBackgroundColor)
                )
                .overlay {
                    if !isActive {
                        ZStack {
                            Color(nsColor: .black)
                                .opacity(colorScheme == .dark ? 0.50 : 0.05)
                                .padding(.top, 1)
                                .padding(.horizontal, 1)
                            Color(nsColor: colorScheme == .dark ? .white : .black)
                                .opacity(isHovering ? 0.05 : 0.0)
                                .animation(.easeInOut(duration: 0.10), value: isHovering)
                                .padding(.top, 1)
                                .padding(.horizontal, 1)
                        }
                    }
                }
            }
        }
        .padding(
            // This padding is to avoid background color overlapping with top divider.
            .top, prefs.preferences.general.tabBarStyle == .xcode ? 1 : 0

Review comment (bug):
Please pull the latest `main` since this has changed to:

```swift
EffectView(
    NSVisualEffectView.Material.titlebar,
    blendingMode: NSVisualEffectView.BlendingMode.withinWindow
)
```

and that is the reason the automated tests failed.

Code after:
    // is possible to make a customized Button (which may solve the clicking conflict,
    // but I am not sure). I will try that in the future.
    var body: some View {
        Button(action: switchAction) {
            content
        }
        .buttonStyle(TabBarItemButtonStyle())
        .keyboardShortcut(
            workspace.getTabKeyEquivalent(item: item),
            modifiers: [.command]
        )
        .background {
            if prefs.preferences.general.tabBarStyle == .xcode {
                Color(nsColor: isActive ? .selectedControlColor : .clear)
                    .opacity(colorScheme == .dark ? 0.70 : 0.50)
                    .background(
                        // This layer of background is to hide dividers of other tab bar items
                        // because the original background above is translucent (by opacity).
                        Color(nsColor: .controlBackgroundColor)
                    )
                    .animation(.easeInOut(duration: 0.08), value: isHovering)
            } else {
                EffectView(
                    NSVisualEffectView.Material.titlebar,
                    blendingMode: NSVisualEffectView.BlendingMode.withinWindow
                )
                .background(
                    // This background is used to avoid color-split between title bar and tab bar.
                    // The material will tint the color hind, which will result in a color-split.
                    Color(nsColor: .controlBackgroundColor)
                )
                .overlay {
                    if !isActive {
                        ZStack {
                            Color(nsColor: .black)
                                .opacity(colorScheme == .dark ? 0.50 : 0.05)
                                .padding(.top, 1)
                                .padding(.horizontal, 1)
                            Color(nsColor: colorScheme == .dark ? .white : .black)
                                .opacity(isHovering ? 0.05 : 0.0)
                                .animation(.easeInOut(duration: 0.10), value: isHovering)
                                .padding(.top, 1)
                                .padding(.horizontal, 1)
                        }
                    }
                }
            }
        }
        .padding(
            // This padding is to avoid background color overlapping with top divider.
            .top, prefs.preferences.general.tabBarStyle == .xcode ? 1 : 0