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

Code before:
                            : Color(nsColor: .black)
                                .opacity(
                                    isPressingClose
                                    ? 0.29
                                    : (isHoveringClose ? 0.11 : 0)
                                )
                        )
                    )
                    .cornerRadius(2)
                    .accessibilityLabel(Text("Close"))
                    .onHover { hover in
                        isHoveringClose = hover
                    }
                    .pressAction {
                        isPressingClose = true
                    } onRelease: {
                        isPressingClose = false
                    }
                    .opacity(isHovering ? 1 : 0)
                    .animation(.easeInOut(duration: 0.08), value: isHovering)
                    .padding(.leading, prefs.preferences.general.tabBarStyle == .xcode ? 3.5 : 4)
                }
                .frame(maxWidth: .infinity, alignment: .leading)
            }
            .opacity(
                activeState != ControlActiveState.inactive
                ? 1.0
                : (isActive ? 0.6 : 0.4)
            )
            .overlay {
                // Only show NativeTabShadow when `tabBarStyle` is native and this tab is not active.
                if prefs.preferences.general.tabBarStyle == .native && !isActive {
                    TabBarTopDivider()
                        .frame(maxHeight: .infinity, alignment: .top)
                }
            }
            TabDivider()
                .opacity(
                    isActive && prefs.preferences.general.tabBarStyle == .xcode ? 0.0 : 1.0
                )
        }
        .foregroundColor(
            isActive
            ? (
                prefs.preferences.general.tabBarStyle == .xcode && colorScheme != .dark
                ? Color(nsColor: .controlAccentColor)
                : .primary
            )
            : (
                prefs.preferences.general.tabBarStyle == .xcode
                ? .primary

Review comment (suggestion):
just use `.inactive` since Swift implicitly gets the Type.

Code after:
            }
        }
    }

    var body: some View {
        Button(
            action: switchAction,
            label: { content }
        )
        .buttonStyle(TabBarItemButtonStyle())
        .background {
            if prefs.preferences.general.tabBarStyle == .xcode {
                Color(nsColor: isActive ? .selectedControlColor : .clear)
                    .opacity(
                        colorScheme == .dark
                        ? (activeState != .inactive ? 0.70 : 0.50)
                        : (activeState != .inactive ? 0.50 : 0.35)
                    )
                    .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 {
                            // Native inactive tab background dim.
                            Color(nsColor: .black)
                                .opacity(colorScheme == .dark ? 0.45 : 0.05)

                            // Native inactive tab hover state.
                            Color(nsColor: colorScheme == .dark ? .white : .black)
                                .opacity(
                                    isHovering
                                    ? (colorScheme == .dark ? 0.08 : 0.05)
                                    : 0.0
                                )
                                .animation(.easeInOut(duration: 0.10), value: isHovering)
                        }
                        .padding(.horizontal, 1)