Skip to content

feat: add options for editor and templates - #190

Merged
asyncapi-bot merged 18 commits into
asyncapi:masterfrom
magicmatatjahu:options-for-render
Dec 16, 2021
Merged

asyncapi-bot merged 18 commits into
asyncapi:masterfrom
magicmatatjahu:options-for-render

Conversation

@magicmatatjahu

@magicmatatjahu magicmatatjahu commented Nov 25, 2021 •

Copy link
Copy Markdown
Member

Description

  • Add options (to change in the modals) for editor and templates:
    • auto saving
    • delay for auto saving in msc
    • auto rendering
  • Add info about modified document in the terminal
  • Improve readonly view - when someone pass as query parameters readOnly and some url, or base64

WDYT? @mcturco @boyney123 @jonaslagoni

Related issue(s)
Resolves #137

@magicmatatjahu magicmatatjahu added the enhancement New feature or request label Nov 25, 2021
@netlify

netlify Bot commented Nov 25, 2021 •

Copy link
Copy Markdown

@magicmatatjahu
magicmatatjahu marked this pull request as ready for review November 25, 2021 13:53
@jonaslagoni

Copy link
Copy Markdown
Member

Add options (to change in the modals) for editor and templates:
* auto saving
* delay for auto saving in msc
* auto rendering

Love it 👍

@mcturco

mcturco commented Dec 2, 2021

Copy link
Copy Markdown
Contributor

@magicmatatjahu how can I visually see the changes that were made? I know there is a netlify preview link, but what actions do I have to take to review the changes in the preview?

@magicmatatjahu

Copy link
Copy Markdown
Member Author

@mcturco Yeah, sorry, I didn't describe how to test it in the preview. In the left-bottom corner we have a gear icon, which open the modal with settings. You can change (atm) settings for editor and templates:

image

You can change e.g. editor autosaving and then you should see:

image

Auto saving which indicates that editor will auto save changes to the local storage

Or (if you disabled auto saving):

image

Modified which indicates that you changed your spec and you should save it :)

Also for editor there is auto-rendering option which indicates that rendering will be done automatically or by yourself, there will be button in the sidebar of the right panel:

image

@mcturco

mcturco commented Dec 3, 2021

Copy link
Copy Markdown
Contributor

@magicmatatjahu thank you so much for outlining the changes! These are great improvements, well done. However, the only thing that I found myself slightly confused about is when Autosaving is turned on I was expecting for the Successfully saved to local storage banner to pop up after the set autosave delay. Then, I think that the ! Autosaving notice should disappear OR maybe we change the ! Autosaving to Autosave: On that way it is a bit more clear that it is indeed working -- the current label looks more like a warning to me. What do you think?

@magicmatatjahu

Copy link
Copy Markdown
Member Author

@mcturco Thanks for comment and thanks for kindly words :)

I did it this way in the first iteration, but then it turned out that with frequent changes, this notification with information that was saved, appeared too often and it did not look good. We can return to this solution with a delay for saving, ie if someone makes several changes within 5 seconds, only once will appear this notification.

About note, right it looks a bit like a warning, but I guess it is a warning that affects the way you "use" the studio, right? :) But we can change it to Autosave: On (and maybe also Autosave: Off in case of disabled function?). I will make that changes and I ping you :)

@magicmatatjahu

Copy link
Copy Markdown
Member Author

@mcturco Ok, I propagated changes, you can see them in new preview :)

@mcturco

mcturco commented Dec 6, 2021

Copy link
Copy Markdown
Contributor

I did it this way in the first iteration, but then it turned out that with frequent changes, this notification with information that was saved, appeared too often and it did not look good.

@magicmatatjahu okay I definitely see what you are saying here and I have to agree now when I visually see it. Figma (the design program I use) always autosaves work automatically and how they handle the notification is that it only shows up when you use the "Save" keyboard shortcut (Command + S / Ctrl + S). Perhaps when Autosave is turned on, the notification can say:

Studio is currently saving your work automatically 💪

And when Autosave is turned off, the notification remains the same as it is now. Let me know if this makes sense and what your thoughts are on it.

@magicmatatjahu

Copy link
Copy Markdown
Member Author

@mcturco So if someone will have autosaving turn on then we should only show one time notification Studio is currently saving your work automatically 💪 and don't show any nots when under the hood code will save changes, am I right?

Of course if someone will use the "save" shortcut then we will still show notification about saving :)

@mcturco

mcturco commented Dec 6, 2021 •

Copy link
Copy Markdown
Contributor

@magicmatatjahu correct, I just tested it writing a whole sentence and if I hesitated at all the banner would show up which I think might be a little excessive now that I am seeing it happen. If you think about it, users currently are used to hitting the "Save" keyboard shortcut for most programs to save their progress, so I think showing that banner Studio is currently saving your work automatically 💪 when they save with the shortcut will be enough of an indicator that they don't have to keep saving manually. You know what I mean?

@magicmatatjahu

Copy link
Copy Markdown
Member Author

@mcturco Thanks for clarification, I understand. I will add that notification, but also I will leave that info in the terminal Autosave: On and Autosave: Off :)

@mcturco

mcturco commented Dec 6, 2021

Copy link
Copy Markdown
Contributor

@magicmatatjahu yes! Sorry I never acknowledged that part. I think the Autosave: On and Autosave: Off works great!

@magicmatatjahu

Copy link
Copy Markdown
Member Author

@boyney123 @mcturco Ok, I added descriptions :) Please check in the preview.

image

@mcturco

mcturco commented Dec 14, 2021

Copy link
Copy Markdown
Contributor

@magicmatatjahu looks great!

Sorry but I have one more thing... the current UI for the on/off switch to toggle on and off the autosaving & auto-rendering to me is a little bit confusing. I couldn't immediately tell if it was turned on or off, so I am proposing this new UI style for the switches:

Screen Shot 2021-12-14 at 10 12 16 AM

Let me know if this is achievable!

@mcturco

mcturco commented Dec 14, 2021

Copy link
Copy Markdown
Contributor

@magicmatatjahu PERFECT 🤩

@magicmatatjahu

Copy link
Copy Markdown
Member Author

@mcturco Hah , you're fast 😆 I was going to write to you about change 😄

@mcturco

mcturco commented Dec 14, 2021

Copy link
Copy Markdown
Contributor

@magicmatatjahu I get all the email notifications 😆

mcturco
mcturco previously approved these changes Dec 14, 2021
@magicmatatjahu

Copy link
Copy Markdown
Member Author

@mcturco so you saw my activity on weekend when I contribute to the panels/tabs 😱

@mcturco

mcturco commented Dec 14, 2021

Copy link
Copy Markdown
Contributor

@magicmatatjahu yes, I see EVERYTHING... 🤣

@magicmatatjahu

Copy link
Copy Markdown
Member Author

@boyney123 Do you wanna add something more? :)

@boyney123

Copy link
Copy Markdown
Contributor

Nice stuff @magicmatatjahu, wish I was as fast as @mcturco ! haha

Yeah just a minor UX thing (maybe), I see some options are related to the parent option (if turned on), I know future we will have more settings and options, I wonder if we should have them sit under the parent option.

What I mean is like this

image

Just slightly indicates that that 2nd option is only related to the first one if its on. Maybe even disable the option if the its off?

image

Not sure. Just an idea. What you think @magicmatatjahu @mcturco .


Apart from that looking great! Guess I should review the code... but maybe I will after we finished with any UI/UX changes.

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@magicmatatjahu

Copy link
Copy Markdown
Member Author

@boyney123 @mcturco Changes propagated, thanks Dave for awesome suggestion! :)

@mcturco

mcturco commented Dec 15, 2021

Copy link
Copy Markdown
Contributor

@boyney123 @magicmatatjahu I think this is a great suggestion and definitely works. Perhaps in the future we can iterate on that when more options are added.

@boyney123

Copy link
Copy Markdown
Contributor

@magicmatatjahu just reviewed the code, quite a large PR 😅 , but I can't find any faults from what I can see. So think this is ready to go?

@boyney123

Copy link
Copy Markdown
Contributor

/rtm

@asyncapi-bot
asyncapi-bot merged commit ffb1eb4 into asyncapi:master Dec 16, 2021
@magicmatatjahu
magicmatatjahu deleted the options-for-render branch December 16, 2021 10:02
@asyncapi-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatic save

6 participants