Skip to content

feat(listen-together): explain a missing display name, add room QR codes and a room link - #2802

Open
invrnt wants to merge 2 commits into
maxrave-dev:devfrom
invrnt:feat/listen-together-qr-name
Open

invrnt wants to merge 2 commits into
maxrave-dev:devfrom
invrnt:feat/listen-together-qr-name

Conversation

@invrnt

@invrnt invrnt commented Nov 2, 2026 •

Copy link
Copy Markdown

What & why

On the Listen Together screen, Create and Join go grey until there is a display name, a complete code and a server connection, and nothing says which one is missing. Sharing a room in person also means reading the code out and typing it in. This fixes both:

  • Clear feedback: the display name is labelled Required. Create and Join stay tappable, and a tap with something missing marks the field, says what is missing and moves the cursor to the name.
  • Connects when needed: a tap while disconnected connects first and then carries on, because ListenTogetherSession.createRoom drops its message with no error when the socket is down. Only that wait disables the buttons.
  • QR codes: the host can show the room as a QR code. Android scans one with the camera, and Desktop reads one from an image file, since it has no camera API.
  • Room link: simpmusic://listen-together?code=XXXXXXXX opens the screen with the code filled in, so a phone's camera app can open a room. Pasting a link or the share message into the code field works too.
  • Crash fix (its own commit): a link that launched the app could reach the router in App.kt before NavHost had set its graph, which crashed with You must call setGraph() before calling getGraph(). The router now waits for the graph. I only saw this with the room link, on Desktop, and I can't say whether other links can hit it.

Decisions worth checking

  • Custom scheme, not https://simpmusic.org/app/…: simpmusic.org/.well-known/assetlinks.json redirects to www, which answers 404, and so does /app/*, so a camera app would land on a 404 page. The parser and router already accept the https form, so once the site serves it, moving over means changing listenTogetherLink().
  • A code or link only fills in the form, it never joins: it came from outside the app, and joining shows the user's name to that room. roomCodeFromText returns only a validated 8-character code, so a QR code can't open a page either.
  • The server isn't in the link: otherwise a QR code could point the app at any server. A code from a custom server therefore only works for people on that server, and the QR dialog says so.
  • Metrolist's share link is accepted in the scanner and the code field, since rooms are shared with that app.

Screenshots

Missing display name:

image

Room QR code (Arch):

image

Scanner (Samsung):

Screenshot_20261102_133626_SimpMusic Dev

Samsung camera opening the room:

Screenshot_20261102_133849_Android System

Size and scope

  • No new dependencies or permissions: CameraX, ZXing and CAMERA are already there for Login Sync.
  • Reused code: QrCodeImage moved out of Login Sync's Desktop dialog, and three Login Sync helpers and imageFileFilter became internal.
  • Strings: 14 new ones, in the base strings.xml only, for Crowdin.
  • Reading order: of the 1,395 added lines, 414 are the two generated icons and 139 are tests. The logic is in utils/ListenTogetherLink.kt and ListenTogetherViewModel.kt, and the crash fix can be read alone in the second commit.
  • Docs: CLAUDE.md has the changelog entry the repo's rule asks for.

Linked issue

Closes #2797

No maintainer has responded on #2797 yet, so the first box below is unticked. If you'd rather discuss the approach there first, that's fine.

Checklist

  • This PR addresses an accepted issue (linked above)
  • I wrote or personally reviewed every line of this change
  • I tested it on Android and/or Desktop (say which, and how)

Devices: Android on a Samsung phone (debug universal APK) and Desktop on Arch Linux (release build, as a tarball rather than the signed AppImage).

Tested by hand between the two devices:

  • Scanning a room's QR code inside the app on the Samsung
  • Opening the room link with the Samsung's camera app
  • Reading a QR code from an image on Arch
  • Joining a room for real, with playback staying in sync

After rebasing onto current dev: the hand tests ran on the build from just before the rebase, which only brought in upstream's commits. The rebased code built and passed on my fork: Android debug APK, Desktop release build, and 41/41 tests across the 14 new ones, SimpIconsFitTest and PromoSelectionTest. The Desktop build also launched from a room link on a virtual display with no crash.

Not tested: Windows, macOS, the vivo build, or camera apps on other phones. Whether a camera app offers to open a simpmusic:// code depends on that app.

I used AI assistance for this work. I reviewed every line and can answer questions about it.

…des and a room link

Create and Join no longer go grey over a missing name or code. They stay
live, and a tap marks the field, says what is missing and moves focus to the
name. A tap while disconnected connects first and then carries on, because the
session drops a create message with no error when the socket is down.

The host can show the room as a QR code. Android scans one with the camera and
Desktop reads one from an image file. A phone's camera app can open the
simpmusic://listen-together link. A scanned code or a link only fills in the
form and never joins by itself. Metrolist's share link is accepted too, since
rooms are shared with that app.
A link that launches the app could reach the router before NavHost had set its
graph, and navigating then crashed with "You must call setGraph() before
calling getGraph()". That is how a room link opens from a phone's camera app.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Listen Together: explain why Create/Join are unavailable, and share rooms with a QR code

1 participant