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

Create experimental visual editor toolbar & services #821

Merged
merged 10 commits into from
Aug 23, 2024

Conversation

wwwillchen
Copy link
Collaborator

@wwwillchen wwwillchen commented Aug 22, 2024

Feature overview

image

  • You can drag it around and expand/minimize which is persisted into localStorage.
  • You can view history and revert to a previous revision
  • You can save a change from the view history which it adds to goldens/

Eng Design

  • The visual editor toolbar is guarded behind a flag and lazily loaded with defer views because it's still in an experimental stage and we don't want to load it for other Mesop app developers.
  • This also separates the LLM call into a separate service because we want to decouple it from the main Mesop package.

Usage

Server-side

cd ai/services/
pip install -r requirements.txt 
python service.py 

Client-side

Flag control (run in chrome devtools console):

Enable:

window.localStorage.setItem('MESOP://SHOW_EDITOR_TOOLBAR', 'true');

Disable:

window.localStorage.removeItem('MESOP://SHOW_EDITOR_TOOLBAR');

@wwwillchen wwwillchen changed the title Visual Editor Create experimental visual editor toolbar & services Aug 22, 2024
@wwwillchen wwwillchen marked this pull request as ready for review August 23, 2024 00:00
Copy link
Collaborator

@richard-to richard-to left a comment

Choose a reason for hiding this comment

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

LGTM

mesop/server/server.py Show resolved Hide resolved
mesop/server/server.py Outdated Show resolved Hide resolved
)
else:
print(f"Error from AI service: {response.read().decode('utf-8')}")
return Response(
Copy link
Collaborator

Choose a reason for hiding this comment

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

[nit] Could be wrong, but think you can return error_message, status But I think what's here is a bit more clear.

@wwwillchen wwwillchen merged commit 33e4c87 into google:main Aug 23, 2024
4 checks passed
@wwwillchen wwwillchen deleted the ft-ve branch August 23, 2024 17:16
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.

2 participants