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 Block Editing Functionality #25

Merged
merged 31 commits into from
Aug 4, 2024
Merged

Add Block Editing Functionality #25

merged 31 commits into from
Aug 4, 2024

Conversation

ozhanefemeral
Copy link
Owner

We needed a way to add new blocks or edit the current blocks. So:

  1. Added BlockEditor, FunctionEditor, IfEditor, and WhileEditor components
  2. Implemented BlockEditorContext for managing block editing state
  3. Created FunctionCombobox for function autocomplete and selection
  4. Developed BlockAdder for adding if/else if/else/while blocks to the current clicked block

- add codebaseInfo to code generator context
- add use effect to code generator component to set codebaseInfo on change
- Add @radix-ui/react-popover as a dependency in package.json
- Implement Command and Popover components in the UI package
- Create new function combobox component
- Implement FunctionCombobox component with search functionality
- Add FunctionCombobox to FunctionEditor
- Update FunctionEditor to handle function selection and variable renaming
- Add `resetAfterSelect` prop
- Reset input value after function selection if `resetAfterSelect` is true
- Set default value for `popoverText` prop in FunctionCombobox component
- Add FunctionCombobox component to IfEditor
- Implement onSelect callback to add selected function inside the selected block
- Pass `resetAfterSelect` prop to FunctionCombobox
- Use BlockAdder on empty state
- Add a clear selection button to the BlockEditor component
- The button allows users to clear the currently selected block
- Update button styles and spacing for improved usability
- Add BlockAdder component to both IfEditor and WhileEditor for creating nested blocks
- Update IfEditor and WhileEdtior components to use useState and useEffect hooks for managing condition input
- Update imports in FunctionEditor and BlockAdder to reflect the new folder structure
Copy link

vercel bot commented Aug 4, 2024

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

Name Status Preview Comments Updated (UTC)
visual-ts ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 4, 2024 9:02pm

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.

1 participant