mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 12:00:37 +02:00
Apps without a banner or screenshot show their icon on a blurred wash of
itself, or a VR or app glyph, rather than a giant letter. Every card says
whether it will run on the Frame (works, should install, not checked yet,
won't run), in place of "Free" on every card.
The featured app isn't repeated in the rows below, and no row repeats
another. Its buttons stay in the app: Install on the Frame opens the details
with the install under way, and Details opens them. It's chosen from apps
that can run, with real artwork, VR first.
The stray "Browse SideQuest" link goes; the Sources dialog lists SideQuest
with a link to its website instead of a switch that did nothing. The "All
sources" drop-down goes too, as the Sources dialog already chooses them.
The copy is plain and British ("Apps and games for the Frame", no "Find
your next favorite"), and Games and Android point at each other.
Two functions were each declared twice across the page's scripts, so the
later one silently replaced the earlier everywhere: the store's details
dialog opened empty (the Devices tab's renderDetail ran instead), and Home's
Desktop view never found the headset's panels (the panel switcher's loader
ran instead). They're renamed, and a test
fails on any top-level name declared twice.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
23 lines
832 B
Python
23 lines
832 B
Python
"""The page's inline scripts share one global scope, so a second top-level function or
|
|
variable with a name already used replaces the first everywhere, silently."""
|
|
import collections
|
|
import pathlib
|
|
import re
|
|
import unittest
|
|
|
|
ROOT = pathlib.Path(__file__).resolve().parents[1]
|
|
|
|
|
|
class PageScripts(unittest.TestCase):
|
|
def test_no_top_level_name_is_declared_twice(self):
|
|
page = (ROOT / 'ui/index.html').read_text(encoding='utf-8')
|
|
names = collections.Counter()
|
|
for js in re.findall(r'<script>(.*?)</script>', page, re.S):
|
|
for m in re.finditer(r'^(?:async\s+)?function\s+(\w+)|^(?:const|let|var)\s+(\w+)\s*=', js, re.M):
|
|
names[m.group(1) or m.group(2)] += 1
|
|
self.assertEqual({k: n for k, n in names.items() if n > 1}, {})
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|