Repository navigation
feat(desktop): add a phone-friendly LAN WebUI companion - #2623
Merged
Merged
Conversation
Users want to keep working with the desktop's existing projects and sessions from a phone or another browser on the same Wi-Fi. This adds an off-by-default LAN listener in Electron Main with one-time-code pairing, per-device project/temporary scopes and chat/organize grants, and a phone-first page for browsing, creating, chatting and organizing. The edge only calls existing Desktop handlers and Agent Host turn admission under a non-owner principal, so tool approvals stay on the desktop. Organization edits reuse the sidebar backup as the single durable record and stay pending until the renderer acknowledges them, so a stale sidebar snapshot cannot undo them. Transport is plain HTTP by product decision; Host/Origin checks and CSRF tokens guard requests.
… projects apart replaceChildren() stringifies null, so every list and chat view rendered a stray "null" line from optional slots. Filter empty slots before rendering, and assert no placeholder text in the phone user-path test. Legacy folder-named projects frequently share a label (several "apps"), which made the phone list and the Desktop pairing checklist ambiguous. Repeated labels now carry their parent folder name, never the full path.
Move pairing and grant choices into focused dialogs so connection status and device access are easier to scan. Keep device identity when grants change, but reauthorize requests and live streams under the new scope.
Make device confirmation the only project access decision so pairing works without a project checklist and new local projects stay visible. Keep Temporary, Chat and Organize as separate grants and refuse stale per-project approvals instead of widening them.
Treat the locally generated one-time code as the WebUI access decision. Remove pending approvals and per-device grants while keeping device revocation and the existing local workspace and Agent boundaries.
Normalize pasted codes and reject duplicate submits without consuming extra pairing attempts. Distinguish an older service or a blocked session cookie from a bad code. Provide a local QR and copy action without sending pairing data to an external service.
Limit the full-page overlay styles to an open action sheet. The author flex rule otherwise overrides hidden and intercepts taps. Exercise the browser hit target before activating controls so the workflow catches an overlay that obscures the page.
… system The phone companion used its own blue-accent, bordered look, so it read as a different product from the desktop it controls. It now mirrors the Desktop tokens: neutral monochrome palette, divider-free tonal tiles, stroke and shadow only on floating layers, Lucide icons, and the shared radius, type and motion ramps. Light or dark follows the phone setting. Phone ergonomics improve alongside: a thumb-reach New conversation capsule, a floating composer pill with icon send/stop, rename inside the action sheet instead of a native prompt, and per-list scroll restore on Back. Live refreshes now keep the focused field, caret and text, which also fixes search input losing focus while typing. Screen readers hear run-state changes instead of every list refresh. The browser user-path test covers in-sheet rename and focus-stable search.
The phone made people walk Projects -> Sessions to get back to work they had just left, showed answers as raw Markdown, and offered several equal actions at every step. Home now leads with Recent conversations across projects (running work always listed), one search covers projects and conversation titles, and archived items sit behind a single Archived entry instead of a sticky filter. New conversation from Home asks only where it should live; disconnecting asks for confirmation. Conversations render a safe Markdown subset (DOM only, no HTML, no remote images, http(s) links only), fold consecutive tool calls into one step summary, and offer Copy on code blocks and on the last answer of each exchange. A sent message appears at once and yields to the Host record; a failed send returns the text to the draft. The composer shows Stop alone while a reply runs until text is typed, a working cue fills the gap before streamed text, and Jump to latest appears when needed. GET /v1/sessions without projectId lists every visible scope, and each session carries an optional projectLabel, so cross-project rows and deep links name their project. Browser and HTTP user-path tests cover the new flow, the recent list and the Markdown renderer's edge cases.
Keep the chosen binding and unexpired browser pairings across routine Desktop restarts, without persisting reusable cookie values or treating explicit disablement as a restart.
Phone users can choose a saved chat model before sending without leaving their conversation or losing a draft. Reuse the Desktop catalog filters and the Host-owned session binding rather than sending provider configuration to a browser or adding a separate per-message model override. Keep selection limited to eligible idle sessions and reject a stale selection at the Host so a second client cannot overwrite a newer model or mode.
Preserve the existing LAN WebUI commits while bringing the request branch onto the current remote base. The request branch remains isolated from local main.
Keep the complete LAN WebUI change set clean when reviewed against main.
The Host now checks its revision index before archiving an active branch. Revision metadata on a prompt alone no longer satisfies that precondition. Exercise the real truncate and restore path before checking live references and branch round-trips, without weakening the existing assertions.
Deploying pi-desktop with
|
| Latest commit: |
eb3d2cf
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4f451bb1.pi-desktop.pages.dev |
| Branch Preview URL: | https://feat-lan-webui-model-picker.pi-desktop.pages.dev |
The plain JavaScript job does not install an Electron executable. Move the unchanged browser suite to the existing Electron and Xvfb job rather than skipping its checks or requiring a display for the unit-test job.
Owner
Author
|
Updated candidate: |
Worker message delivery can span more than two event-loop iterations on a loaded CI runner. Use an explicit overlap gate so the test observes concurrent reads rather than assuming the timing of their delivery.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Task-candidate validation
cbccfaacd; base:8d686c28a; isolated macOS Electron/Host fixtures.