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

Improve saving, presenting, and rendering idioms #24

Merged
merged 17 commits into from
Feb 23, 2024

Conversation

manishshettym
Copy link
Owner

No description provided.

@manishshettym manishshettym self-assigned this Feb 10, 2024
@manishshettym manishshettym linked an issue Feb 10, 2024 that may be closed by this pull request
@manishshettym manishshettym marked this pull request as draft February 10, 2024 02:48
@manishshettym
Copy link
Owner Author

manishshettym commented Feb 10, 2024

Current status: A lot of the presentation aspects can be covered using the original program graph (accessible via the index) from which this idiom was extracted.

✅ On graph side: idiom subgraph can be highlighted within the original graph
❌ On prog side: idiom sub-prog cannot be highlighted easily within the original prog, in a simple .py file.

Current solution: don't eagerly render idiomatic programs during search. Just store the metadata that can be easily transferred (even streamed) to a front-end and rendered using javascript more fancily (instead of within a .py file)

Metadata format: JSON
Metadata schema:

https://github.com/tart-proj/codescholar/blob/28fd0a34ebc55d8370558db1f487a1866dce2f94/codescholar/search/search.py#L60-L69

@manishshettym
Copy link
Owner Author

Update: ✅ idiom sub-prog can be highlighted using the saved metadata on the HTML application.

TODO: there's a fix required to do this without breaking some newlines in the rendered code when used with syntax highlighters.

@manishshettym manishshettym marked this pull request as ready for review February 21, 2024 19:37
@manishshettym
Copy link
Owner Author

Update: fixes have been made, and the viz is in good shape now!

@manishshettym
Copy link
Owner Author

Updates: Improved the UX to work with codescholar application and also using the streamlit app

  1. Quick shell scripts to startup the services and application
  2. UX now waits until the search is complete and shows the polling
  3. The cache updates the dropdown automatically

@manishshettym manishshettym merged commit 733b56c into main Feb 23, 2024
2 checks passed
@manishshettym manishshettym deleted the present-and-renders branch February 23, 2024 00:39
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.

Improve the presentation of an idiom
1 participant