Repository: CodeEditApp/CodeEdit
File: CodeEdit/Features/Editor/JumpBar/Views/EditorJumpBarView.swift (Swift)

Code before:
            }
        }
        .frame(height: Self.height, alignment: .center)
        .opacity(activeState == .inactive ? 0.8 : 1.0)
        .grayscale(isActiveEditor ? 0.0 : 1.0)
    }

    private func resize() {
        let minWidth: CGFloat = 20
        let snapThreshold: CGFloat = 30
        let maxWidth: CGFloat = textWidth / CGFloat(fileItems.count)
        let exponent: CGFloat = 5.0
        var betweenWidth: CGFloat = 0.0

        if textWidth >= containerWidth {
            let scale = max(0, min(1, containerWidth / textWidth))
            betweenWidth = floor((minWidth + (maxWidth - minWidth) * pow(scale, exponent)))
            if betweenWidth < snapThreshold {
                betweenWidth = minWidth
            }
            crumbWidth = betweenWidth
        } else {
            crumbWidth = nil
        }

        if betweenWidth > snapThreshold {
            firstCrumbWidth = nil
        } else {
            let otherCrumbs = CGFloat(max(fileItems.count - 1, 1))
            let usedWidth = otherCrumbs * snapThreshold

            // Multiplier to reserve extra space for other crumbs in the jump bar.
            // Increasing this value causes the first crumb to truncate sooner.
            let crumbSpacingMultiplier: CGFloat = 1.5
            let availableForFirst = containerWidth - usedWidth * crumbSpacingMultiplier
            if availableForFirst < snapThreshold {
                firstCrumbWidth = minWidth
            } else {
                firstCrumbWidth = availableForFirst
            }
        }
    }
}


Review comment (suggestion):
```suggestion
        if betweenWidth > snapThreshold || crumbWidth == nil {
```

I noticed that the first crumb _always_ has the overlay gradient, except when other crumbs are being truncated and the first item hasn't begun truncating yet. This fixes that, but please let me know if I'm misunderstanding the variable use here.

Before:

https://github.com/user-attachments/assets/e04fddf5-b24f-4333-a2d8-268015ec5949


With this change:

https://github.com/user-attachments/assets/8d52bb21-5e87-4761-afd5-a62c521fc227

Code after:
                EditorTabBarTrailingAccessories(codeFile: $codeFile)
            }
        }
        .frame(height: Self.height, alignment: .center)
        .opacity(activeState == .inactive ? 0.8 : 1.0)
        .grayscale(isActiveEditor ? 0.0 : 1.0)
    }

    private func resize() {
        let minWidth: CGFloat = 20
        let snapThreshold: CGFloat = 30
        let maxWidth: CGFloat = textWidth / CGFloat(fileItems.count)
        let exponent: CGFloat = 5.0
        var betweenWidth: CGFloat = 0.0

        if textWidth >= containerWidth {
            let scale = max(0, min(1, containerWidth / textWidth))
            betweenWidth = floor((minWidth + (maxWidth - minWidth) * pow(scale, exponent)))
            if betweenWidth < snapThreshold {
                betweenWidth = minWidth
            }
            crumbWidth = betweenWidth
        } else {
            crumbWidth = nil
        }

        if betweenWidth > snapThreshold || crumbWidth == nil {
            firstCrumbWidth = nil
        } else {
            let otherCrumbs = CGFloat(max(fileItems.count - 1, 1))
            let usedWidth = otherCrumbs * snapThreshold

            // Multiplier to reserve extra space for other crumbs in the jump bar.
            // Increasing this value causes the first crumb to truncate sooner.
            let crumbSpacingMultiplier: CGFloat = 1.5
            let availableForFirst = containerWidth - usedWidth * crumbSpacingMultiplier
            if availableForFirst < snapThreshold {
                firstCrumbWidth = minWidth
            } else {
                firstCrumbWidth = availableForFirst
            }
        }
    }
}