Skip to content

v0.2.1 — folded steps, Enter to send

Choose a tag to compare

@NiKrause NiKrause released this 31 Jul 22:40
efaa509

A demo-only release. The published package is unchanged@le-space/libp2p-webrtc-qr@0.1.0 remains current on npm.

Live: https://webrtc-qr.le-space.de

The setup steps fold away once connected

Steps 1 and 2 are finished business the moment a connection exists, and on a phone they pushed the only useful part — sending things — below the fold. They now collapse to their headings as soon as a chat stream attaches, and the message field takes focus.

Folded, not gone. The heading stays, reads "done — tap to reopen", and brings the step back for anyone who wants to connect to someone else. It is keyboard-operable and reports its state through aria-expanded. If the stream closes, the steps unfold by themselves — connecting is then the only thing left to do.

Enter sends

Next to a single-line field with a Send button, pressing Enter is what everyone tries first, and nothing happened.

Fixes a banner that was visible on every page load

display: flex on the handoff banner overrode the user agent's [hidden] { display: none }, so an empty box with a status dot sat above the page from the first paint. It shipped in v0.2.0 and was live until now.

It was found by screenshotting the collapsed state rather than trusting a green suite: all 72 tests passed while the bug was plainly on screen, because nothing had ever asserted the banner's resting state. A spec does now.

Tests

72: 18 unit, 48 browser across three real engines (2 skipped on Linux WebKit, which has no WebRTC), 6 Helia. Three specs are new — the fold-and-reopen cycle, Enter-to-send, and the banner's resting state.

One existing spec changed: the QR decode assertion is polled rather than read once. Decoding a dense code off a canvas occasionally catches a frame that has not finished painting, which surfaced as a one-off WebKit failure that would not reproduce in isolation — it passed 3/3 alone. Polling does not weaken it; a QR with the wrong contents still never matches.

Full changes in #19.