Skip to content

Make code editable in UI Artifact#119

Closed
vishwamartur wants to merge 1 commit intoe2b-dev:mainfrom
vishwamartur:make-code-editable
Closed

Make code editable in UI Artifact#119
vishwamartur wants to merge 1 commit intoe2b-dev:mainfrom
vishwamartur:make-code-editable

Conversation

@vishwamartur
Copy link

Related to #39

Add code editing functionality to the UI Artifact.

  • components/fragment-code.tsx

    • Import useState from 'react'.
    • Add code state to manage the code content.
    • Add handleCodeChange function to update the code state.
    • Replace CodeView component with a textarea for editing code.
    • Update CopyButton and download function to use the code state.
    • Update onClick event handler to set the code state when switching files.
  • components/code-view.tsx

    • Remove Prism and related imports.
    • Remove useEffect hook and code and lang props.
    • Import CodeMirror and related styles and modes.
    • Update CodeView component to use CodeMirror for code editing.
  • app/page.tsx

    • Import FragmentCode component.
    • Replace FragmentCode component with the updated version.

Related to e2b-dev#39

Add code editing functionality to the UI Artifact.

* **components/fragment-code.tsx**
  - Import `useState` from 'react'.
  - Add `code` state to manage the code content.
  - Add `handleCodeChange` function to update the `code` state.
  - Replace `CodeView` component with a `textarea` for editing code.
  - Update `CopyButton` and `download` function to use the `code` state.
  - Update `onClick` event handler to set the `code` state when switching files.

* **components/code-view.tsx**
  - Remove `Prism` and related imports.
  - Remove `useEffect` hook and `code` and `lang` props.
  - Import `CodeMirror` and related styles and modes.
  - Update `CodeView` component to use `CodeMirror` for code editing.

* **app/page.tsx**
  - Import `FragmentCode` component.
  - Replace `FragmentCode` component with the updated version.
@vercel
Copy link

vercel bot commented Mar 18, 2025

@vishwamartur is attempting to deploy a commit to the E2B Team on Vercel.

A member of the Team first needs to authorize it.

@mlejva mlejva removed their request for review March 18, 2025 10:07
@vercel
Copy link

vercel bot commented Mar 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fragments ❌ Failed (Inspect) Mar 19, 2025 9:29am

@mishushakov
Copy link
Member

Can you please fix the build errors before we can review please?

@vishwamartur
Copy link
Author

I don't have access to see the deployment error, so please take this task from here.
@mishushakov

@deepweather
Copy link

Can you pls add github actions? Hard to fix the built error without seeing it

@mishushakov
Copy link
Member

these are the errors I am seeing on Vercel:
Screenshot 2025-03-23 at 23 14 02

@mishushakov
Copy link
Member

Closing due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants