0.108.34: profiles, Who's watching, and the starry sky

Paul, 5 November 2026, from the approved design. Orbit asks Who's watching?
each time it opens: Kids (first, with Ollie) and Grown-ups. Grown-ups asks
for the PIN when one is set, and entering it also unlocks After Dark and
The Late Show. Kids sees only the channels ticked for it (Tots, Junior,
Wonder, PixelZ, ToonZ, Heroes, Rewind, Vortex, Terra and Wild to start)
across the guide, Home, What's On, Catch Up, channel up and down and the
number box; never After Dark or The Late Show; no Settings; the Arcade and
Drive-In as set for it (Arcade on, Drive-In off to start). A picture of who's
watching sits by the clock; OK on it goes back to Who's watching?.

Settings > Profiles holds the PIN, each profile's picture and Kids' channel
ticks and switches. Pictures: the cast (drawn in code, to the model sheet),
a football, fairy wand, rocket, crown, rainbow and paw print (drawn in
VectorCraft, design/profiles/pictures), and silhouettes in six colours.

The soft starry sky from the design now sits behind the whole app.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-11-05 23:08:32 +00:00
co-authored by Claude Opus 5.5
parent ffddf55b44
commit e8f4b80c42
15 changed files with 341 additions and 22 deletions
@@ -0,0 +1,34 @@
package tv.orbit.classic
import org.junit.After
import org.junit.Assert.*
import org.junit.Test
class ProfilesTest {
@After fun reset() { Profiles.current = null }
@Test fun profilesSurviveBeingSavedAndRead() {
val changed = DefaultProfiles.map { if (it.kind == ProfileKind.Kids) it.copy(picture = "wand", channels = setOf(TOTS_NUMBER, 611), arcade = false, driveIn = true) else it }
assertEquals(changed, Profiles.decode(Profiles.encode(changed)))
// A saved list without Grown-ups is never used: Orbit goes back to the two it starts with.
assertEquals(DefaultProfiles, Profiles.decode(Profiles.encode(changed.filter { it.kind == ProfileKind.Kids })))
}
@Test fun kidsSeesOnlyItsChannelsAndNeverAfterDark() {
val kids = DefaultProfiles.first { it.kind == ProfileKind.Kids }
val grown = DefaultProfiles.first { it.kind == ProfileKind.Grown }
assertFalse(profileHides(TOTS_NUMBER, kids)); assertTrue(profileHides(304, kids)); assertTrue(profileHides(AFTER_DARK_NUMBER, kids))
assertFalse(profileHides(304, grown)); assertFalse(profileHides(304, null))
assertTrue(AFTER_DARK_NUMBER !in KidsStartChannels)
// Kids watching locks After Dark and The Late Show, PIN or not.
Profiles.current = kids
assertTrue(AfterDarkLock.locked)
Profiles.current = grown
assertEquals(AfterDarkLock.pinSet && !AfterDarkLock.unlocked, AfterDarkLock.locked)
}
@Test fun everyPictureHasAName() {
assertEquals(18, ProfilePictures.size)
assertEquals("Fairy wand", pictureName("wand")); assertEquals("Pink", pictureName("sil-pink")); assertEquals("Ollie", pictureName("ollie"))
}
}