Ariver
2026-06-18 1fcf6730652d509e78de4b80888772083f5b124a
C1.source/Sources/Aligner/QuickSwitchRootView.swift
@@ -300,10 +300,10 @@
        static let normalGap: CGFloat = 16
        static let minGap: CGFloat = 8
        static let maxRows = 2
        static let indexFontSize: CGFloat = 15
        static let compressedIndexFontSize: CGFloat = 13
        static let indexWidth: CGFloat = 16
        static let indexHeight: CGFloat = 18
        static let indexFontSize: CGFloat = 16
        static let compressedIndexFontSize: CGFloat = 14
        static let indexWidth: CGFloat = 18
        static let indexHeight: CGFloat = 24
    }
    private enum RootLayoutMetrics {
@@ -3525,11 +3525,11 @@
    }
    private var appShelfIndexColor: NSColor {
        NSColor.labelColor.withAlphaComponent(0.34)
        NSColor.labelColor.withAlphaComponent(0.48)
    }
    private var appShelfIndexHighlightedColor: NSColor {
        NSColor.labelColor.withAlphaComponent(0.42)
        NSColor.labelColor.withAlphaComponent(0.58)
    }
    private func appShelfIndexFont(size: CGFloat) -> NSFont {
@@ -3569,13 +3569,13 @@
        layer.font = appShelfIndexFont(size: fontSize)
        layer.fontSize = fontSize
        layer.foregroundColor = (highlighted ? appShelfIndexHighlightedColor : appShelfIndexColor).cgColor
        layer.opacity = iconSize <= AppShelfMetrics.minIconSize + 1 ? 0.72 : 0.82
        layer.opacity = 1
        let indexWidth = AppShelfMetrics.indexWidth
        let indexHeight = AppShelfMetrics.indexHeight
        let preferredX = iconFrame.minX - indexWidth - 1
        let clampedX = max(-6, min(itemBounds.width - indexWidth, preferredX))
        let preferredY = iconFrame.maxY - indexHeight + 4
        let preferredX = iconFrame.minX - indexWidth - 2
        let clampedX = max(-7, min(itemBounds.width - indexWidth, preferredX))
        let preferredY = iconFrame.maxY - indexHeight + 6
        let clampedY = max(0, min(itemBounds.height - indexHeight, preferredY))
        layer.frame = CGRect(
            x: clampedX,
@@ -3785,6 +3785,10 @@
        return item.item.windowCount > 1 ? "\(item.item.windowCount)" : ""
    }
    private var waterfallAppHoverHeaderFillColor: NSColor {
        NSColor.systemGray.withAlphaComponent(0.22)
    }
    private var appShelfMaxScrollOffset: CGFloat {
        max(0, appShelfContentWidth - shelfLayer.bounds.width)
    }
@@ -3870,6 +3874,7 @@
            column.countLayer.isHidden = true
            for card in column.cards {
                card.containerLayer.transform = CATransform3DIdentity
                if let frame = layout.cardFramesByWindowID[card.item.window.id] {
                    card.containerLayer.frame = frame
                } else {
@@ -4017,7 +4022,7 @@
            height: WaterfallMetrics.headerHeight
        )
        column.headerLayer.backgroundColor = (isHovered
            ? viewModeToggleBlueColor
            ? waterfallAppHoverHeaderFillColor
            : (isSpaceFocused
                ? NSColor.systemFill.withAlphaComponent(0.10)
                : NSColor.controlBackgroundColor.withAlphaComponent(0.52))
@@ -4028,14 +4033,14 @@
            width: max(1, bounds.width - WaterfallMetrics.columnHeaderTextInset * 2),
            height: 16
        )
        column.appNameLayer.foregroundColor = (isHovered ? NSColor.white : NSColor.labelColor).cgColor
        column.appNameLayer.foregroundColor = NSColor.labelColor.cgColor
        column.countLayer.frame = CGRect(
            x: bounds.width - 48,
            y: bounds.height - 24,
            width: 36,
            height: 16
        )
        column.countLayer.foregroundColor = (isHovered ? NSColor.white : NSColor.secondaryLabelColor).cgColor
        column.countLayer.foregroundColor = NSColor.secondaryLabelColor.cgColor
        let appGroupIndex = column.column.appGroupIndex
        let verticalOffset = clampedWaterfallColumnOffset(
@@ -4055,6 +4060,7 @@
            let y = firstCardTop
                - WaterfallMetrics.cardHeight
                - CGFloat(cardIndex) * (WaterfallMetrics.cardHeight + WaterfallMetrics.cardGap)
            card.containerLayer.transform = CATransform3DIdentity
            card.containerLayer.frame = CGRect(
                x: WaterfallMetrics.columnHorizontalPadding,
                y: y,
@@ -4069,8 +4075,7 @@
        let bounds = card.containerLayer.bounds
        let isSelected = card.item.window.id == effectiveSelection?.windowID
        let isHovered = card.item.window.id == hoveredWindowID
        let isAppLinked = isHorizontalMasonryMode
            && card.item.appGroupIndex == appIconHoverLinkedAppGroupIndex
        let isAppLinked = isWaterfallCardAppLinked(card)
        applyWaterfallCardVisualState(
            card,
            selected: shouldShowSelectedVisual(isSelected: isSelected, isHovered: isHovered),
@@ -4723,6 +4728,26 @@
        return card.item.primarySpaceID == activeSpaceFocusID
    }
    private func isWaterfallCardAppLinked(_ card: WaterfallCardLayers) -> Bool {
        guard card.item.appGroupIndex == appIconHoverLinkedAppGroupIndex else { return false }
        if isHorizontalMasonryMode {
            return true
        }
        return waterfallColumns
            .first(where: { $0.column.appGroupIndex == card.item.appGroupIndex })?
            .cards
            .sorted { lhs, rhs in
                if lhs.item.windowIndex != rhs.item.windowIndex {
                    return lhs.item.windowIndex < rhs.item.windowIndex
                }
                return lhs.item.window.id < rhs.item.window.id
            }
            .first?
            .item.window.id == card.item.window.id
    }
    private func waterfallColumnWidth() -> CGFloat {
        guard waterfallColumns.count > 0 else { return WaterfallMetrics.columnWidth }
@@ -5181,6 +5206,7 @@
                "indexFrame": dictionary(from: item.indexLayer.frame),
                "indexVisible": !item.indexLayer.isHidden && item.indexLayer.opacity > 0,
                "indexFontSize": Double(item.indexLayer.fontSize),
                "indexOpacity": Double(item.indexLayer.opacity),
                "indexColor": colorDictionary(from: item.indexLayer.foregroundColor),
                "labelFrame": dictionary(from: item.labelLayer.frame),
                "labelTruncationMode": "middle",
@@ -5457,8 +5483,7 @@
        var states: [String] = []
        let isSelected = card.item.window.id == effectiveSelection?.windowID
        let isHovered = card.item.window.id == hoveredWindowID
        let isAppLinked = isHorizontalMasonryMode
            && card.item.appGroupIndex == appIconHoverLinkedAppGroupIndex
        let isAppLinked = isWaterfallCardAppLinked(card)
        if shouldShowSelectedVisual(isSelected: isSelected, isHovered: isHovered) {
            states.append("selected")
        } else if isSelected {