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

FEATURE: Adds HTML markdown preview below notes editor. #16

Merged
merged 9 commits into from
Sep 18, 2024

Conversation

korutech-ai
Copy link
Contributor

Uses marked javascript library to provide an HTML formatted view below the markdown textarea editor. Updates the preview when textarea changes are saved.

@cdb-boop
Copy link
Contributor

Cool! Markdown saving and updating works great.


A few small comments.

1. Dragging the notes textarea can cover the markdown.

Should they be put in a flex box or something so they don't overlap?

Screenshot 2024-08-26 013159

2. Setting CSS textarea height to 100% causes a layout issue in the tags tab.

Screenshot 2024-08-26 012756

3. Does adding this external dependency cause a noticeable loading delay on first load of the model manager?

On my end I think I noticed a (painful) second delay. Can this be avoided?

@korutech-ai
Copy link
Contributor Author

Thanks for the rapid feedback.
My JS and CSS are a little rusty so I'll spend some extra time to improve the layout and flow.
I should be able to grab the marked module as a min.js so it loads locally. I have 2Gbps fibre so lag is non-existent.

I was considering some html to md converters like showdown so formatting is preserved a little better. Would that be of interest vs the nested replace statements? I was struggling to import it due to it being nodejs...and my js skills are a bit out of date :)

@cdb-boop
Copy link
Contributor

Sure, the html-to-md replace statements were a quick solution to avoid an import, but they can be removed if you can avoid user delay. I'm not super experienced with JS, so no pressure.

@korutech-ai
Copy link
Contributor Author

@hayden-fr all issues raised in screen shots and comments should be resolved.
I added an edit button to toggle between edit and view. If notes for a model exist, view is the default. If empty, edit is the default.

Did a little bit of linting as I went. Also cleaned up the tags view. I think that was there prior to my change, but should be better now.

Love this extension. It's a real game changer.

@cdb-boop
Copy link
Contributor

cdb-boop commented Aug 28, 2024

I tested it again and it works great. The toggle is a great idea.

One minor thought. For consistency and maximum space on small screens, should the top row, textarea and markdown elements be flat so the three elements scroll together? Unless you think it is more convenient as it is for easy access to the save button.

Screenshot 2024-08-28 095918

(And yeah, this extension is super important to me in order to keep notes on how to use a model and which ones work. That said, there will likely be a built-in solution within the next year given the changes in the UI. However, before then, I'd like to rebuild it as a general file manager, but I couldn't figure out how to import or use Vue/Vuetify.)

@cdb-boop
Copy link
Contributor

cdb-boop commented Aug 28, 2024

Oh, also I think the markdown element just needs a overflow-wrap: anywhere on it. For example, if there is a long url.

Screenshot 2024-08-28 104333

@korutech-ai
Copy link
Contributor Author

This latest change should have cleaned up the last display issue.
Arc 2024-08-29 07 59 50

@cdb-boop
Copy link
Contributor

Okay, it looks good to me. @hayden-fr

@hayden-fr hayden-fr merged commit f0c7b38 into hayden-fr:main Sep 18, 2024
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