Skip to content

Commit fd91e54

Browse files
chore(docs): update code docs
1 parent e72e033 commit fd91e54

3 files changed

Lines changed: 8 additions & 17 deletions

File tree

docs/components_ItemDetails.bs.html

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import "pkg:/source/utils/streamSelection.bs"
1313

1414
' Gap between bottom of itemInfoRows and top of extras pane when extras are open
15-
const ITEM_DETAILS_EXTRAS_PADDING = 48
15+
const ITEM_DETAILS_EXTRAS_PADDING = 24
1616
' Minimum display height for the logo image — images too small are scaled up (aspect ratio preserved).
1717
const LOGO_MIN_DISPLAY_HEIGHT = 212 ' Note: LOGO_MAX_DISPLAY_WIDTH takes precedence for very wide/flat logos; this minimum may not be reached.
1818
' Maximum display width for the logo image — prevents very wide/flat logos from overlapping buttons
@@ -59,7 +59,6 @@
5959
m.itemDetailsSlider = m.top.findNode("itemDetailsSlider")
6060
m.itemDetailsSliderInterp = m.top.findNode("itemDetailsSliderInterp")
6161
m.extrasActive = false
62-
m.animationTargetCalculated = false
6362
m.extrasLoaded = false
6463

6564
' Inner group: title + infoGroup + directorGenreGroup (never changes during activate/deactivate)
@@ -1285,7 +1284,6 @@
12851284
end function
12861285

12871286
sub itemContentChanged()
1288-
m.animationTargetCalculated = false
12891287
m.seasonSeriesData = invalid
12901288
item = m.top.itemContent
12911289

@@ -1842,19 +1840,15 @@
18421840
sub onItemDetailsRendered()
18431841
if m.itemDetails.renderTracking = "none" then return
18441842
updateTextGradient()
1845-
' Only calculate animation target once per content load — itemInfoRows height is stable after metadata is set.
1846-
if not m.animationTargetCalculated
1847-
m.animationTargetCalculated = true
1848-
updateItemDetailsAnimationTarget()
1849-
end if
18501843
end sub
18511844

18521845
' updateItemDetailsAnimationTarget: Slide itemDetails so the bottom of itemInfoRows sits just
18531846
' above the extras pane. boundingRect() on a child returns LOCAL coords relative to the parent's
18541847
' translation point, so we use translation[1] (not boundingRect().y) as the screen origin.
1848+
' Called just-in-time from the DOWN key handler to guarantee the layout is fully settled
1849+
' (text wrapping complete) before measuring. Eager calculation via renderTracking races
1850+
' with async text layout, producing stale targets — especially for long descriptions.
18551851
sub updateItemDetailsAnimationTarget()
1856-
if m.extrasActive then return
1857-
18581852
currentTransY = m.itemDetails.translation[1]
18591853
itemInfoRowsLocalRect = m.itemInfoRows.boundingRect()
18601854
screenBottomOfInfoRows = currentTransY + itemInfoRowsLocalRect.y + itemInfoRowsLocalRect.height
@@ -2458,9 +2452,6 @@
24582452

24592453
populateInfoGroupSeason(m.top.itemContent, m.global.user.settings)
24602454

2461-
' Row heights changed — reset so onItemDetailsRendered() recalculates the extras animation target
2462-
m.animationTargetCalculated = false
2463-
24642455
' Update logo using series data if the season didn't carry parentLogoItemId
24652456
if isValid(m.itemLogo) and not m.itemLogo.visible
24662457
setItemLogo(m.seasonSeriesData)
@@ -2515,8 +2506,6 @@
25152506
m.itemDescription.text = content[0]
25162507
m.itemDescription.visible = true
25172508
setDescriptionInLayout(true)
2518-
' Row heights changed — reset so onItemDetailsRendered() recalculates the extras animation target
2519-
m.animationTargetCalculated = false
25202509
end sub
25212510

25222511
' onFirstEpisodeLoaded: Start playback of first episode for Series Play button
@@ -2581,6 +2570,8 @@
25812570
m.top.lastFocus = m.extrasGrid
25822571
m.extrasGrid.setFocus(true)
25832572

2573+
' Calculate animation target with the fully-settled layout before activating extras
2574+
updateItemDetailsAnimationTarget()
25842575
activateExtras()
25852576

25862577
' Hide description and tracks before sliding up so they don't show during the transition

docs/data/search.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/module-ItemDetails.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)