A sched trace on the TV (release build) caught the real "2fps": not a
slow frame, but a starved one. During navigation the render pipeline
(app RenderThread, SurfaceFlinger/RenderEngine, the mali driver worker,
the Dolby audio service) saturated all four cores together with Coil's
image work — a burst of parallel ~30 ms bitmap decodes split across the
whole IO pool descheduled the main thread hundreds of times and froze
navigation for over a second.
The image loader now caps the request dispatcher at 2 parallel ops and
the decode/transformation pools at 2/1: images still fill in steadily
while scrolling but can no longer eat every core at once. Combined with
the release build on the TV (debug's JIT bursts produced 900 ms+ frames
by themselves), the same navigation settles at p90 ~13 ms per frame
with a worst frame of ~180 ms when a new row composes.
everything mid-load
Making subscribers the primary key reordered both rows and whole rows
as the per-channel subscriber refine streamed in: each background batch
re-sorted the screen while loading, and the list jumped several times on
entry (user: "the jumping is terrible"). The subscriber counts are not
in the video-listing fast path; they only arrive seconds later in
per-channel batches, so any ordering that leads with them cannot render
early.
Back to the stable keys — own row first, then video totals (then plays,
then subscribers) on both the row and the channel level. These come
entirely from the video listing before the first rebuild, so the screen
painted correctly once, verified: a single rebuild line across the whole
TV load, no further reshuffling. Video-less channels still never render,
the own row still holds first place whenever it exists.
Video-less channels dropped out of the row build when the fast path
switched to the video listing, and the previous commit wrongly merged
the own empty channels back in — the user rule is the opposite: a
channel (or a whole user row) with no videos renders at all; watching-
only accounts must stay invisible. The own row only exists when the
logged-in user owns at least one channel with videos.
The ordering is now one rule on both levels — user rows by each row's
channel sums, channels inside a row: subscribers, videos, views (desc).
Settled order on the TV verified against the instance's real follower
counts (kaylee 9, love 9, georg 6, yingfen 5, kinga 1 — georg's 211
videos only tie-break), with the own row first.
The per-user rows are built from the local video listing, so a channel
that never uploaded is invisible to the row build — and an account that
owns only such channels lost its row entirely. tvbot is exactly that
case: the local tvbots channel exists, it has no videos, and while
logged in as tvbot the screen opened on the next user's channels.
The row build now merges the logged-in user's own local channels from
the account-channels listing (already fetched, carries the full card
data) into the locals before grouping; the group sort already puts the
own row first. Verified on the emulator logged in as tvbot: the
"tvbot's Channels" row renders first with the video-less tvbots card.
The emulator in ~/Android/Sdk auto-updated to 37.2.12 on Oct 11 and since
then consistently fails its own KVM probe ("/dev/kvm is not found") and
segfaults on that failure path — while KVM is healthy: a manual
KVM_GET_API_VERSION ioctl returns the current API level 12, and both
/opt/android-sdk and the container-home emulator pass -accel-check on
the same kernel and device node. The script now prefers the documented
host SDK at /opt/android-sdk when no ANDROID_SDK_ROOT is set.
Once the home SDK is repaired (or the emulator regression disappears),
the fallback order can be revisited.
The discrete card now runs continuous AI inference, so the emulator must
not claim GL/Vulkan contexts on it. In windowed mode the emulator uses
the host GL/Vulkan stack, and the default GLVND selection picks the
discrete card on this machine. The script now discovers the first
display device whose driver is not nvidia and pins the emulator process
to it (Mesa GLX/EGL + DRI_PRIME + the Intel Vulkan ICD).
Headless (the default) needs no change: it always ran on swiftshader,
strictly software, and never touched any GPU.
A system trace on the TV showed the eased focus scroll re-ticking for
hundreds of milliseconds per move — animateScrollToItem's default spec
scales with distance, and every tick redraws the whole window on a TV
GPU, with 145 ms spikes when new cards composed mid-animation. That is
what drags row scrolling back down to a few fps, again (same symptom
51077b8 and 5ea1ca5 each fixed a facet of). easedScrollToItem keeps the
eased feel but caps the tween at ~140 ms, so a move costs a handful of
cheap ticks instead of hundreds.
The per-card focus requesters in the video grid were back in a snapshot
state map written during composition — the exact recompose loop
5ea1ca5 fixed in the rows, still alive in the grid screens. Plain
HashMap again, keyed on epoch only: keyed on items.size the map was
dropped wholesale on every page load, and already-composed cards didn't
re-populate it until their next recompose.
ShimmerAsyncImage keyed its loaded-state on the passed model, and the
callers built a fresh coil ImageRequest on every recomposition. ImageRequest
has no value equality, so the key changed every time: the loaded flag
reset, the shimmer overlay was re-added and the image load restarted with
each recomposition — an infinite animation per card that never disposed.
On the TV this showed as a general fps collapse wherever thumbnails
render (issue #28's feature shipped with this trap).
The requests are now remembered under stable keys (video/channel id and
the URL strings), so the sweep stops for real once the image (or an
error) lands.
Addresses #28.
The old park ran only while `firstVisibleItemIndex > 0`, but the focus
pull that hands the first card its focus leaves the header row at index
0 while slid up by ~96 dp — so the guard never fired and the top of the
channel header stayed clipped off screen (#31 review). scrollToItem(0)
re-anchors both index and offset.
The banner band drops to 116 dp with a 40 dp description strip, so the
whole header is under one card row: the grid never reflows around it and
the header stays fully on screen when the first card takes focus.
Addresses #27, #31.
One D-pad press moved 85% of the panel, so consecutive stops barely overlapped
and the middle of a long description was never on screen — on
tube.jeena.net/w/p4HtZrDCMbPfGYpMfG9fMN Jeena could not read the passage about
the credit-card outlier at all (#23 review). A press now moves about a third of
a screenful, so each stop repeats two thirds of the previous one and every line
gets shown on the way down.
Coming back from a channel page hands that channel's card the focus, but the
handle only wins when the card is still in the rows. A channel that was
renamed, unsubscribed, or simply never carried in the rows left every row
asking for no focus at all, so opening Channels from the drawer put the remote
nowhere: "when I click on Channels, none is selected, it should behave like
video cards" (#32 review). The fallback row is now chosen by whether the
handle exists anywhere in the rows, and a row whose wanted card never became
focusable takes its first card instead of staying unselected.
Two things were still wrong on the channel page and the list screens.
The header is a grid item again, so it scrolls with the videos (#27 review),
but handing the first video card the focus makes the framework pull that card
fully into view: the grid animates up, and the old park-at-top effect then
snapped it back down. Jeena still saw that jump "when the first video gets
focus". The park now runs before the focus handover, and only while the grid
is actually displaced, so there is nothing left to undo.
The first loading card on My videos, Search, Subscriptions, History and the
channel pages used to span the whole line, which read as a wide band across
four columns; Jeena wanted the plain single card in one column of one row
(#31 review), so the placeholder item no longer spans the line.
Scrolling the info text up still did nothing on the TV while down worked. The
handler only matched the raw nativeKeyEvent keycode; remotes don't all report
the same codes, so match Compose's normalised Key.DirectionUp/Down as well, and
always attempt the scroll (animateScrollBy clamps at the ends itself) instead of
gating it on the current offset.
Not reproducible on the emulator in either the debug or the release build, so
this targets the device difference rather than a confirmed fault.
Assembling the channel rows is slow, so it now starts when the app launches
instead of when the view is first opened; opening the view usually finds the
rows already there, and a second pass is skipped while one is in flight or the
data is still fresh (#32).
Coming back from a channel page re-selects the channel that was opened, scrolling
its row back to it, instead of snapping to the first one (#34).
Also drops the custom focusRestorer fallback added for #29: handing back a
requester whose card had scrolled out of composition crashed the app with
"FocusRequester is not initialized" when focus re-entered a scrolled row (hit on
the Channels screen). The plain restorer keeps the #29 behaviour without it.
Review follow-ups on the channel page header:
- It is a grid item again instead of being pinned, so scrolling the videos moves
it out of the way rather than leaving them to slide behind it. The redesigned
header is compact enough to stay fully visible when the first card takes
focus, and the page parks itself at the top on entry so the Subscribe button
is on screen.
- Its height is reserved before the channel loads, so the cards no longer jump
down when it arrives.
- A channel with no banner gets a gradient derived from a hash of its handle
instead of flat black, and one with no icon gets a stand-in avatar.
The info and comments panels sat under a hard-coded 48dp top padding, leaving a
black strip above them; they now fill the height from the very top (#24, and the
same note on #23).
The info panel no longer repeats the description's links in a list underneath —
they stay inline in the running text and OK opens the first one. UP/DOWN are
always consumed while scrolling, so the panel can no longer strand focus in a
place it can't scroll back from (#23 review).
STATE_ENDED counted as "not ready", so finishing a video brought the thumbnail
and the spinner back over the picture. Only STATE_BUFFERING drives the overlay
now; the initial load is already covered by the first-frame guard, so the video
simply stops on its last frame with the paused controls.
My videos, Subscriptions, History and the channel pages painted two whole rows
of placeholder cards on first open, and Channels painted two stub rows. Show a
single loading card instead, matching the Home rows.
ExoPlayer reports STATE_READY a beat before it actually draws the first frame,
so the buffering thumbnail was removed into a black gap right before playback
("thumbnail, then black, then playing"). Hold the thumbnail overlay until
onRenderedFirstFrame fires, so it hands straight over to the picture.
Opening a video flashed plain black during the metadata-loading phase (before
buffering, where the thumbnail already shows) — most visible on the TV where
that phase is longer. Pass the opened card's thumbnail into the player and paint
it full-screen (dimmed, under the spinner) during loading, handing off to the
buffering thumbnail once the stream is ready, so the player opens onto the
video's own poster instead of black.
Recapture every screen through the branch-only mock backend
(tools/screenshot-mock) so the app runs unmodified against real CC/Blender
content: the rows no longer repeat thumbnails (Continue watching, New local
videos and My videos draw different slices), the account has an avatar, the
player sits on a frame with something happening, and the Subscribe button reads
correctly. Adds a channel-page screenshot (banner, stats, Subscribe, full video
grid) and references it in the README.
New screenshots of the current UI (title bar with the account on the right, the
redesigned Home with three rows and progress bars, My videos privacy badges, the
Channels rows and the player). Captured against the public PeerTube demo instance
(peertube2.cpy.re) so they show real CC/Blender content, as before.
Rewrite the README so it leads with what JTube TV is and who it's for, refresh
the feature list and screenshot captions to match the current UI (three Home
rows, Back opens the sidebar, Subscribe on the channel page), and add the
official PeerTube logo next to the name. Screenshot images are refreshed in a
follow-up.
Without a mouse the channel banner was invisible: opening a channel focused the
first video card, which scrolled the header (a grid item) off-screen. The header
is now pinned above the grid and never scrolls away. The banner is its backdrop,
darkened to black at the bottom; the avatar sits beside the title with a
"by <owner> on <platform>" byline, the subscriber/video/created stats, and the
description flowing into the black beneath (a long one grows the header down
instead of being clipped). A Subscribe button sits on the banner, reachable with
UP from the first card, wired to the same follow/unfollow as the player.
AGENTS.md: subscribing is in scope (already on the player, now the channel page
too), so drop it from the excluded list.
Thumbnails, channel banners and avatars popped in from a flat grey rectangle. A
new ShimmerAsyncImage shows the same faint shimmer as the card placeholders
while the image loads, and the sweep disposes once the image (or an error)
arrives. Used for video thumbnails and the channel banners/avatars.
The saved-list snapshot (issue #9) painted the last session's rows instantly,
then the network refresh swapped them in and the tiles jumped as newer videos
appeared — jarring. Drop the snapshot instant-paint on Home, the video lists and
the Channels screen; images stay fast because Coil already disk-caches them.
Screens now show the loading card while the first page loads instead of stale
content: one card per Home row (not a fake full row), a single card at the end
of a growing grid, and a trailing card when a Home row loads its next page.
Moving up/down between the Home rows (and the Channels rows) jumped to the
geometrically-nearest card, so the row shifted left/right and felt inconsistent.
A focusRestorer on each row now lands focus on the card that row last had, so
the rows stay put as you move between them.
Reaching the sidebar used to mean scrolling all the way left to the first card.
Back from any list view now opens it directly; from the open sidebar on Home a
double Back still exits, and Esc (keyboard/scrcpy) mirrors the same model.
The info and comments side panels showed a generic "Info"/"Comments" label,
which read as an empty black bar with no clue which video it belonged to. Both
now show the video's title instead (#24, and the same complaint in #23).
The info panel's description also could not be scrolled with the D-pad: a plain
Text in a LazyColumn takes no focus, so a long description was unreadable past
the first screenful unless it happened to contain links. It is now a focusable,
D-pad-scrollable box; Down at the bottom hands focus to the link list, Left
closes the panel (#23).
Agents reference issues (never close — the closing keywords auto-close
on push, which mis-links fixes to unrelated commits); Jeena closes after
his TV check. Written down so it survives past sessions.
The Search screen's empty state replaced the whole grid with "Nothing
here yet" — no search field, no way back; LEFT from it went nowhere.
Both are scope rules of the issue: the screen keeps its field focused
on entry (retrying the request — the focus target attaches late in a
cold grid composition), LEFT from the field opens the sidebar like on
every other screen, and the results' auto-focus only runs when a search
is actually active (a persisted query re-entered shows its results
focused on the first card).
Search scope is a chip row below the field: Local and — when /config
allows the search index — Vidiverse. Vidiverse queries go through
search/videos with searchTarget=search-index; results may live on
other instances: their cards use the absolute thumbnailUrl, and opening
one plays it from THAT instance via an anonymous API (no history
reports for remote videos).
Closes#20Closes#21Closes#22
The placeholders only existed on the home rows; the shared list screens
(My videos, Search, Subscriptions, History, channel pages) still used a
full-screen spinner, and the Channels screen did too. All of them now
show card-shaped placeholders: the in-grid initial pass keeps the page
header and a two-row placeholder block, growing lists swap the always-
visible bottom spinner chip for a placeholder row driven by the new
loadingMore state on PagedListViewModel, and the channels screen shows
stub header bars plus placeholder rows while it starts up.
Closes#19
On TV hardware the debug build's UI thread renders at ~2fps
(dumpsys gfxinfo: 87% janky frames, 50th percentile 85ms, stalls up
to 4200ms while the GPU sits at 12ms). An R8 minified release of the
same code turns the identical interaction into 184 frames at 27ms
median with 15% jank — the artifact is the deliverable, and the debug
signature keeps install -r seamless for sideloads.
Rows that were still loading kept silent or a bare "Loading…" line.
Every list row (continue, new videos, subscriptions) now shows dummy
cards shaped like the real thing — gray rectangles with a very faint
sweeping sheen — because that says what is coming and that it is
moving; the spinner only survives where there is nothing to shape.
Fullscreen video loading shows the video's own thumbnail dimmed under
the circle loader instead of black, at least until the detail response
has the thumbnail; before that only the circle exists (issue #19).
The shimmer is a linear sheen at 8% alpha looping over 1.6s on a
near-black base, subtle per the report.
ExoPlayer flaps READY↔BUFFERING at every buffer edge and seek; each
flap tore the red spinner overlay out of composition and rebuilt it,
visibly restarting the animation from zero and flickering the covering
box — the "struggles and restarts" report. The displayed state now
follows the raw player state debounced, last value wins after 200 ms,
so quick flaps cancel out and the overlay never churns mid-playback.
The long initial buffering still shows it immediately.
Closes#17
The three home rows were capped: continue at six, subscriptions at
twelve, with no way to move past. Continue and subscriptions now page
in place — each new page fetches only its own entries (the continue
row's resume info costs one detail call per entry, so a page enriches
what it appends and never re-reads earlier ones; the "New videos" row
already paged). Rows stay lazy lists and the image cache is LRU, so a
user scrolling far does not pile up memory.
Closing the drawer without a selection (RIGHT, tap-outside, BACK) also
turned out to orphan the D-pad — the drawer's focused item left the
composition and nothing took its place; every later press died. The
closing now bumps a pulse the screens observe to re-focus the last
focused card.
Closes#18
The page knew little more than the display name. Between the identity
row and the video cards it now shows subscribers, the video count,
creation date and the owning user — all from the channel payload the
header already fetches, plus an owner/platform line and a short
description snippet. The per-channel detail response carries no video
count, so the paged list's first-page total feeds it instead of a
default zero.
Closes#14
Opening the menu landed focus on Home regardless of where the user was;
the sensible start is the item that already carries the selected state.
From there all other destinations are a D-pad step or two away.
The privacy tag sat next to the channel name — long names crowded it —
and its light-on-light colors became illegible the moment a card got
focus (white background). It moves to the last row (age · views) and
keeps a dark chip in both states. Views render as the channel card's
play icon + count instead of "1 view" text.
Closes#15
SmartTube keeps the focus in place when you press up on a list's first
row — the drawer popping was surprising ("why does the sidebar show up
when I go up"). The upToTopBar wiring that did it is removed everywhere;
the drawer stays reachable via LEFT at any row start, which is the other
half of the rule.
The adaptive grid resolves to exactly four cards on a full-width
landscape TV pane — but a portrait-mounted or otherwise narrow TV gets
fewer columns and the hardcoded row start broke there. Compute the
count with the same arithmetic Compose uses (pane padding minus card
minimum, integer division) so the drawer-from-row-start rule tracks
the real grid on every mounting.
The adaptive grid resolves to exactly four cards on the TV's fixed full-
width pane — index % 4 needs no layout probing and cannot be skewed by
spanned items. Measuring existed only to re-derive the constant.
LEFT from any card of a grid's first row opened the menu drawer. The
cells-per-row estimate read the width of the first visible grid item,
but near the top that is the page header, which spans the whole width —
so it computed one card per row and treated every card as a row start.
Skip full-span items when estimating; row starts resolve correctly even
while the header is on screen.
The 13-page listing only produced rows that were never rendered
(followed-instance groups had no UI consumer) and 12 of its pages were
spent finding locals already known. What the cards still show and the
video listing cannot carry — banners, exact subscriber counts — comes
from one per-channel call per local channel, in six parallel batches.
Zero-video local channels are no longer listed: they had nothing on
their cards anyway; the signed-in user's own channels stay complete
via the account listing.
Entering Channels walked thirteen 100-row pages of the all-channels
listing (1237 rows on this instance, most of them federated follows)
and re-sorted the rows after every page; the signed-in user's own row
only appeared at page 12, which read as "loading one channel after
another" and never kept icons visible above the fold.
The local video listing already carries what the cards show: paging its
few pages yields exact per-channel video/play counts, covers, channel
avatars and the owner accounts for the row headers — no per-channel
requests. The all-channels listing now runs behind it as a background
metadata refinement (banners, exact subscriber counts, zero-video local
channels, followed platforms) and rebuilds rows only when a group
actually changes, so the visible rows don't churn. Re-entering the
screen within five minutes repaints the kept rows untouched.
Closes#13
The action-row buttons lost their modifier in the icon-only rework and
became unfocusable, so D-pad DOWN off the paused seek bar landed nowhere
(requestFocus failed with "not initialized"). The modifier is attached
to the button again and the seek bar ↔ buttons directions are wired
explicitly, because the default focus search skips the bar.
Pill visuals use the new state language: no border, gray pill = focused,
red glyph = subscribed/rated; the sidebar panels keep the D-pad inside
their lists (consumed at the edges). BACK/Esc acts on ACTION_DOWN only —
its trailing UP saw the panel already closed and exited the video — and
panels return focus to the pill that opened them.
Playlist deletion is a requested scope addition: holding OK on a row
asks via a dialog (DELETE /video-playlists/{id}); the toggle moves to
key release so the hold cannot double-act. Holding also exposed an
activation bug: the CENTER helper consumed only ACTION_DOWN and the
release leaked into the underlying clickable — now consumed, repeats
swallowed, so Create (and the cards) fire exactly once per press.
An info panel shows the video description with clickable links: inline
(pointer) plus a focusable link row list (D-pad); PeerTube video and
channel links play/drill in-app, other links open the browser.
Closes#12
At 16dp bottom padding the glyph floated 3-4dp under the title baseline
and read as loosely attached; at 14dp the TV's bottom edge touches the
baseline so it reads as an object standing next to the text.
The overlay's spacing came out lopsided: 34dp between the seek bar and
the action row while the title/channel line sat tight, the first pill's
glyph ~50dp from the screen edge vs the 24dp-aligned text behind it, and
the time text at a different right margin than the track it belongs to.
Positioning recipe (measured on the emulator, cross-checked with a
second model): seek-row box 28dp with no horizontal padding so the track
spans the same 24dp margins as the text, action row 6dp below it, first
pill drops its start padding so the glyph aligns flush with the text
margin, time padded 3dp so its right edge tracks the rounded cap.
The stat icons now match the Channels view (Groups = subscribers,
PlayArrow = views next to the numbers), the overlay's subscribe became
Groups instead of the YouTube-notifications bell (the bell read as
notifications), and federated channels without an avatar get a
letter-circle fallback so the channel row keeps its shape.
The channels screen enumerated every channel and then fetched each
channel's stats strictly one after another, with a row rebuild and a
row re-save after every single one — with several dozen local channels,
each stat call walking up to four video pages, that took minutes.
Stats now fetch in parallel batches of six and are persisted alongside
the rows snapshot, so an existing install paints the channels screen
with full stats instantly.
Closes#9