Sign In Sign Up

Update tab bar constraints in Tahoe view

We need to update @macos/Sources/Features/Terminal/Window Styles/TerminalTabsTitlebarTahoe.swift tab bar constraints to align the right edge of the tab bar with the left edge of the update accessory view so it remains visible.

The user wants to update constraints in a specific macOS Swift file to align the tab bar's right edge with the left edge of the update accessory view. Let me first read this file to understand the current implementation.

I'll help you update the tab bar constraints. Let me first read the file to see the current implementation.

macos/Sources/Features/Terminal/Window*/**/*.swift 5 files found

Now I need to find if there's an update accessory view. Let me search for it.

update.*accessory 9 matches

Now I understand the issue. The tab bar constraints currently go to container.rightAnchor (line 146), but they need to align with the updateAccessory view's left edge. Let me update the constraints:

@@ -139,12 +139,19 @@
        // usually that clips the children) to the container view.
        clipView.translatesAutoresizingMaskIntoConstraints = false
        accessoryView.translatesAutoresizingMaskIntoConstraints = false

        // Find the update accessory view to align the tab bar with it
        var rightAnchor = container.rightAnchor
        if let updateAccessoryVC = titlebarAccessoryViewControllers.first(where: { $0 != titlebarAccessoryViewControllers.first(where: { isTabBar($0) }) && $0.layoutAttribute == .right }),
           let updateView = updateAccessoryVC.view {
            rightAnchor = updateView.leftAnchor
        }

        // Setup all our constraints
        NSLayoutConstraint.activate([
            clipView.leftAnchor.constraint(equalTo: container.leftAnchor, constant: leftPadding),
            clipView.rightAnchor.constraint(equalTo: container.rightAnchor),
            clipView.rightAnchor.constraint(equalTo: rightAnchor),
            clipView.topAnchor.constraint(equalTo: container.topAnchor, constant: 2),
            clipView.heightAnchor.constraint(equalTo: container.heightAnchor),
            accessoryView.leftAnchor.constraint(equalTo: clipView.leftAnchor),
            accessoryView.rightAnchor.constraint(equalTo: clipView.rightAnchor),

Updated the tab bar constraints to align with the update accessory view. The code now finds any non-tab-bar accessory view with .right layout attribute and constrains the tab bar's right edge to its left edge.

Run `zig build` to verify.