A phone as the TV remote, with voice search
When the deals map first went full screen on a TV, a phone became the remote. Say a building’s name in Indian English, and a fuzzy matcher allows for the syllables the recogniser mis-hears.
The problem
A full-screen map on a TV needed a way to find one building by name from across the room.
The solution
A phone page sends voice searches over Supabase Realtime, and a fuzzy matcher finds the building.
In July 2026 the deals map got a full-screen TV mode, and with it a question the desktop version never had to answer: with the map on a TV across the room, how do you find one building by name? My answer was a phone. I built it with Claude Code.
Kiosk mode
One button switches the map to kiosk mode. The sidebar goes, open menus close and the map resizes to fill the screen. Adding ?tv=1 to the address opens the page straight into it, so it can be AirPlayed or opened in a TV browser with nothing to click.
One channel, two screens
The remote is a small web page opened on a phone. It and the map join the same Supabase Realtime channel and use two of its features:
- Broadcast carries commands from the phone to the TV, and results back.
- Presence tells each side who’s there. The phone reads “Waiting for TV…” until a map joins as the TV, then “TV connected”. The TV shows a toast when a phone pairs.
The phone is deliberately thin. It doesn’t search anything itself: it sends what it heard, and the TV runs the same matcher as its own mic button. Below the mic, a D-pad pans and zooms the map, resets it to Mumbai, closes the building card and toggles TV mode.
// phone → TV
{ action: 'search', q: 'what it heard', alts: [/* up to 4 guesses */], id }
// TV → phone
{ ok, label, q, suggestions, id }
The id earned its place. On a broadcast channel every map page answers, and an old map tab left open from a test stays connected and replies to every command too. Its late answer could overwrite the real one. So the phone ignores any reply that isn’t for its latest search.
Hearing names in Indian English
Voice uses the browser’s own speech recognition, set to Indian English (en-IN). The phone shows the words as they’re heard and asks the recogniser for up to 4 guesses at what was said. All of them go to the TV, every building is scored against each guess, and the best score wins.
Building names still get mis-heard, and an exact lookup fails on one wrong syllable. So the matcher works in tiers:
- Close text matches. An exact match scores 100, one name starting with the other 88, one containing the other 68. Words in common score 22 each, up to 55.
- A fuzzy fallback. Edit distance counts the single-letter changes that turn one string into the other. About 77% similar is enough to fly the map to the building; a weaker match can only be suggested.
- Common words count for less. Building names often start with the developer’s name, and that word alone can’t say which one you meant. The matcher counts how many buildings each word appears in, and a fuzzy match on a word shared by 3 or more is capped below the jump line. It can suggest; it can’t decide.
Sure, or not sure
If the best score clears the line (28 out of 100), the TV zooms in, centres the building and opens its card, and the phone says “Found”. If not, the TV says there’s no project by that name, and the phone shows up to 3 “Did you mean” chips: the closest names the map actually has. Tapping one runs that search, so a near miss costs a tap, not a second try at the name.
Where it went next
The phone remote was the deals map’s first answer to the TV; it later grew into the showroom TV app, driven by the TV’s own remote, which brought problems of its own: building for a 2 GB TV and a remote with no pointer.
What I’d keep
- Use the device in people’s pockets. A phone already has a microphone and a touchscreen.
- Keep the remote thin. One matcher on the TV serves the phone and the TV’s own mic.
- Ask for several guesses. Score every alternative the recogniser offers, not just its favourite.
- Use two thresholds. Jump when sure, suggest when not.
- Tag every request. On a broadcast channel, anyone can answer.