diff --git a/CHANGELOG.md b/CHANGELOG.md index 33a6d2c0..9549bd13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +- Nothing worth mentioning yet. + ## [0.46.0] - 2026-06-12 ### Added diff --git a/playlet-lib/src/components/VideoPlayerDev/ButtonRow/ButtonRow.spec.bs b/playlet-lib/src/components/VideoPlayerDev/ButtonRow/ButtonRow.spec.bs index f2e589dd..1fe591a4 100644 --- a/playlet-lib/src/components/VideoPlayerDev/ButtonRow/ButtonRow.spec.bs +++ b/playlet-lib/src/components/VideoPlayerDev/ButtonRow/ButtonRow.spec.bs @@ -69,6 +69,19 @@ namespace Tests m.assertEqual(anim.control, "start") end function + @it("a nudge with an out-of-range focusedIndex is a safe no-op") + function _() + m.top.rowFocused = true + m.top.focusedIndex = 5 + playAnim = m.top.findNode("PlayPauseButton").findNode("nudgeAnim") + minimizeAnim = m.top.findNode("MinimizeButton").findNode("nudgeAnim") + playAnim.control = "stop" + minimizeAnim.control = "stop" + m.top.nudge = true + m.assertEqual(playAnim.control, "stop") + m.assertEqual(minimizeAnim.control, "stop") + end function + @describe("play/pause icon tracks the play state") @it("shows the pause icon while playing, the play icon while paused") diff --git a/playlet-lib/src/components/VideoPlayerDev/ButtonRow/ButtonRow.xml b/playlet-lib/src/components/VideoPlayerDev/ButtonRow/ButtonRow.xml index e99ad66d..c725699a 100644 --- a/playlet-lib/src/components/VideoPlayerDev/ButtonRow/ButtonRow.xml +++ b/playlet-lib/src/components/VideoPlayerDev/ButtonRow/ButtonRow.xml @@ -18,7 +18,8 @@ - + diff --git a/playlet-lib/src/components/VideoPlayerDev/TrickPlayBar/TrickPlayBar.spec.bs b/playlet-lib/src/components/VideoPlayerDev/TrickPlayBar/TrickPlayBar.spec.bs index 9ee8bcd3..f12ee6eb 100644 --- a/playlet-lib/src/components/VideoPlayerDev/TrickPlayBar/TrickPlayBar.spec.bs +++ b/playlet-lib/src/components/VideoPlayerDev/TrickPlayBar/TrickPlayBar.spec.bs @@ -2,6 +2,7 @@ ' INPUT fields, and asserts the rendered child fields: fill clip width, playhead translation, M:SS labels, ' the raised handle while a transport is active, the glyph swap, and the live layout (Rewind live TV / offset ' / ● LIVE swap). clippingRect reads back as {x,y,width,height} on the render thread. +import "pkg:/source/utils/Locale.bs" namespace Tests @@ -198,7 +199,7 @@ namespace Tests m.assertEqual(m.top.findNode("remainingLabel").text, "") ' the badge styling: red bullet + bold size-30 LIVE. blendColor reads back as a signed 32-bit int. m.AssertBlend(m.top.findNode("bullet").blendColor, &hD53E5AFF) - m.assertEqual(m.top.findNode("liveLabel").text, Tr("LIVE")) + m.assertEqual(m.top.findNode("liveLabel").text, Tr(Locale.RowCell.Live)) ' the badge is right-aligned to the track end whatever the language ("EN DIRECT" >> "LIVE"). lbl = m.top.findNode("liveLabel") m.assertTrue(Abs((lbl.translation[0] + lbl.boundingRect().width) - 1144) < 2, "badge right edge pinned to the track end") diff --git a/playlet-lib/src/components/VideoPlayerDev/VideoPlayerButton/VideoPlayerButton.xml b/playlet-lib/src/components/VideoPlayerDev/VideoPlayerButton/VideoPlayerButton.xml index 3e3fbca2..5c620f38 100644 --- a/playlet-lib/src/components/VideoPlayerDev/VideoPlayerButton/VideoPlayerButton.xml +++ b/playlet-lib/src/components/VideoPlayerDev/VideoPlayerButton/VideoPlayerButton.xml @@ -13,7 +13,8 @@ - + diff --git a/playlet-lib/src/components/VideoPlayerDev/VideoPlayerDev.bs b/playlet-lib/src/components/VideoPlayerDev/VideoPlayerDev.bs index c01b57c7..d01fbdf6 100644 --- a/playlet-lib/src/components/VideoPlayerDev/VideoPlayerDev.bs +++ b/playlet-lib/src/components/VideoPlayerDev/VideoPlayerDev.bs @@ -337,11 +337,15 @@ function OnKeyEvent(key as string, press as boolean) as boolean ' BAR tier takes Up (back to the buttons) and lets the transport keys through. Rev/Fwd/Replay are not owned ' by the buttons, so they fall through to the transport and move focus to the bar. if press and CanFocusInteract() - ' Up/Down move between the two tiers; a no-op at the ends is still consumed. + ' Up/Down move between the two tiers; a no-op at the ends is still consumed — Up at the top tier + ' (the buttons) pulses the focused button so the press visibly lands somewhere. if key = RemoteKeys.Up or key = RemoteKeys.Down newTarget = PlayerCoordinatorLogic.NextFocusTarget(m.focusTarget, key) if newTarget <> m.focusTarget SetFocusTarget(newTarget) + else if m.focusTarget = PlayerCoordinatorLogic.FocusTarget.Buttons + m.buttonRow.nudge = true + ArmAutoHide() end if return true end if diff --git a/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevMock.bs b/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevMock.bs index 135c8c4a..74bd4b36 100644 --- a/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevMock.bs +++ b/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevMock.bs @@ -37,6 +37,13 @@ function TestSetup() as void Initialize() ' the real coordinator init body (m.transport, findNode children, timer observers, getHttpAgent) + ' count ButtonRow nudge pulses (the field is a sticky alwaysNotify boolean, so the count — not the value — + ' is what tells the spec whether a given press pulsed). Scoped + unobserve-first: the suite node is shared + ' across tests, so a plain ObserveField here would stack one counter observer per TestSetup call. + m.top.nudgeCount = 0 + m.buttonRow.unobserveFieldScoped("nudge") + m.buttonRow.observeFieldScoped("nudge", FuncName(OnTestNudge)) + container = createObject("roSGNode", "Node") container.addField("fullscreen", "boolean", false) container.fullscreen = true @@ -72,6 +79,10 @@ function TestSetup() as void OnNodeReady() end function +function OnTestNudge() as void + m.top.nudgeCount += 1 +end function + ' TestKey — drive a remote key through the REAL OnKeyEvent (scrub/scan/commit/etc). function TestKey(key as string, down as boolean) as boolean return OnKeyEvent(key, down) @@ -170,6 +181,7 @@ function TestSnapshot() as object chromeShown: (m.chromeMode = ChromeMode.Shown or m.chromeMode = ChromeMode.FadingIn) focusTarget: m.focusTarget focusedButton: m.focusedButton + nudgeCount: m.top.nudgeCount forceLiveBadge: m.trickPlayBar.forceLiveBadge liveBadgeShown: m.trickPlayBar.findNode("liveLabel").visible barRemainingText: m.trickPlayBar.findNode("remainingLabel").text diff --git a/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevMock.xml b/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevMock.xml index a52913fc..ca32428d 100644 --- a/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevMock.xml +++ b/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevMock.xml @@ -40,6 +40,8 @@ + + diff --git a/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevSeam.spec.bs b/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevSeam.spec.bs index 3708617d..82f30128 100644 --- a/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevSeam.spec.bs +++ b/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevSeam.spec.bs @@ -2,6 +2,7 @@ ' inert and spec-driven) through scripted device-state sequences the real Roku Video won't produce on command. ' This is the harness that would have caught the reported wedge: the existing INV-D* are blind to it (during the ' wedge state="buffering", so "transport => state<>playing" was SATISFIED). The NEW property is P-seam. +import "pkg:/components/VideoPlayerDev/PlayerCoordinatorLogic.bs" import "pkg:/components/VideoPlayerDev/TransportController.bs" import "pkg:/components/VideoPlayerDev/VideoNode.bs" import "pkg:/source/utils/RemoteKeys.bs" @@ -214,6 +215,56 @@ namespace Tests m.assertEqual(m.Snap().focusedButton, 0, "a fresh reveal resets the highlight") end function + ' Up at the top tier (the buttons) has nowhere to go; the press must still visibly land — it pulses + ' (nudges) the focused button instead of being swallowed. + @it("Up at the buttons tier nudges the focused button instead of moving focus") + function _() + m.top.callFunc("TestKey", RemoteKeys.Up, true) ' reveal -> buttons tier + before = m.Snap() + m.assertEqual(before.focusTarget, PlayerCoordinatorLogic.FocusTarget.Buttons) + m.assertEqual(before.nudgeCount, 0, "the reveal itself does not nudge") + m.top.callFunc("TestKey", RemoteKeys.Up, true) ' nowhere to go up + after = m.Snap() + m.assertEqual(after.nudgeCount, 1, "the no-op Up pulsed the focused button") + m.assertEqual(after.focusTarget, PlayerCoordinatorLogic.FocusTarget.Buttons, "focus stays on the buttons") + m.assertEqual(after.focusedButton, before.focusedButton, "the highlight is untouched") + end function + + ' A press that GOES somewhere must not nudge: Left/Right inside the row, Up/Down between the tiers. + @it("a press that moves focus does not nudge") + function _() + m.top.callFunc("TestKey", RemoteKeys.Up, true) ' reveal -> buttons tier, play/pause + m.top.callFunc("TestKey", RemoteKeys.Right, true) ' play/pause -> minimize + m.top.callFunc("TestKey", RemoteKeys.Down, true) ' buttons -> bar + m.top.callFunc("TestKey", RemoteKeys.Up, true) ' bar -> buttons + m.top.callFunc("TestKey", RemoteKeys.Left, true) ' minimize -> play/pause + m.assertEqual(m.Snap().nudgeCount, 0, "every press moved focus; none may pulse") + end function + + ' Left/Right clamped at the row's ends pulse the focused button (the original nudge path, at the seam). + @it("Left/Right clamped at the row ends nudge the focused button") + function _() + m.top.callFunc("TestKey", RemoteKeys.Up, true) ' reveal -> play/pause (leftmost) + m.top.callFunc("TestKey", RemoteKeys.Left, true) ' clamped at the left end + m.assertEqual(m.Snap().nudgeCount, 1) + m.top.callFunc("TestKey", RemoteKeys.Right, true) ' -> minimize (rightmost) + m.top.callFunc("TestKey", RemoteKeys.Right, true) ' clamped at the right end + snap = m.Snap() + m.assertEqual(snap.nudgeCount, 2) + m.assertEqual(snap.focusedButton, 1, "the clamp held the highlight at the end") + end function + + ' Down at the bar tier (the bottom) is also a no-op, but the bar is not a button: consumed, no nudge. + @it("Down at the bar tier is consumed without a nudge") + function _() + m.top.callFunc("TestKey", RemoteKeys.Up, true) ' reveal -> buttons tier + m.top.callFunc("TestKey", RemoteKeys.Down, true) ' buttons -> bar + m.top.callFunc("TestKey", RemoteKeys.Down, true) ' nowhere to go down + snap = m.Snap() + m.assertEqual(snap.focusTarget, PlayerCoordinatorLogic.FocusTarget.Bar, "focus stays on the bar") + m.assertEqual(snap.nudgeCount, 0) + end function + ' A keep-playing seek issued while PAUSED must preserve the pause: the device auto-resumes on any seek ' (autoplayAfterSeek only governs rebuffer-resume per the Video docs), so the coordinator re-pauses on ' the playing edge the auto-resume produces.