From e2166070d0bd92ed59f862ebd2f030607fb9ac44 Mon Sep 17 00:00:00 2001 From: Elijah Date: Thu, 12 Nov 2026 12:30:36 -0700 Subject: [PATCH 01/10] Publish the 0.1.0-beta.18 update feed (Windows) Co-Authored-By: Claude Opus 5.5 --- updates/latest.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/updates/latest.json b/updates/latest.json index a62614b..1c231f1 100644 --- a/updates/latest.json +++ b/updates/latest.json @@ -1,11 +1,11 @@ { - "version": "0.1.0-beta.17", - "notes": "- Fix the Up Next countdown stalling when the native video has keyboard focus instead of the webview. Count elapsed time accurately through delayed timer callbacks, and keep the countdown independent of the video's pause state, as on Android TV.\n- Open Up Next at the first episode credit marker, including after seeking into credits, independently of movie-credit skip preferences. Open the screen immediately while episode context loads, and start autoplay once the next episode is known. Without markers, use the end of the episode as a fallback.\n- Cancel autoplay on mouse movement, clicks, scrolling or keypresses. A stationary pointer does not cancel it; cancelled autoplay stays cancelled when delayed metadata arrives.\n- Match the Android TV screen more closely: remove the extra toolbar actions, Cancel autoplay button and autoplay-status text; show only a white video outline on hover or keyboard focus. Use compact episode metadata, full runtime, landscape related shows and captions beneath the artwork.", - "pub_date": "2026-11-12T18:45:12.386Z", + "version": "0.1.0-beta.18", + "notes": "A rebuilt Up Next screen that looks and works like the rest of Kaleido.\r\n\r\n- Up Next now uses the same artwork backdrop, colour wash, buttons and cards as the title pages. The credits keep playing in the top-left corner beside the next episode, and the Play next episode button fills as the countdown runs.\r\n- The Season and Related shows rows scroll with the side arrows, like every other row, instead of scrollbars. The season row starts at the episode you just watched.\r\n- Click the video or press Esc to go back to the credits; at the end of an episode this no longer restarts it from the beginning.\r\n- Up Next fits smaller windows, and the window buttons stay visible on Mac while it's open.\r\n- Playback settings are a simple list again: Skip intros, Skip movie credits, Automatic skip delay and Autoplay next episode.", + "pub_date": "2026-11-12T19:30:25.877Z", "platforms": { "windows-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVST1RiNHdFVm01NGJ5Yjl4OHhRYnZtVXE4WHZhTTNBSkJ2QloyMTZJY2l2Nm14MlY0dlhYbEpNNjVHem1vVUduenIvL2xJY0VDTlpiajY1NnFIcGRKMlRxYTNJSGZobGd3PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzk0NTA5MDkxCWZpbGU6S2FsZWlkb18wLjEuMC1iZXRhLjE3X3g2NC1zZXR1cC5leGUJdmVyc2lvbjowLjEuMC1iZXRhLjE3CklvZnZuK1hOaCt1Rk9TcHV0Z0N4YSt0eXJsWVRPTVlvTU1pMmJ4QWVWZ3VUQjZTREh4QmVkMy93YWxWbXZHVkl6TXFveWhjU2tlODBPWWg0cEZ5ZUFBPT0K", - "url": "https://git.elijahkuntz.com/Elijah/Kaleido-Desktop/releases/download/v0.1.0-beta.17/Kaleido_0.1.0-beta.17_x64-setup.exe" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVST1RiNHdFVm01NGRBcFhBTklWTmpyb3I2SnpGWmVna3BuV1hCbUJNVnZPMUdSc1lYcCsveU1pL1VoUU8wOFkvSVBhb2lFQlBXaUNzODRTcEgyMEpQYkFTSHFIbjFGWEFjPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzk0NTExODAzCWZpbGU6S2FsZWlkb18wLjEuMC1iZXRhLjE4X3g2NC1zZXR1cC5leGUJdmVyc2lvbjowLjEuMC1iZXRhLjE4CndhbUZxaStzMWZvNzlpcUhJUUQzbFJmZHg0ZWJxUzd1N3FHSGlvejhvTDdja0wvQVhsbzRwY0lnVGN6OFJ3ZHFFejNtMTAxTlVyMEdDTXBZUnhPRUNnPT0K", + "url": "https://git.elijahkuntz.com/Elijah/Kaleido-Desktop/releases/download/v0.1.0-beta.18/Kaleido_0.1.0-beta.18_x64-setup.exe" } } } From bb204796ac78ba8739d4c22e51c6d6221b68cd93 Mon Sep 17 00:00:00 2001 From: Elijah Date: Thu, 12 Nov 2026 12:53:48 -0700 Subject: [PATCH 02/10] Release Kaleido Desktop 0.1.0-beta.19 Up Next fixes: - Re-arm Up Next when playback leaves the credits, and always open it at the end of an episode, so it appears every time the credits start. - Restore the back arrow (to the miniplayer) and add a full-screen button at the top, beside the window buttons. - The show logo opens the show page, as in the player. - Draw the countdown fill every frame instead of in 50 ms steps. - Size the row cards from the space under the header so the rows fill it; the related row runs off the bottom of short windows. - Use the next episode's still as the backdrop with a stronger scrim and brighter, shadowed description text. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 11 +++++++ package-lock.json | 4 +-- package.json | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 2 +- src/player/PostPlay.tsx | 67 ++++++++++++++++++++++++++++++--------- src/player/store.test.ts | 18 +++++++++-- src/player/store.ts | 14 ++++++-- src/styles/player.css | 60 +++++++++++++++++++++-------------- 10 files changed, 133 insertions(+), 49 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe77357..f811990 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 0.1.0-beta.19 + +Up Next fixes. + +- Up Next now opens every time the credits start: going back to the credits and seeking into the episode brings it back when they come round again, and it always opens when an episode reaches the end. +- The back arrow and a full-screen button are back at the top of Up Next, so you can return to browsing (playback continues in the miniplayer) or leave full screen. +- Click the show's logo to go to its page, with playback moving to the miniplayer. +- The Play next episode countdown fills smoothly. +- The episode rows are sized to fill the screen instead of leaving a gap at the bottom. +- The backdrop now shows the next episode, and its description is easier to read over bright artwork. + ## 0.1.0-beta.18 A rebuilt Up Next screen that looks and works like the rest of Kaleido. diff --git a/package-lock.json b/package-lock.json index 0d3af2a..c2b9033 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "kaleido-desktop", - "version": "0.1.0-beta.18", + "version": "0.1.0-beta.19", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "kaleido-desktop", - "version": "0.1.0-beta.18", + "version": "0.1.0-beta.19", "dependencies": { "@fontsource-variable/inter": "^5.3.0", "@tanstack/react-query": "^5.105.0", diff --git a/package.json b/package.json index 22fdfd0..db9e07a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "kaleido-desktop", "private": true, - "version": "0.1.0-beta.18", + "version": "0.1.0-beta.19", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 1b9a740..c87ca4a 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2173,7 +2173,7 @@ dependencies = [ [[package]] name = "kaleido" -version = "0.1.0-beta.18" +version = "0.1.0-beta.19" dependencies = [ "fs2", "futures-util", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index b8c8d87..0b163b6 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kaleido" -version = "0.1.0-beta.18" +version = "0.1.0-beta.19" description = "Kaleido — a Plex client for Windows" authors = ["Elijah"] edition = "2021" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 951df20..5286972 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "Kaleido", - "version": "0.1.0-beta.18", + "version": "0.1.0-beta.19", "identifier": "tv.kaleido.desktop", "build": { "beforeDevCommand": "npm run dev", diff --git a/src/player/PostPlay.tsx b/src/player/PostPlay.tsx index 6241093..33840c6 100644 --- a/src/player/PostPlay.tsx +++ b/src/player/PostPlay.tsx @@ -1,4 +1,4 @@ -import { useEffect, useLayoutEffect, useRef, type CSSProperties } from 'react'; +import { useEffect, useLayoutEffect, useMemo, useRef } from 'react'; import { useQuery } from '@tanstack/react-query'; import { usePlayer } from './store'; import { mpv } from './engine'; @@ -73,11 +73,25 @@ export function PostPlay() { }, []); const backToVideo = () => usePlayer.getState().dismissPostPlay(); + // As in the player: the show page opens with playback moving to the miniplayer. + const openShow = () => { + usePlayer.getState().minimize(); + navigate({ name: 'item', id: item.grandparentId }); + }; + // The next episode's own still, as on Android TV: darker than most show art, so the copy reads. + const scene = upcoming ?? item; + const sceneArt = useMemo(() => ({ ...scene, grandparentArt: scene.thumb || scene.grandparentArt }), [scene]); return (
-
{server && }
-
+
{server && }
+
+ + {!fullscreen && }
@@ -90,7 +104,13 @@ export function PostPlay() { {upcoming || !contextReady ? 'Up next' : 'More to watch'} - + {item.grandparentId ? ( + + ) : ( + + )} {upcoming ? ( <>

{upcoming.title}

@@ -165,19 +185,36 @@ function NowPlaying({ item }: { item: Item }) { ); } -/** Play next episode. While autoplay counts down, a lighter fill sweeps across it. */ +/** + * Play next episode. While autoplay counts down, a lighter fill sweeps across it. + * The store counts in 50 ms steps; the fill is drawn every frame between them. + */ function PlayNext({ ref }: { ref: React.Ref }) { - const countdown = usePlayer((s) => s.countdown); - const total = usePlayer((s) => s.countdownTotal); - const counting = countdown !== null && total > 0; - const fill = counting ? (1 - countdown / total) * 100 : 0; + const counting = usePlayer((s) => s.countdown !== null && s.countdownTotal > 0); + const fill = useRef(null); + useEffect(() => { + if (!counting) return; + let last = { value: usePlayer.getState().countdown ?? 0, at: performance.now() }; + const unsubscribe = usePlayer.subscribe((s, prev) => { + if (s.countdown !== prev.countdown && s.countdown !== null) last = { value: s.countdown, at: performance.now() }; + }); + let raf = 0; + const draw = () => { + const { countdownTotal: total } = usePlayer.getState(); + // Run on from the last step, but never more than a couple of steps ahead (a held countdown stays held). + const remaining = Math.max(0, last.value - Math.min(performance.now() - last.at, 120) / 1000); + if (fill.current && total) fill.current.style.transform = `scaleX(${1 - remaining / total})`; + raf = requestAnimationFrame(draw); + }; + draw(); + return () => { + unsubscribe(); + cancelAnimationFrame(raf); + }; + }, [counting]); return ( - diff --git a/src/player/store.test.ts b/src/player/store.test.ts index 26169bc..5cfb452 100644 --- a/src/player/store.test.ts +++ b/src/player/store.test.ts @@ -109,13 +109,27 @@ describe('Up Next playback lifecycle', () => { vi.advanceTimersByTime(10000); expect(usePlayer.getState()).toMatchObject({ postPlay: true, countdown: null, postPlayDismissed: true }); }); - it('returns to credits without reopening on the next time event or EOF', () => { + it('returns to credits without reopening while they play', () => { time(81); usePlayer.getState().dismissPostPlay(); time(82); - eof(); expect(usePlayer.getState()).toMatchObject({ postPlay: false, countdown: null }); }); + it('reopens at the end after returning to the credits', () => { + time(81); + usePlayer.getState().dismissPostPlay(); + eof(); + expect(usePlayer.getState()).toMatchObject({ postPlay: true, countdown: 5 }); + }); + it('reopens when the credits start again after seeking back into the episode', () => { + time(81); + usePlayer.getState().dismissPostPlay(); + usePlayer.getState().seek(40); + time(40); + expect(usePlayer.getState().postPlay).toBe(false); + time(80); + expect(usePlayer.getState()).toMatchObject({ postPlay: true, countdown: 5 }); + }); it.each(['hidden', 'mini'] as const)('holds the countdown while %s', (reason) => { time(81); if (reason === 'hidden') Object.assign(document, { hidden: true }); diff --git a/src/player/store.ts b/src/player/store.ts index 5107db3..40a18a6 100644 --- a/src/player/store.ts +++ b/src/player/store.ts @@ -647,8 +647,12 @@ function fallbackAfterError() { function maybeCredits(pos: number) { const st = usePlayer.getState(); - if (st.item?.type !== 'episode' || !st.firstFrame || st.postPlayDismissed) return; - if (st.item.markers.some((m) => m.type === 'credits' && pos * 1000 >= m.start && pos * 1000 < m.end)) openPostPlay(); + if (st.item?.type !== 'episode' || !st.firstFrame) return; + const inCredits = st.item.markers.some((m) => m.type === 'credits' && pos * 1000 >= m.start && pos * 1000 < m.end); + // Leaving the credits (seeking back into the episode) re-arms Up Next for the next time they start. + if (!inCredits) { + if (st.postPlayDismissed && !st.postPlay && !st.ended) usePlayer.setState({ postPlayDismissed: false }); + } else if (!st.postPlayDismissed) openPostPlay(); } function onEnded() { @@ -657,7 +661,11 @@ function onEnded() { usePlayer.setState({ ended: true }); report('stopped'); checkScrobble(); - if (st.item?.type === 'episode') openPostPlay(); + // Reaching the end always offers Up Next, as on Android, even after watching the credits. + if (st.item?.type === 'episode' && !st.postPlay) { + usePlayer.setState({ postPlayDismissed: false }); + openPostPlay(); + } } export const usePlayer = create((set, get) => ({ diff --git a/src/styles/player.css b/src/styles/player.css index b292de6..0ca1f70 100644 --- a/src/styles/player.css +++ b/src/styles/player.css @@ -711,11 +711,8 @@ html.os-macos:not(.window-fullscreen) .player-top { .up-next { display: flex; flex-direction: column; - --up-top: 44px; - --up-video-w: clamp(320px, 34vw, 640px); -} -html.os-macos:not(.window-fullscreen) .up-next { --up-top: 64px; + --up-video-w: clamp(320px, 34vw, 640px); } .up-next-scene { position: absolute; @@ -745,28 +742,30 @@ html.os-macos:not(.window-fullscreen) .up-next { .up-next-backdrop .backdrop-scrim, .up-next-backdrop.washed .backdrop-scrim { background: - linear-gradient(90deg, rgba(9, 10, 12, 0.95) 0%, rgba(9, 10, 12, 0.86) 36%, rgba(9, 10, 12, 0.6) 64%, rgba(9, 10, 12, 0.28) 100%), + linear-gradient(90deg, rgba(9, 10, 12, 0.96) 0%, rgba(9, 10, 12, 0.9) 38%, rgba(9, 10, 12, 0.74) 62%, rgba(9, 10, 12, 0.55) 100%), linear-gradient(0deg, var(--bg) 0%, rgba(9, 10, 12, 0.6) 22%, transparent 55%); } .up-next-top { - position: absolute; - top: 0; - left: 0; - right: 0; - height: 34px; + height: 60px; z-index: 3; } -.up-next-top .window-controls { - position: absolute; - top: 0; - right: 0; - height: 34px; - margin: 0; +.up-next-fullscreen { + margin-left: auto; } -.up-next-top .window-controls button { +/* Beside the window's own buttons (Windows, outside full screen), it takes + their size and line so the four read as one group. */ +.up-next-top:has(> .window-controls) .up-next-fullscreen { + align-self: flex-start; + width: 46px; height: 34px; + margin-right: 110px; + border-radius: 0; color: #e4e8e9; } +.up-next-top:has(> .window-controls) .up-next-fullscreen svg { + width: 15px; + height: 15px; +} .up-next-head { position: relative; z-index: 1; @@ -860,7 +859,8 @@ html.os-macos:not(.window-fullscreen) .up-next { } .up-next-summary { margin: 14px 0 0; - color: #d0d5d8; + color: #e3e7e9; + text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 1px 14px rgba(0, 0, 0, 0.55); font-size: 14px; line-height: 1.62; display: -webkit-box; @@ -880,13 +880,14 @@ html.os-macos:not(.window-fullscreen) .up-next { .up-next-play.counting:hover:not(:disabled) { background: #a3a8a9; } -.up-next-play.counting::before { - content: ''; +.up-next-play-fill { position: absolute; - inset: 0 auto 0 0; + inset: 0; z-index: -1; - width: var(--fill); background: #f6f7f7; + transform: scaleX(0); + transform-origin: left; + will-change: transform; } .up-next-play:focus-visible { outline: 2px solid #fff; @@ -905,8 +906,21 @@ html.os-macos:not(.window-fullscreen) .up-next { .up-next-shelf { margin-bottom: 22px; } +/* Cards are sized from the space below the header, so the season and related + rows fill it (--up-row: a row's height besides its artwork). In a short, + wide window they keep a sensible size and the related row runs off the + bottom, as on Android TV. */ +.up-next-rows { + container-type: size; + --up-row: 128px; +} .up-next-shelf .shelf .card.landscape { - width: clamp(200px, 15.5vw, 290px); + width: clamp(15vw, calc((50cqh - var(--up-row)) * 16 / 9), 26vw); +} +@media (max-width: 1333px) { + .up-next-shelf .shelf .card.landscape { + width: clamp(200px, calc((50cqh - var(--up-row)) * 16 / 9), 26vw); + } } .up-next-shelf .card { scroll-margin-left: 0; From 5719432fe8d2aa39a6e0a289aad9940b5984cc47 Mon Sep 17 00:00:00 2001 From: Elijah Date: Thu, 12 Nov 2026 12:57:57 -0700 Subject: [PATCH 03/10] Publish the 0.1.0-beta.19 update feed (Windows) Co-Authored-By: Claude Opus 5.5 --- updates/latest.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/updates/latest.json b/updates/latest.json index 1c231f1..5d09ac8 100644 --- a/updates/latest.json +++ b/updates/latest.json @@ -1,11 +1,11 @@ { - "version": "0.1.0-beta.18", - "notes": "A rebuilt Up Next screen that looks and works like the rest of Kaleido.\r\n\r\n- Up Next now uses the same artwork backdrop, colour wash, buttons and cards as the title pages. The credits keep playing in the top-left corner beside the next episode, and the Play next episode button fills as the countdown runs.\r\n- The Season and Related shows rows scroll with the side arrows, like every other row, instead of scrollbars. The season row starts at the episode you just watched.\r\n- Click the video or press Esc to go back to the credits; at the end of an episode this no longer restarts it from the beginning.\r\n- Up Next fits smaller windows, and the window buttons stay visible on Mac while it's open.\r\n- Playback settings are a simple list again: Skip intros, Skip movie credits, Automatic skip delay and Autoplay next episode.", - "pub_date": "2026-11-12T19:30:25.877Z", + "version": "0.1.0-beta.19", + "notes": "Up Next fixes.\r\n\r\n- Up Next now opens every time the credits start: going back to the credits and seeking into the episode brings it back when they come round again, and it always opens when an episode reaches the end.\r\n- The back arrow and a full-screen button are back at the top of Up Next, so you can return to browsing (playback continues in the miniplayer) or leave full screen.\r\n- Click the show's logo to go to its page, with playback moving to the miniplayer.\r\n- The Play next episode countdown fills smoothly.\r\n- The episode rows are sized to fill the screen instead of leaving a gap at the bottom.\r\n- The backdrop now shows the next episode, and its description is easier to read over bright artwork.", + "pub_date": "2026-11-12T19:57:48.627Z", "platforms": { "windows-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVST1RiNHdFVm01NGRBcFhBTklWTmpyb3I2SnpGWmVna3BuV1hCbUJNVnZPMUdSc1lYcCsveU1pL1VoUU8wOFkvSVBhb2lFQlBXaUNzODRTcEgyMEpQYkFTSHFIbjFGWEFjPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzk0NTExODAzCWZpbGU6S2FsZWlkb18wLjEuMC1iZXRhLjE4X3g2NC1zZXR1cC5leGUJdmVyc2lvbjowLjEuMC1iZXRhLjE4CndhbUZxaStzMWZvNzlpcUhJUUQzbFJmZHg0ZWJxUzd1N3FHSGlvejhvTDdja0wvQVhsbzRwY0lnVGN6OFJ3ZHFFejNtMTAxTlVyMEdDTXBZUnhPRUNnPT0K", - "url": "https://git.elijahkuntz.com/Elijah/Kaleido-Desktop/releases/download/v0.1.0-beta.18/Kaleido_0.1.0-beta.18_x64-setup.exe" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVST1RiNHdFVm01NGJlc0gzYzRXWEVxdDZBeWI1ckRDZ3BwSGQrSTFxZm5RVSsvQi8yU3JOZFByTzBSY3VFUm1LU1U0YjRLU3l2cTZmakY5Nlg4K3Z4NnIxSjRXMW1Mb3dzPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzk0NTEzNDUzCWZpbGU6S2FsZWlkb18wLjEuMC1iZXRhLjE5X3g2NC1zZXR1cC5leGUJdmVyc2lvbjowLjEuMC1iZXRhLjE5CndMMnN3a28zdC92OHZ6eUVNSXNSV3dHWEJSczd5aFJ1bEpDSFVEUXRYUDRVNVhGeEw4eVIzZ014WW5CWlhIWVJzWFJYTDVFUzU4eVBwNStjZ1RmVkFnPT0K", + "url": "https://git.elijahkuntz.com/Elijah/Kaleido-Desktop/releases/download/v0.1.0-beta.19/Kaleido_0.1.0-beta.19_x64-setup.exe" } } } From bc3358cb078ad80cbcf9711536e0d010c44703ed Mon Sep 17 00:00:00 2001 From: Elijah Date: Fri, 13 Nov 2026 13:41:02 -0700 Subject: [PATCH 04/10] Release Kaleido Desktop 1.0.0 Out of beta. Show and season pages: - Season pages list episodes as a grid of cards (still, description, watched state) instead of the episode list and season picker; the season title opens a menu of the show's seasons (replacing the page, so Back returns to the show). - Show pages keep only the Seasons row; single-season shows list their episodes. The up-next line adds the title instead of repeating the episode number. - Season Play/Resume follows the show's on-deck episode, and the season shows the year it aired. Watching: - A title Plex has counted as played stays watched during an unfinished rewatch; leftover positions only show in Continue Watching and on the episode you're up to. Resume buttons use resumable(). - Next/previous episode (autoplay, Up Next, player) start from the top. Browsing: - Rows that haven't been scrolled stay at their start when items are added in front (scroll snapping kept the old first card in place). - Show names on episode cards link to the show; seasons outside their show's page are captioned with the show's name. - Detail facts show the runtime; the Resume button has the time left. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 15 +++ package-lock.json | 4 +- package.json | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 2 +- src/app/format.ts | 13 ++- src/app/keyboardNav.ts | 4 +- src/player/store.test.ts | 8 ++ src/player/store.ts | 6 +- src/plex/plex.test.ts | 14 ++- src/screens/Item.tsx | 192 ++++++++++++++++---------------------- src/styles/app.css | 18 ++++ src/styles/screens.css | 145 +++++++--------------------- src/ui/media.tsx | 83 +++++++++++++--- 15 files changed, 263 insertions(+), 247 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f811990..ed4b04b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 1.0.0 + +Kaleido is out of beta. This release reworks the show and season pages and smooths out watching a series. + +- Season pages show their episodes as a grid of cards, each with its still, description and watched state, in place of the long episode list. +- Click the season's name under the show's logo to switch to another season. +- Show pages list seasons once, as a row of posters. A show with only one season shows its episodes directly. +- Episodes you've watched stay marked as watched when you rewatch them and stop partway through. The leftover position only shows on the episode you're up to. +- When the next episode plays, whether automatically or with Next, it starts from the beginning instead of near the end of an earlier viewing. +- Click a show's name under a Continue Watching card to go to the show. +- Continue Watching starts at the first title when something new is added, instead of scrolling it off the left edge. +- Season posters outside their show's page, such as New Seasons, are labelled with the show's name. +- Season pages show the year the season aired, and their Play button agrees with the show page about which episode is next. +- Movie and episode pages show the runtime in their details, with the time left on the Resume button. + ## 0.1.0-beta.19 Up Next fixes. diff --git a/package-lock.json b/package-lock.json index c2b9033..ca9602e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "kaleido-desktop", - "version": "0.1.0-beta.19", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "kaleido-desktop", - "version": "0.1.0-beta.19", + "version": "1.0.0", "dependencies": { "@fontsource-variable/inter": "^5.3.0", "@tanstack/react-query": "^5.105.0", diff --git a/package.json b/package.json index db9e07a..b7b7f3e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "kaleido-desktop", "private": true, - "version": "0.1.0-beta.19", + "version": "1.0.0", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index c87ca4a..eca151d 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2173,7 +2173,7 @@ dependencies = [ [[package]] name = "kaleido" -version = "0.1.0-beta.19" +version = "1.0.0" dependencies = [ "fs2", "futures-util", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 0b163b6..0abafd8 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kaleido" -version = "0.1.0-beta.19" +version = "1.0.0" description = "Kaleido — a Plex client for Windows" authors = ["Elijah"] edition = "2021" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 5286972..6f2152e 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "Kaleido", - "version": "0.1.0-beta.19", + "version": "1.0.0", "identifier": "tv.kaleido.desktop", "build": { "beforeDevCommand": "npm run dev", diff --git a/src/app/format.ts b/src/app/format.ts index a41b82d..e4a7ba9 100644 --- a/src/app/format.ts +++ b/src/app/format.ts @@ -36,10 +36,19 @@ export function progress(item: Item): number { return Math.min(1, Math.max(0, item.viewOffset / item.duration)); } +/** + * Watched once Plex has counted a full play. A rewatch left partway through keeps the + * title watched; its position only matters for resuming (`resumable`). + */ export function isWatched(item: Item, percent = 90): boolean { if (item.type === 'show' || item.type === 'season') return item.leafCount > 0 && item.viewedLeafCount >= item.leafCount; - if (item.viewOffset > 0 && item.duration > 0) return item.viewCount > 0 && item.viewOffset / item.duration >= percent / 100; - return item.viewCount > 0; + if (item.viewCount > 0) return true; + return item.viewOffset > 0 && item.duration > 0 && item.viewOffset / item.duration >= percent / 100; +} + +/** Has a saved position worth resuming from (not one at the very end). */ +export function resumable(item: Item): boolean { + return item.viewOffset > 0 && item.duration > 0 && item.viewOffset < item.duration * 0.97; } export function remainingEpisodes(item: Item): number { diff --git a/src/app/keyboardNav.ts b/src/app/keyboardNav.ts index 8a77535..4e01527 100644 --- a/src/app/keyboardNav.ts +++ b/src/app/keyboardNav.ts @@ -1,9 +1,9 @@ /** * Arrow-key movement between titles, for keyboard users. Focus moves to the * nearest card in the pressed direction (by on-screen geometry), so it works - * the same across shelves, grids, episode lists and people rows. + * the same across shelves, grids and people rows. */ -const TARGETS = '.card, .person-card:not(:disabled), .episode-row, .shelf-title-link'; +const TARGETS = '.card, .person-card:not(:disabled), .shelf-title-link'; function center(r: DOMRect) { return { x: r.left + r.width / 2, y: r.top + r.height / 2 }; diff --git a/src/player/store.test.ts b/src/player/store.test.ts index 5cfb452..e129b1d 100644 --- a/src/player/store.test.ts +++ b/src/player/store.test.ts @@ -102,6 +102,14 @@ describe('Up Next playback lifecycle', () => { expect(next).toHaveBeenCalledOnce(); usePlayer.setState({ playNext: original }); }); + it('starts the next episode from the beginning, ignoring an earlier partial viewing', async () => { + const original = usePlayer.getState().play; + const spy = vi.fn().mockResolvedValue(undefined); + usePlayer.setState({ play: spy, nextUp: { ...episode('2'), viewOffset: 88000 } }); + await usePlayer.getState().playNext(); + expect(spy).toHaveBeenCalledWith(expect.objectContaining({ id: '2' }), expect.objectContaining({ resume: false })); + usePlayer.setState({ play: original }); + }); it('cancels autoplay while keeping the screen open, including across EOF', () => { time(81); usePlayer.getState().cancelCountdown(); diff --git a/src/player/store.ts b/src/player/store.ts index 40a18a6..bbdd4d8 100644 --- a/src/player/store.ts +++ b/src/player/store.ts @@ -1019,13 +1019,15 @@ export const usePlayer = create((set, get) => ({ const st = get(); stopCountdown(); if (!st.nextUp) return; - await st.play(st.nextUp, { resume: true, quality: st.quality }); + // Watching on through a season starts each episode from the top, never at a + // stale position left by an earlier, unfinished viewing. + await st.play(st.nextUp, { resume: false, quality: st.quality }); }, async playPrevious() { const st = get(); if (!st.prevUp) return; - await st.play(st.prevUp, { resume: true, quality: st.quality }); + await st.play(st.prevUp, { resume: false, quality: st.quality }); }, cancelCountdown() { diff --git a/src/plex/plex.test.ts b/src/plex/plex.test.ts index 8be9e2e..fdd06ff 100644 --- a/src/plex/plex.test.ts +++ b/src/plex/plex.test.ts @@ -3,7 +3,7 @@ import { parseItem, parseScores } from './parse'; import { isLocalAddress } from './account'; import { partAt } from './playback'; import { headerSafe } from './client'; -import { duration, formatBadges, isWatched, remaining, washGradient } from '../app/format'; +import { duration, formatBadges, isWatched, remaining, resumable, washGradient } from '../app/format'; import { buildFeatures } from '../screens/discover'; import type { Hub } from './types'; @@ -65,10 +65,16 @@ describe('parsing', () => { }); describe('watched rules', () => { - it('treats a resumed title as watched only past the threshold', () => { - expect(isWatched(movie({ viewCount: 1, viewOffset: 3000000 }), 90)).toBe(false); - expect(isWatched(movie({ viewCount: 1, viewOffset: 5700000 }), 90)).toBe(true); + it('keeps a title watched while it is being rewatched', () => { + expect(isWatched(movie({ viewCount: 1, viewOffset: 3000000 }), 90)).toBe(true); expect(isWatched(movie({ viewCount: 1 }), 90)).toBe(true); + expect(resumable(movie({ viewCount: 1, viewOffset: 3000000 }))).toBe(true); + }); + + it('counts an unplayed title as watched only past the threshold', () => { + expect(isWatched(movie({ viewOffset: 3000000 }), 90)).toBe(false); + expect(isWatched(movie({ viewOffset: 5700000 }), 90)).toBe(true); + expect(isWatched(movie({}), 90)).toBe(false); }); it('uses episode counts for shows', () => { diff --git a/src/screens/Item.tsx b/src/screens/Item.tsx index ebaf887..dba8e82 100644 --- a/src/screens/Item.tsx +++ b/src/screens/Item.tsx @@ -4,12 +4,12 @@ import type { Item } from '../plex/types'; import { PROGRESS, useChildren, useItem, useRelated, useServerQuery } from '../app/queries'; import { useServer } from '../app/session'; import { useSettings } from '../app/settings'; -import { goBack, navigate, useRouter } from '../app/router'; -import { canManage, itemMenu, openDialog, openItem, playItem, playWithVersion, setWatched, shuffleItem } from '../app/actions'; -import { bitrate, channelLabel, date, duration, episodeLabel, extraLabel, fileSize, isWatched, remaining, resolutionLabel, technicalLine } from '../app/format'; +import { goBack, navigate } from '../app/router'; +import { canManage, itemMenu, openDialog, playItem, playWithVersion, setWatched, shuffleItem } from '../app/actions'; +import { bitrate, channelLabel, date, duration, episodeLabel, extraLabel, fileSize, isWatched, remaining, remainingEpisodes, resolutionLabel, resumable, technicalLine } from '../app/format'; import { Backdrop } from '../ui/Backdrop'; -import { Facts, HubShelf, LandscapeCard, PersonCard, PosterCard, Shelf, TitleArt } from '../ui/media'; -import { Artwork, Button, EmptyState, ErrorState, IconButton, PageLoader, Select } from '../ui/primitives'; +import { EpisodeCard, Facts, HubShelf, LandscapeCard, PersonCard, PosterCard, Shelf, TitleArt } from '../ui/media'; +import { Artwork, Button, EmptyState, ErrorState, IconButton, PageLoader } from '../ui/primitives'; import { Icon } from '../ui/Icon'; import { openMenu } from '../ui/overlays'; import { useDownloads } from '../downloads/store'; @@ -255,11 +255,12 @@ function AboutPanel({ item }: { item: Item }) { // —— Movie —————————————————————————————————————————————————————————— function MovieDetail({ item }: { item: Item }) { - const resume = item.viewOffset > 0 && !isWatched(item); + const resume = resumable(item); return (
- + {/* The Resume button carries the time left; the facts give the runtime. */} +
- {p > 0 && !watched && ( - - - - )} -
-
-

- {ep.title} - {watched && } -

-
- {[duration(ep.duration), ep.originallyAvailableAt ? date(ep.originallyAvailableAt) : '', ep.viewOffset && !watched ? remaining(ep) : ''].filter(Boolean).join(' · ')} -
- {ep.summary &&

{ep.summary}

} -
- +
+ {episodes.map((ep) => ( + + ))}
); } -function Episodes({ seasons, initialSeason, showPicker = true }: { seasons: Item[]; initialSeason?: string; showPicker?: boolean }) { - const saved = useRouter((s) => s.current.state.season as string | undefined); - const [seasonId, setSeasonId] = useState(saved ?? initialSeason ?? seasons[0]?.id); - useEffect(() => { - if (!seasonId && seasons[0]) setSeasonId(initialSeason ?? seasons[0].id); - }, [seasons, initialSeason]); - const episodes = useChildren(seasonId); - const season = seasons.find((s) => s.id === seasonId); - if (!seasons.length) return null; +function EpisodesSection({ episodes, subtitle, upNextId }: { episodes: Item[] | undefined; subtitle?: string; upNextId?: string }) { return (
-
-

Episodes

- {showPicker && seasons.length > 1 && ( -