Skip to content

google_photos: a connect page that explains itself; -m stays up on micropython.exe - #144

Merged
bdbarnett merged 1 commit into
mainfrom
gphotos-ux
Sep 24, 2026
Merged

bdbarnett merged 1 commit into
mainfrom
gphotos-ux

Conversation

@bdbarnett

Copy link
Copy Markdown
Collaborator

The connect page now tells you what to do: scan with your phone, pick photos in Google Photos, tap Done, and this screen moves on by itself. A green line under the QR counts up (`Waiting for your picks... 0:07`) so you can see it's still listening. The buttons say what they do: Open on this PC (desktop only), New link, and Back. Back after PICK now puts your old list back. Before, it disappeared as soon as the new session arrived.

connect

I checked the layout with screenshots at 320x480, 240x320, 480x320, 320x240 and 800x480. Portrait panels stack everything, and landscape panels put the QR beside the text.

#143: one session per start, not two. I counted `create_session()` calls. With a mocked engine it's one on a fresh start, one on a start with a leftover session in prefs, one per PICK and one per New link. Against the real API it's one `POST /sessions` on each of two starts. The "second link" was the previous run's session, restored from prefs and printed when the page first drew, before the new one arrived. The page now waits for the new session instead of drawing the old one, and the link is printed once, when Google hands out a new session. Closes #143.

#142: micropython.exe -m exits after ~2 s. `_hostloop.batch()` can't read the command line on micropython.exe, because it decodes it with a `utf-16-le` codec MicroPython doesn't have (fixed at the root in PyDevices/pydevices#63). So the launcher also recognises `-m` from `sys.argv` on MicroPython, and holds with `multimer.auto.sleep_ms`. On main, `micropython.exe -m examples.google_photos` returns after 1.7 s. With this branch it was still up after 32 s and Windows reported `Responding: True`. Linux micropython and CPython still stay up. Closes #142.

One small fix on the side: the launcher no longer blanks `PYDEVICES_WIDTH`/`HEIGHT` when its own panel size is `None`, so `tools/screenshot.py --resolution` works on this example.

…by itself; -m stays up on micropython.exe

Connect page: three plain steps (scan, pick, tap Done - this screen moves on
by itself), a live 'Waiting for your picks... 0:07' line, and buttons that
name what they do: Open on this PC (desktop only), New link, Back. Back after
PICK now puts the old list back (engine.snapshot/put_back) instead of landing
on an empty one. Portrait stacks; landscape puts the QR beside the text.

The link is printed once per new session. A leftover session restored from
prefs is no longer drawn or printed while the new one is being created -
that was the 'second link' in #143; create_session runs once per start.

#142: micropython.exe can't read its command line on pydevices <= 0.5.0, so
the launcher also recognises -m from sys.argv on MicroPython.

The launcher no longer clears PYDEVICES_WIDTH/HEIGHT when its own panel
size is None, so screenshot.py --resolution works on this example.
@bdbarnett
bdbarnett merged commit 46e0b13 into main Sep 24, 2026
4 checks passed
@bdbarnett
bdbarnett deleted the gphotos-ux branch September 24, 2026 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant