Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add observer in UI #1409

Merged
merged 1 commit into from
Dec 17, 2024
Merged

Add observer in UI #1409

merged 1 commit into from
Dec 17, 2024

Conversation

wintonzheng
Copy link
Contributor

@wintonzheng wintonzheng commented Dec 17, 2024

…194)" (#3196)"

This reverts commit a466afc103497c95a3aeaef120bb36bc4648baa0.


Important

Reintroduces observer feature in PromptBox with new ObserverCruise type and UI components, controlled by observerFeatureEnabled in env.ts.

  • Behavior:
    • Reintroduces observer feature in PromptBox.tsx, allowing selection between 'Observer' and 'Task' modes.
    • Adds startObserverCruiseMutation to handle observer mode, posting to /cruise endpoint.
    • Uses observerFeatureEnabled from env.ts to toggle observer feature.
  • Types:
    • Adds ObserverCruise type in types.ts for observer-related API responses.
  • UI Components:
    • Adds CustomSelectItem and SelectItemText to select.tsx for custom select UI.
  • Environment:
    • Adds observerFeatureEnabled in env.ts to control observer feature toggle.

This description was created by Ellipsis for 21a61d4. It will automatically update as commits are pushed.

…src/'

…194)" (#3196)"

This reverts commit a466afc103497c95a3aeaef120bb36bc4648baa0.
<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Reintroduces observer feature in `PromptBox` with new `ObserverCruise` type and UI components, controlled by `observerFeatureEnabled` in `env.ts`.
>
>   - **Behavior**:
>     - Reintroduces observer feature in `PromptBox.tsx`, allowing selection between 'Observer' and 'Task' modes.
>     - Adds `startObserverCruiseMutation` to handle observer mode, posting to `/cruise` endpoint.
>     - Uses `observerFeatureEnabled` from `env.ts` to toggle observer feature.
>   - **Types**:
>     - Adds `ObserverCruise` type in `types.ts` for observer-related API responses.
>   - **UI Components**:
>     - Adds `CustomSelectItem` and `SelectItemText` to `select.tsx` for custom select UI.
>   - **Environment**:
>     - Adds `observerFeatureEnabled` in `env.ts` to control observer feature toggle.
>
> <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=Skyvern-AI%2Fskyvern-cloud&utm_source=github&utm_medium=referral)<sup> for b887fe9514c894f1138560f6f457b71e43c43692. It will automatically update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 21a61d4 in 19 seconds

More details
  • Looked at 233 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. skyvern-frontend/src/util/env.ts:23
  • Draft comment:
    The conversion of observerEnabled to a boolean is correct, but ensure VITE_OBSERVER_ENABLED is always set to "true" or "false" to avoid unexpected behavior.
  • Reason this comment was not posted:
    Confidence changes required: 33%
    The observerFeatureEnabled is being set based on the VITE_OBSERVER_ENABLED environment variable, which is a string. This is correctly converted to a boolean, so no issues here.
2. skyvern-frontend/src/components/ui/select.tsx:117
  • Draft comment:
    CustomSelectItem and SelectItem have similar implementations. Consider refactoring to reduce code duplication.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The CustomSelectItem and SelectItem components have similar implementations. Consider reusing code to avoid duplication.
3. skyvern-frontend/src/routes/tasks/create/PromptBox.tsx:132
  • Draft comment:
    Consider extracting getClient(credentialGetter) to a common function to avoid repetition in mutations.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The startObserverCruiseMutation and getTaskFromPromptMutation both use getClient(credentialGetter). This could be extracted to a common function to avoid repetition.

Workflow ID: wflow_yDcYS3DGyUpqSium


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Reviewed everything up to 21a61d4 in 1 minute and 15 seconds

More details
  • Looked at 233 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. skyvern-frontend/src/util/env.ts:23
  • Draft comment:
    The conversion of observerEnabled to a boolean is correct, but ensure that VITE_OBSERVER_ENABLED is always set to either "true" or "false" to avoid unexpected behavior.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The observerFeatureEnabled is being set based on the VITE_OBSERVER_ENABLED environment variable, which is a string. This is correctly converted to a boolean, so no issues here.
2. skyvern-frontend/src/components/ui/select.tsx:117
  • Draft comment:
    CustomSelectItem and SelectItem have similar implementations. Consider reusing one to avoid redundancy.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The CustomSelectItem and SelectItem components have similar implementations. Consider reusing one of them to avoid redundancy.
3. skyvern-frontend/src/routes/tasks/create/PromptBox.tsx:164
  • Draft comment:
    Ensure error messages are user-friendly and provide actionable feedback.
  • Reason this comment was not posted:
    Confidence changes required: 33%
    The startObserverCruiseMutation and getTaskFromPromptMutation both handle errors by displaying a toast with the error message. This is a good practice for user feedback.

Workflow ID: wflow_WlqROG18AcdXCpBd


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@@ -114,6 +114,30 @@ const SelectLabel = React.forwardRef<
));
SelectLabel.displayName = SelectPrimitive.Label.displayName;

const CustomSelectItem = React.forwardRef<
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a duplicate of the existing SelectItem component. The existing component is preferred as it properly wraps children in SelectPrimitive.ItemText.

@msalihaltun msalihaltun merged commit 69687f1 into main Dec 17, 2024
2 checks passed
@msalihaltun msalihaltun deleted the salih/add-observer-in-prompt branch December 17, 2024 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants