Commit 7ac0be90 authored by Kourser's avatar Kourser
Browse files

fix(macos): firm width for the episodes strip — the stretch collapsed to zero

On-device logs finally told the story: episodes load (16/3/1…), the
scrubber exists and reloads, yet only the back button shows. Next to a
sibling item the low-priority stretch loses the layout arbitration and
the scrubber renders at zero width (alone in the idle bar it wins,
which is why the artwork strip works). The episodes strip now gets a
firm 600 pt width at priority 999, and a frame diagnostic logs the
resolved geometry half a second after each load.

Co-Authored-By: Claude (RCA)
parent 374de360
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -164,6 +164,11 @@ final class TouchBarController: NSObject {
                      self.episodes.count, podcast.title,
                      self.episodeScrubber == nil ? "absent" : "présent")
                self.episodeScrubber?.reloadData()
                DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { [weak self] in
                    guard let scrubber = self?.episodeScrubber else { return }
                    NSLog("[TouchBar] episodes frame: %@ (items affichés : %d)",
                          NSStringFromRect(scrubber.frame), scrubber.numberOfItems)
                }
            }
        }
        applyLevel()
@@ -329,9 +334,11 @@ extension TouchBarController: NSTouchBarDelegate {
            scrubber.mode = .free
            scrubber.selectionOverlayStyle = .outlineOverlay
            scrubber.showsAdditionalContentIndicators = true
            let stretch = scrubber.widthAnchor.constraint(equalToConstant: 1200)
            stretch.priority = .defaultLow
            stretch.isActive = true
            // Firm width: the low-priority stretch loses the layout
            // arbitration next to the back button and collapses to zero.
            let width = scrubber.widthAnchor.constraint(equalToConstant: 600)
            width.priority = NSLayoutConstraint.Priority(999)
            width.isActive = true
            item.view = scrubber
            scrubber.dataSource = self
            scrubber.delegate = self