Commit graph

66 commits

Author SHA1 Message Date
52a0ba8fb9 loading: shimmer placeholders on every list screen
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
2026-10-14 00:53:26 +00:00
4156704ffe build: sign the release variant with the debug key
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.
2026-10-14 00:53:05 +00:00
05bcc55aac loading: placeholder cards with a faint shimmer; thumbnail while buffering
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.
2026-10-14 00:26:26 +00:00
b2601bb0c0 player: debounce the buffering indicator
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
2026-10-14 00:20:50 +00:00
33abf61cd1 home: rows grow on demand; refocus content when the drawer closes
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
2026-10-14 00:18:57 +00:00
1f8616d26f channel page: metadata strip between header and videos
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
2026-10-14 00:09:15 +00:00
44a39b83e9 drawer: open focused on the current destination
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.
2026-10-14 00:02:40 +00:00
6d1cc8986a cards: privacy badge in the meta row, views as icon
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
2026-10-14 00:02:40 +00:00
f0031d25c8 lists: don't open the drawer on UP
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.
2026-10-13 23:37:29 +00:00
64a01d8ca2 lists: derive cards-per-row from screen and card width
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.
2026-10-13 23:33:06 +00:00
effc2bd9ae lists: constant cards-per-row instead of measuring the grid
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.
2026-10-13 23:24:12 +00:00
ec2b1f03b1 lists: measure a card, not the header, for cards-per-row
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.
2026-10-13 23:17:03 +00:00
710a0f23cc channels: drop the all-channels listing walk
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.
2026-10-13 23:03:58 +00:00
29dee24849 channels: build the local rows from the video 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
2026-10-13 14:25:31 +00:00
f5b37dd21d player: wire the D-pad through the action row, panels and playlist deletion
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
2026-10-13 14:25:21 +00:00
c70d98ac64 home: Drop the logo 2dp more for balance
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.
2026-10-13 09:26:35 +00:00
3d4de90671 player: Align the controls overlay; consistent stat icons
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.
2026-10-13 08:29:43 +00:00
3d5fd44a59 channels: Parallelize stats and persist them
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
2026-10-13 08:29:43 +00:00
01c08e1dbb player: Icon-only action row
Bell, thumbs, chat bubble and playlist icons instead of text labels —
no translutable strings in the action row; labels live on as
contentDescription for accessibility. Like/dislike get proper icons
instead of emoji text with the count as a digit next to them.
2026-10-13 07:51:44 +00:00
4af904bf2a home: Nudge the logo below the text baseline
On one baseline the glyph looked like it was sinking into the title;
1dp lower matches how the launcher icon sits next to text.

Closes #11
2026-10-13 07:45:17 +00:00
9ca65c121b player: Action row with subscribe, rating, comments and playlists
SmartTube keeps its action buttons under the seek bar — we had nothing.
The paused/controls overlay gained: subscribe (POST /users/me/
subscriptions with the channel URI, state via the bulk exist endpoint),
like/dislike with immediate count and fill feedback (PUT /videos/{uuid}/
rate), and right-sidebar panels for comments (GET /videos/{uuid}/
comment-threads, paged, read-only; the instance has comments disabled on
some videos, which surfaces as a friendly empty state) and playlists
(checkboxes add/remove the video via the playlist-elements endpoints, a
text field creates new ones). Opening a panel shrinks the video so it
stays fully visible on the left; BACK or LEFT closes again.

Two server quirks are handled: the subscription exist-check settles a
moment after the POST (optimistic update + delayed re-verify instead of
trusting an instant answer), and this emulator translates CENTER into
the platform click as well, so a single press could subscribe and
instantly unsubscribe — activation is now guarded per request.

Closes #10
2026-10-13 07:45:17 +00:00
9f1c6d54c1 cache: Show the last session's lists instantly at cold start
Opening the app (especially the Channels screen) waited for the API and
then for every image before anything painted. JSON list snapshots now
live in cacheDir: on the next start the last loaded page paints
immediately, then the load that runs anyway silently replaces the first
page with fresh data, so stale content can never stick (issue asks
exactly for that show-cached-revalidate behavior). Logout wipes the
snapshots because they contain account-private listings; History and
Search results are never snapshotted. Thumbnails were already
disk-cached by Coil (the instance serves them with a one-year max-age).

Closes #9
2026-10-13 07:45:17 +00:00
fdc570ac9e home: Title bar with account and channel pages
The header-removal experiment went too far: the app now has a slim
persistent title bar — logo + "JTube TV" on the left (it anchors the
layout while the drawer is open), avatar + display name on the right as
a purely visual indicator so it never steals D-pad focus. LEFT from the
first card of every row opens the drawer (the subscriptions row silently
skipped it, and the grid only wired the very first item), and UP no
longer surprises by opening anything.

The channel page that the Channels screen and the player's channel icon
point at never actually rendered — ListSource.Channel, its repository
call and the header state all existed without a UI. Videos of one
channel now open as a grid with banner, avatar, name and handle; page
headers (search field, channel banner) live inside the grid so they
scroll along instead of stacking under the cards.

Closes #7
2026-10-13 00:05:30 +00:00
a6dff3435d player: Own the controls UI end to end
Space and Enter now toggle playback while playing (the remote OK always
did), and the native PlayerView controller is switched off completely:
hovering the video with a mouse revealed the old play UI with skip
buttons and a settings gear, which must never appear. Our SmartTube-style
overlay is the only controls surface — persistent when paused, shown
transiently for 5 s while playing — with the transport icon row dropped,
position/duration in one style right of the bar, the absolute published
date under the title and a clickable channel icon that opens the
channel's video page.

The loading indicator now tracks the player's real buffering state
(STATE_READY) instead of ending with metadata resolution, so the window
is never black without an indicator. Closes #8
2026-10-13 00:05:19 +00:00
15a481b7c0 profile: Fetch the user profile on every app start
The login flow stored displayName/avatar inside one swallow-all try that
serverConfig() also had to survive first, and /users/me carries both in
its nested account object on current PeerTube versions (verified live
against 8.3.1) — so stored sessions kept showing the raw username and no
avatar. The profile now refreshes after login and whenever an existing
session starts, and the relative avatar fallback no longer points into
/api/v1.
2026-10-13 00:05:10 +00:00
a71de07969 emu: Stop silent early exits in the emulator start script
The script's set -euo pipefail made it die without any visible error in
two places: an empty /tmp/jtube-adbkeys/ failed the glob cat (the error
itself was discarded, so the output just stopped mid-script — this hits
any host after a reboot), and the boot-wait loop was killed on its first
iteration because adb exits non-zero while the device is still booting.
Both were swallowing the whole && chain (adb connect, scrcpy), making it
look like the emulator was broken when it was fine or about to be.

The stale bridge-emulator.sh duplicate (different port, broken vendor
keys path) is removed in the same spirit — keeping it invites running
the wrong script. Docs updated to match the one script.
2026-10-13 08:14:15 +09:00
c19024355c player: Usable D-pad controls when paused
The paused state was unusable (#4): the semi-transparent info overlay
covered the seek line, and the key handler kept owning CENTER/LEFT/RIGHT
(they toggled/seeked directly), so the transport buttons could never be
selected at all.

Replace it with a SmartTube-style pause screen: a big seek bar above an
info bar (never covered again — the panel below it is near-opaque) and
focusable Back 10 s / Play / Forward 10 s buttons. While paused the
arrows pick a control and OK activates it; the bar itself scrubs ±10 s
with arrows and OK starts playback. Focus moves into the overlay on
pause (Play button) and back to the plain key handler on resume, so
while playing, OK still toggles pause and LEFT/RIGHT still seek.

Refs #4
2026-10-12 09:54:58 +00:00
1c8fff7eca home: Make the "New local videos" row reachable by DOWN
On the TV, DOWN from "Continue watching" often skipped the row below
and landed on "New from your subscriptions": the new-videos row is
rendered as a non-focusable "Loading…" while its items are still in
flight, and every FocusScrollRow auto-focused its first card when its
items arrived, so rows loaded out of order stole focus in a race.

Start fetching new local videos eagerly with the rest of the home data,
restrict the load-time auto-focus to the first row only, and cancel it
when the user has already pressed a D-pad key meanwhile. Also rename
the row to "New local videos" to distinguish it from the federated
subscription feed.

Refs #3
2026-10-12 09:49:15 +00:00
20e6b07107 subs: Show the subscription feed as one paged video grid
Jeena wanted subscriptions to behave exactly like My videos — a single
plain video list paged on scroll — instead of the SmartTube-style
per-channel rows, which felt noisy when many channels are subscribed.
The plain grid path already existed in VideoListScreen, so switch the
Subscriptions destination over to it and drop the rows screen.

Refs #5
2026-10-12 09:47:18 +00:00
3635a4ed74 home: Restore row focus when returning from the player
BACK from a video dropped the user on a random spot (often the search
screen, #2): the restore token was only bumped when it was already >= 1,
so the very first back never re-focused anything, and HomeRowsViewModel
refresh() cleared the continue-watching rows synchronously, disposing
the rows before their focus-restore effect could run. Bump the token on
every playing -> not-playing transition and keep the rows alive during
a refresh instead.

Refs #2
2026-10-12 09:42:09 +00:00
40a9d1e2c6 docs: Agent container emulator workflow
Document how the host emulator is driven over adb from the agent
container: the start script now boots headless by default and trusts
remote adb keys via ADB_VENDOR_KEYS at launch, since the TV system
image is a user build that blocks pushing keys to adb_keys after boot.
AGENTS.md points to the new doc and fixes the stale SDK path.
2026-10-12 09:42:08 +00:00
ed65b77e90 player: Pause and mute out when the app goes to the background
Pressing HOME kept the audio running, so a video started in another
app played on top of it and returning landed on the home view with an
invisible player. The player now pauses itself on ON_PAUSE, reports
the position to the server and resumes automatically when the app
comes back. The playing screen is also kept across activity
recreation now, so returning shows the video, not the home view.

Ref #6
2026-10-12 03:23:34 +00:00
a5d88aeea1 docs: Real screenshots
Replace the placeholder-content screenshots with a demo instance that
serves real CC-licensed open movies (Blender Foundation, framatube),
so the app looks like what it is: a video player with real thumbnails,
real durations and real playback.
2026-10-12 03:06:15 +00:00
344a211d72 player: Fix vertical videos stretched to full screen
On the HiMedia/Amlogic TV the video renders through the vendor video
plane, which scales the decoded stream to the whole panel and ignores
the letterbox geometry AspectRatioFrameLayout lays out for the
SurfaceView. Portrait videos therefore filled the screen instead of
being letterboxed; on emulators the same code was correct.

Render the video in a TextureView instead: it lives in the normal
view tree, so the aspect ratio is honored on every device. Verified
on the HiMedia box (vertical short letterboxed, landscape fills the
screen as before) and on the emulator.

Closes #1
2026-10-12 02:48:11 +00:00
116b6926e4 docs: README for humans, with logo and screenshots
Rewrite the README around what a user sees: what the app is for, how
the screens look and what to press. Add the logo, five screenshots
taken against a local mock PeerTube instance with placeholder content
(no private media), and a debug-only manifest that allows plain HTTP
so those mock instances work.
2026-10-12 01:18:02 +00:00
669c4af359 license: Adopt GPL-3.0-or-later
Decide on the license before the source is shared publicly: GPL v3
keeps forks and improvements of this app free software too.
2026-10-12 00:41:17 +00:00
0cebe3b710 docs: Remove the test account name from the public repo
The account name identifies a real, seeded account on the instance;
the public source doesn't need it to make sense. Credentials were
never in the repo and still live only in sops.
2026-10-12 00:33:42 +00:00
89c1a13b8b docs: Drop instance-specific storage-security notes
The public repo must not document this instance's object-storage
access-control posture; findings like that belong in private ops
notes. The engineering guidance (never rely on URL obscurity, always
request file tokens) stays.
2026-10-12 00:27:08 +00:00
5a78849a9e ui: Use the JTube TV logo for the launcher icon and TV banner
Replace the placeholder red play-square with the real logo (the
orange TV from https://jeena.net/jtube-logo.svg) converted to vector
drawables. The old placeholder still lives on in git history; the
launcher now matches the website branding.
2026-10-12 00:26:47 +00:00
7584730646 channels: Show a banner and harden D-pad activation
Channel pages now load the channel record itself and use the newest
video's thumbnail as a banner fallback, so channels never render
without a header image. Focus cards in re-sorting rows only hand out
initial focus once per screen visit so streaming stats can't steal
focus mid-navigation.

D-pad activation now also accepts ENTER/NUMPAD_ENTER/SPACE, matching
how the Compose platform fires clickable cards; consuming in the
preview phase keeps OK from double-activating.
2026-10-12 00:26:47 +00:00
28f0751e48 scripts: emulator-seed.sh — seed a fresh emulated device with the test account 2026-10-11 07:47:06 +00:00
b8893172d4 ui: CENTER activates everything (clickable lacks DPAD_CENTER)
Compose clickable handles Enter/Space only; whether the TV's OK
(DPAD_CENTER) triggers click depends on the device's input stack -
worked on the API-36 host emulator, dead on the API-34 ATD and
possibly some TVs. A preview-tunnelled center handler now activates
drawer items, top-bar buttons, video and channel cards, and the
login/search buttons deterministically, exactly once (preview
consumption prevents the platform path from double-firing).
2026-10-11 07:44:35 +00:00
d469101eb0 ui: Explicit UP from first content row to the top bar
Focus search silently failed to move from the first content card up to
the top bar (why the menu felt unreachable); the first row's cards now
have a wired UP target (the search button) in rows and grids.
2026-10-11 07:31:18 +00:00
828bfdafa9 ui: BACK = up the hierarchy (channel->channels->home->exit guard)
The BACK-opens-drawer behavior made navigation loops with the drawer
focus restore; replaced with the TV-standard: BACK leaves the player,
closes the drawer, leaves a channel drilldown, or goes Home; from Home
it is the double-press exit guard. Drawer opens via the account
button / LEFT on a leftmost card.
2026-10-11 07:28:19 +00:00
d55c265469 channels: Render rows early (pages only), guard rebuild, Long-safe sort keys
The channels screen waited for every listing page AND all per-channel
stats before showing anything - a 40s+ blank spinner. Rows now render
per page (unsorted), re-sorting as stat batches arrive. rebuildRows is
guarded; the earlier ClassCastException (Integer into a Long
comparator) surfaced via the sort call and can no longer abort the
app. All sort keys go through Long-typed helpers.
2026-10-11 07:01:27 +00:00
8d21cf35ec ui: Fix drawer focus-eater + BACK/RIGHT/LEFT menu affordances
The drawer's tap-to-close scrim was focusable: LEFT/RIGHT from a
drawer item moved focus onto the invisible fullscreen scrim, and OK
mysteriously dismissed - the drawer felt un-navigable. Scrim is no
longer focusable; RIGHT (from the drawer) closes it and BACK closes
it; closing restores focus to the search button. LEFT on any row's
leftmost card opens the drawer (used to be only the first row).
Banner prefetch keys now match the render keys (480x270) so channel
banners stop reloading on focus movement.
2026-10-11 06:45:56 +00:00
f5535eec3f ui: All list screens use home-style 4-per-row card size
Grid screens (My videos, History, Search, channel pages) switch from
3-column to adaptive columns sized exactly like the Home rows' cards,
with the compact single-line title, so every screen reads the same.
2026-10-11 06:13:59 +00:00
b3b39976fe channels: Per-user rows, empty-channels row, redesigned stats card, subs detail
Channels now render as SmartTube rows and scroll vertically
(LazyColumn - the unscrollable Column hid rows 2+). Local channels
group one row per ownerAccount, sorted by total video count, with all
zero-video channels merged into a final 'No videos yet' row.
Followed-instance channels group per platform. The channel card
matches the video-card language: banner center-cropped, round avatar
bottom-left, channel name, 'owner display name - platform display
name' (instance names via /config, local cached at login; no domain
strings), and an icon stat line (videos | subscribers | plays); counts
load per channel in the background since the listing endpoint doesn't
carry them (verified on the live API).

Subscriptions destination switches to per-channel rows, matching the
Home card size.
2026-10-11 05:42:02 +00:00
5ea1ca5124 ui: Fix recompose loop during scroll (2fps vertical)
Focus requesters were stored in snapshot-state maps and written during
composition of every list item: each write invalidated the reading
scope, which recomposed the (whole page of) items, wrote again, ...
This feedback loop is why vertical scrolling ran at ~2fps on the TV
while the same build scrolled fine in the emulator's short bursts.
Plain HashMaps kill the loop - focus handling needs no recomposition.
2026-10-11 05:17:12 +00:00
f7273121ae ui: Real account button (avatar + display name), stable list keys
The top bar now mirrors SmartTube: a 44dp circle with the actual user
avatar (persisted at login alongside the display name; falls back to
the person icon) and the display name next to it.

Scrolling jank: add stable keys to grids and rows (item/channel ids)
- without keys Compose rebinds the whole list during scroll and
re-fires every AsyncImage + focus request, which is the realistic
culprit for the 2fps vertical scrolling on the TV.
2026-10-11 05:14:32 +00:00