ViennaRSS / vienna-rss

Vienna is a free and open-source RSS/Atom newsreader for macOS.
https://www.vienna-rss.com
Apache License 2.0
1.85k stars 227 forks source link

Fix various issues around article list / content views #1782

Closed barijaona closed 3 months ago

barijaona commented 4 months ago

Fix issues #1722 and #1618

Eitot commented 3 months ago

I have found two auto layout issues:

  1. With the enclosure bar enabled: a. open an article that has an enclosure b. change the width of the article view c. switch to an article that has no enclosure

There will be a blank area where the enclosure bar was.

  1. With the enclosure bar enabled: a. open an article that has no enclosure b. change the width of the article view c. switch to an article that has an enclosure

There will be a constraint conflict and the enclosure bar won't show.

Unable to simultaneously satisfy constraints:
(
    "<NSLayoutConstraint:0x600002d03610 V:[NSStackView:0x12c744490]-(6)-|   (active, names: '|':EnclosureView:0x10d039660 )>",
    "<NSLayoutConstraint:0x600002d03660 V:|-(7)-[NSStackView:0x12c744490]   (active, names: '|':EnclosureView:0x10d039660 )>",
    "<NSLayoutConstraint:0x600002e7b8e0 'NSStackView.Stack.Min' V:[NSView:0x12c704240]-(>=0)-[EnclosureView:0x10d039660]   (active)>",
    "<NSLayoutConstraint:0x600002e7bb10 'NSStackView.Edge.Bottom' V:[EnclosureView:0x10d039660]-(>=0)-|   (active, names: '|':NSStackView:0x10d0248c0 )>",
    "<NSAutoresizingMaskLayoutConstraint:0x600002d10960 h=-&- v=-&- NSView:0x12c704240.minY == 0   (active, names: '|':NSStackView:0x10d0248c0 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x600002d03610 V:[NSStackView:0x12c744490]-(6)-|   (active, names: '|':EnclosureView:0x10d039660 )>
barijaona commented 3 months ago

I have found two auto layout issues:

I think it's fixed now.

Eitot commented 3 months ago

Thanks. I tried figuring this out, but wasn't able to fix it. I am still wondering why WKWebView forces its containing views to change their size.

barijaona commented 3 months ago

I tried figuring this out, but wasn't able to fix it.

It also took me some time to completely understand when and how one needs to take care of these translatesAutoresizingMaskIntoConstraints stuff…

I am still wondering why WKWebView forces its containing views to change their size.

I can only guess that this might be linked to the WKWebView being inside a NSStackView, which introduces some flexibility. We did not encounter the problem on other tabs.