Skip to content

Commit 9d79e5c

Browse files
authored
in-app component editor (#1075)
## Description Added an in-app component editor feature that allows users to create and edit Oasis components directly within the application. This feature is behind a beta flag called "in-app-component-editor". This feature is not yet used in the app. It will be wire-up in the next downstream PR. The implementation includes: - A new component editor dialog with support for both YAML and Python editing - Python code generation using Pyodide for client-side Python execution - Live preview of components as they're being edited - Template selection for different component types (Python, Ruby, JavaScript, Bash) - Support for editing existing components ## Related Issue and Pull requests ## Type of Change - [x] New feature - [x] Improvement ## Checklist - [x] I have tested this does not break current pipelines / runs functionality - [ ] I have tested the changes on staging ## Screenshots (if applicable) ![image.png](https://app.graphite.dev/user-attachments/assets/ef4ccbe2-98a1-4244-8cf2-b208aafaa139.png) ![image.png](https://app.graphite.dev/user-attachments/assets/823c1c59-4aa5-43bb-9671-e70b86967705.png) ![image.png](https://app.graphite.dev/user-attachments/assets/d8701429-8127-483a-8112-51ca0ab13fb3.png) ## Additional Comments The feature uses Pyodide to run Python code in the browser, which allows for client-side generation of component YAML from Python functions. This is particularly useful for users who prefer writing components in Python rather than YAML.
1 parent 4a3800b commit 9d79e5c

23 files changed

+1323
-5
lines changed

package-lock.json

Lines changed: 44 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
"js-yaml": "^4.1.0",
8282
"localforage": "^1.10.0",
8383
"lucide-react": "^0.540.0",
84+
"pyodide": "^0.28.3",
8485
"random-words": "^2.0.1",
8586
"react": "^19.2.0",
8687
"react-dom": "^19.2.0",
@@ -93,6 +94,9 @@
9394
"tailwindcss": "^4.1.13",
9495
"tailwindcss-animate": "^1.0.7"
9596
},
97+
"peerDependencies": {
98+
"monaco-editor": "^0.54.0"
99+
},
96100
"devDependencies": {
97101
"@eslint/js": "^9.31.0",
98102
"@hey-api/openapi-ts": "^0.81.1",

src/betaFlags.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,11 @@ export const ExistingBetaFlags = {
2626
"Automatically select the 'Created by me' filter when viewing the pipeline run list.",
2727
default: false,
2828
} as BetaFlag,
29+
30+
["in-app-component-editor"]: {
31+
name: "In-app component editor",
32+
description:
33+
"Enable the in-app component editor for creating and editing Oasis components.",
34+
default: false,
35+
} as BetaFlag,
2936
};

0 commit comments

Comments
 (0)