Repository navigation
feat(desktop): what each bot does on the desktop, live, and stopping it - #175
Merged
Merged
Conversation
The daemon part of D3 (spec 24.9): - Each bot's DesktopState, in memory: the window it read or acted in last, its last action as the tool said it, when, and whether the owner stopped it; every reading, picture and action updates it and sends desktop.changed. - desktop.watch and desktop.unwatch: while a connection watches a bot, its window is pictured four times a second and desktop.frame goes out only when the picture changed, only to that connection, newest first, like the browser's frames. The picturing stops with the last watcher. - desktop.stop and desktop.resume: a stopped bot's desktop tools refuse, again after waiting for the owner or for its turn, until the owner lets it go on; an action under way ends within its 5 seconds. - Ctrl+Alt+End, registered by the daemon on a thread with its own queue, stops every bot on the desktop, app open or not; when another program holds it, the daemon logs it and goes on. The window and setup of the desktop tests move to tests/common, and the event-to-notification mapping out of rpc/mod.rs, which had reached 300 lines. FakeBotloft plays the new methods.
…ds a reading for minutes DesktopState.action is now structured (DesktopAction: click, type, select or scroll, the control's name and the option), so the app words it in the owner's language instead of showing the tool's English. Every UI Automation session, reading too, gets 5 seconds per call and to connect, and a walk stops at 15 seconds with what it read: right after a classic combo box took a choice through its default action, the window could answer slowly, and the next reading, without a limit, hung for minutes. The choice and scroll test waits up to 2 seconds for the window to show them, as the tool does; 12 runs in a row pass.
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
The daemon part of D3 (spec 24.9). The app's panel comes next, in D3b.
Each bot's
DesktopState, kept in memory:DesktopAction(click, type, select or scroll, the control's name, the option), so the app can word it in the owner's language;Every reading, picture and action updates it and sends
desktop.changedto all apps.Live picture.
desktop.watch {botId}returns the state and the newest picture.PrintWindow).desktop.framegoes out only when the picture changed, and only to that connection, newest first, like the browser's frames.desktop.unwatch, anotherdesktop.watch, or the connection closing).Stopping a bot.
desktop.stopanddesktop.resumemark a bot as stopped or let it go on.Ctrl+Alt+End. The daemon registers it on startup, on a thread with its own message queue, and it stops every bot on the desktop even with the app closed. If another program holds the shortcut (a dev daemon, for example), the daemon logs a warning and goes on without it.
Time limits. Every UI Automation session, reading too, now has 5 seconds per call and to connect, and a reading stops at 15 seconds with what it has.
Housekeeping:
tests/common/desktop.rs;rpc/notify.rs, sincerpc/mod.rshad reached 300 lines;FakeBotlofthandles the new methods.Spec 24.5, 24.9 and 24.12 are updated.
Checks
cargo fmt,clippy -D warningsandpnpm checkpass.cargo test --workspacepassed once the time limits were in.tests/desktop_panel.rs:desktop.changedcarries the window and adesktop.framearrives;stop_all, which the shortcut calls, stops everyone.Manual check on the real app
With a bot using a window, press Ctrl+Alt+End. The bot's next desktop tool should say the owner stopped it.