Skip to content

Commit 0b3cf3a

Browse files
authored
Revert "feat: disable maestro UI until it`s ready" (#1800)
Reverts #1799
1 parent 72b7f65 commit 0b3cf3a

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

packages/vscode-extension/src/extension.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import { PanelLocation } from "./common/State";
3838
import { DeviceRotationDirection, IDEPanelMoveTarget } from "./common/Project";
3939
import { AdminRestrictedFunctionalityError, PaywalledFunctionalityError } from "./common/Errors";
4040
import { registerRadonAI } from "./ai/mcp/RadonMcpController";
41+
import { MaestroCodeLensProvider } from "./providers/MaestroCodeLensProvider";
4142
import { removeLicense } from "./utilities/license";
4243

4344
const CHAT_ONBOARDING_COMPLETED = "chat_onboarding_completed";
@@ -207,6 +208,25 @@ export async function activate(context: ExtensionContext) {
207208
}
208209
}
209210

211+
async function startMaestroTest(fileNames: string[]) {
212+
const ide = IDE.getInstanceIfExists();
213+
if (ide) {
214+
ide.project.startMaestroTest(fileNames);
215+
} else {
216+
window.showWarningMessage(
217+
"Wait for the app to load before running Maestro tests.",
218+
"Dismiss"
219+
);
220+
}
221+
}
222+
223+
async function stopMaestroTest() {
224+
const ide = IDE.getInstanceIfExists();
225+
if (ide) {
226+
ide.project.stopMaestroTest();
227+
}
228+
}
229+
210230
function removeLicenseWithConfirmation() {
211231
window
212232
.showWarningMessage(
@@ -266,6 +286,8 @@ export async function activate(context: ExtensionContext) {
266286
context.subscriptions.push(
267287
commands.registerCommand("RNIDE.showInlinePreview", showInlinePreview)
268288
);
289+
context.subscriptions.push(commands.registerCommand("RNIDE.startMaestroTest", startMaestroTest));
290+
context.subscriptions.push(commands.registerCommand("RNIDE.stopMaestroTest", stopMaestroTest));
269291

270292
context.subscriptions.push(commands.registerCommand("RNIDE.captureReplay", captureReplay));
271293
context.subscriptions.push(commands.registerCommand("RNIDE.toggleRecording", toggleRecording));
@@ -370,6 +392,13 @@ export async function activate(context: ExtensionContext) {
370392
)
371393
);
372394

395+
context.subscriptions.push(
396+
languages.registerCodeLensProvider(
397+
[{ scheme: "file", language: "yaml" }],
398+
new MaestroCodeLensProvider()
399+
)
400+
);
401+
373402
context.subscriptions.push(
374403
workspace.onDidChangeConfiguration((event: ConfigurationChangeEvent) => {
375404
if (event.affectsConfiguration("RadonIDE.userInterface.panelLocation")) {

packages/vscode-extension/src/webview/components/ToolsDropdown.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { ProjectInterface } from "../../common/Project";
1616
import Tooltip from "./shared/Tooltip";
1717
import { useSelectedDeviceSessionState } from "../hooks/selectedSession";
1818
import { ToolsState, ToolState } from "../../common/State";
19+
import { useStore } from "../providers/storeProvider";
1920

2021
interface DevToolCheckboxProps {
2122
label: string;
@@ -94,7 +95,12 @@ function ToolsDropdown({ children, disabled }: { children: React.ReactNode; disa
9495
const selectedDeviceSessionStatus = use$(selectedDeviceSessionState.status);
9596

9697
const { project } = useProject();
98+
const store$ = useStore();
99+
const applicationDependencies = use$(
100+
store$.projectState.applicationContext.applicationDependencies
101+
);
97102

103+
const isMaestroInstalled = applicationDependencies.maestro?.status === "installed";
98104
const isRunning = selectedDeviceSessionStatus === "running";
99105

100106
const profilingCPUState = use$(selectedDeviceSessionState?.applicationSession.profilingCPUState);
@@ -126,6 +132,26 @@ function ToolsDropdown({ children, disabled }: { children: React.ReactNode; disa
126132
data-testid="radon-tools-dropdown-menu"
127133
onCloseAutoFocus={(e) => e.preventDefault()}>
128134
<h4 className="device-settings-heading">Tools</h4>
135+
{isMaestroInstalled && (
136+
<>
137+
<Label>Testing</Label>
138+
<DropdownMenu.Item
139+
className="dropdown-menu-item"
140+
data-testid="tools-dropdown-menu-maestro-test-button"
141+
onSelect={() => {
142+
const fileDialogPromise = project.openSelectMaestroFileDialog();
143+
fileDialogPromise.then((fileNames) => {
144+
if (fileNames) {
145+
project.startMaestroTest(fileNames);
146+
}
147+
});
148+
}}>
149+
<span className="codicon codicon-github-action" />
150+
Start Maestro test(s)...
151+
</DropdownMenu.Item>
152+
</>
153+
)}
154+
129155
<Label>Utilities</Label>
130156
<DropdownMenu.Item
131157
className="dropdown-menu-item"

packages/vscode-extension/src/webview/views/DiagnosticView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ function DiagnosticView() {
7070
<Label>Other</Label>
7171
<DiagnosticItem label="Expo Router" name="expoRouter" info={dependencies.expoRouter} />
7272
<DiagnosticItem label="Storybook" name="storybook" info={dependencies.storybook} />
73+
<DiagnosticItem label="Maestro" name="maestro" info={dependencies.maestro} />
7374
<DiagnosticItem label="eas-cli" name="easCli" info={dependencies.easCli} />
7475
<div className="diagnostic-section-margin" />
7576

0 commit comments

Comments
 (0)