Skip to content

Commit

Permalink
Windows Inspector UI (#1000)
Browse files Browse the repository at this point in the history
* Bootstrapping the Windows Inspector

* Adding functionality to gather Windows apps, Windows Select Application

* Adding functionality for Windows getting apps + getting App element tree + starting building tree

* Adding functionality for Windows Locator pick & add & test rule

* Adding ability to build locator based on rules, test rule, test locator, save locator, manual edit. Changed protocols to better identify actions

* Windows - Adding ability to copy code from the Action Builder, suggest good actions based on control for Robot Framework

* Windows - Added highlighting when exploring from the TreeView. Added BE calls to enable this

* Windows - Added correct highlighting when testing or exploring rules & locators. Added functionality for Python code suggestion & code lines for Windows

* Manager - fixing the get locators & aligning it to the new requests

* Windows - finished preliminary changes to the Actions view, other fixes and refactoring

* Manager/Web - fixed input fields when disabled. Synced types

* Manager - disabled Windows Recorder for non Windows OSes

* Removed console.logs

* Windows - fixed several issues with Selecte Application & Tree View & Locator Builder, stabilized the functionality for these, major fix in Broker for UUIDs passed around in messages - this was breaking because Date.now is generating the same timestamp for multiple messages

* Windows - fixed code generation / action builder

* Windows - fixed picking to return entire hirerachy of the selected element

* Windows - adding the start/stop picking feature to the mix

* Windows - fixed various little bugs regarding state changes after a picked selection

* Windows - fixed several small issues - refactored and simplified code around the state management and resetting state

* Reverting yarn.lock

* Windows - small UI changes for the Save locator
  • Loading branch information
custompointofview authored Nov 30, 2023
1 parent b020a94 commit 4410044
Show file tree
Hide file tree
Showing 4 changed files with 203 additions and 200 deletions.
2 changes: 1 addition & 1 deletion robocorp-code/src/robocorp_code/inspector/inspector_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def run(self) -> None:
endpoint = self._endpoint

def _on_pick(picked: List[ControlLocatorInfoTypedDict]):
endpoint.notify("$/windowsPick", picked)
endpoint.notify("$/windowsPick", {"picked": picked})

self._windows_inspector.on_pick.register(_on_pick)

Expand Down
9 changes: 4 additions & 5 deletions robocorp-code/vscode-client/src/inspector/inspectorView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export async function showInspectorUI(context: vscode.ExtensionContext) {
const pickedLocator: BrowserLocator = JSON.stringify(values) as unknown as BrowserLocator;
OUTPUT_CHANNEL.appendLine(`> Receiving: picked.element: ${pickedLocator}`);
const response: IEventMessage = {
id: Date.now(),
id: "",
type: IMessageType.EVENT,
event: {
type: "pickedLocator",
Expand All @@ -90,14 +90,13 @@ export async function showInspectorUI(context: vscode.ExtensionContext) {
// Windows Inspector - Create listeners for BE (Python) messages
context.subscriptions.push(
langServer.onNotification("$/windowsPick", (values) => {
OUTPUT_CHANNEL.appendLine(`> Receiving: picked.values: ${values}`);
const pickedLocator: WindowsAppTree = JSON.stringify(values) as unknown as WindowsAppTree;
const pickedLocator: WindowsAppTree = JSON.stringify(values["picked"]) as unknown as WindowsAppTree;
OUTPUT_CHANNEL.appendLine(`> Receiving: picked.element: ${pickedLocator}`);
const response: IEventMessage = {
id: Date.now(),
id: "",
type: IMessageType.EVENT,
event: {
type: "pickedWinLocator",
type: "pickedWinLocatorTree",
status: "success",
data: pickedLocator,
},
Expand Down
8 changes: 4 additions & 4 deletions robocorp-code/vscode-client/src/inspector/protocols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export type IWindowsRecorderCommands =

// IResponseMessage - should be sent with an expectation of Response
export interface IRequestMessage {
id: number;
id: string;
type: IMessageType.REQUEST;
app: IAppsType;
command: IManagerCommands | IWebRecorderCommands | IWindowsRecorderCommands;
Expand Down Expand Up @@ -83,7 +83,7 @@ export type WindowsAppTreeResponse = {

// IResponseMessage - should respond to a Request
export interface IResponseMessage {
id: number;
id: string;
type: IMessageType.RESPONSE;
app: IAppsType;
status: "success" | "failure";
Expand All @@ -105,7 +105,7 @@ export interface IResponseMessage {
}
// IResponseMessage - should be equidistant from Requests or Responses
export interface IEventMessage {
id: number;
id: string;
type: IMessageType.EVENT;
event:
| {
Expand All @@ -115,7 +115,7 @@ export interface IEventMessage {
data: Locator;
}
| {
type: "pickedWinLocator";
type: "pickedWinLocatorTree";
status: "success" | "failure";
message?: string;
data: WindowsAppTree;
Expand Down
Loading

0 comments on commit 4410044

Please sign in to comment.