Repository navigation
fix(bot-panel): show a browser bot's browser on a server, not an empty screen - #99
Open
PranitSakhuja wants to merge 1 commit into
Open
PranitSakhuja wants to merge 1 commit into
PranitSakhuja wants to merge 1 commit into
Conversation
…y screen Off this computer the Computer tab always drew the inline screen, which for a bot whose computer is its browser lands on the no-computer card while the bot browses on the server. Lead with the browser section there too, followed by the move to dusk cloud.
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.
What and why
On a paired server of your own (or dusk cloud), a bot whose computer is its browser showed nothing you could watch.
ComputerTabsetownScreen = !local || current === "vm", so any bot off this computer got the inlineComputerPanel. For abrowserbot that panel lands in its "no computer" branch, which offers to wake or add a computer, while the bot keeps browsing on the server and its tool lines appear in the chat.The browser itself already works from the server's page:
useLocalBrowserand the stream at/api/bots/<id>/browseruse the page's own origin, which is the server running the turn and owning the browser. So the panel only had to pick it.A bot now leads with its browser on a server when its computer is that browser, the same
LocalBrowserSectionthis computer uses. Every other server bot keeps its screen. On a server the section is followed by the existing move-to-dusk-cloud card instead of this computer's checkout card, so nothing the server's page offered is lost.askFirststays null off this computer, so the server's browser never asks for Mac permissions.Fixes #73 for bots set to their browser.
How it was checked
A new case in
src/components/BotSettingsDialog.simple.test.ts("the Computer tab") renders acomputer: "browser"bot with the window on a paired server. It asserts the browser section is drawn, with no inline screen, no "Scout's screen" caption, no Mac permission ask, and the move-to-dusk-cloud card after it. It fails onmain(no browser section) and passes with the change. The existing cases still pass: a cloud bot on a server leads with its screen, and a Private desktop bot on this computer still shows its screen.pnpm typecheck(app) passes andpnpm lintis clean.vitest run src/components/BotSettingsDialog.simple.test.ts src/components/bot-panel src/components/ComputerPanelpasses 342 of 344. The 2 failures are the routines-list cases inBotSettingsDialog.simple.test.ts(schedule wording), and they fail the same way without this change. Checked againstdev; the change applies unchanged tomain, which this targets.New behaviour has a test
No secrets, personal data or local paths in the diff
Notes for reviewers
LocalBrowserSection. Happy to follow up if you want that.ComputerTab.tsx. If it lands first, the server branch here should get the samestepsprop as the local one; the rebase is mechanical.