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

style(website): make Playground Mobile Responsive #2028

Merged

Conversation

jerensl
Copy link
Contributor

@jerensl jerensl commented Jun 7, 2024

Enable Playground work on Mobile Devices

  • User be able to choose between input editor or output editor
  • When opening general options or generator options it will close others, work back and forth
  • On Mobile devices when opening the general option it will take the full display area, and the active button will indicate it's open
  • Refactor the code from using Flex to Grid which reduces multiple unnecessary div components and enables us to keep the existing desktop design
  • Change the first implementation from conditional rendering to using CSS hidden property, so the bug we encounter not become relevant anymore and we remove the quick fix we implemented before
  • I decided to add more space on the input editor and take it from output result in bigger device notebook/desktop because of user probably will work more on the the input edditor rather then the ouput result

Mobile

Mobile Device

Tablet

Tablet Device

Notebook

Notebook

Desktop

Desktop

Alternative Solution

  1. Visible property, The problem with this one is, the element is not being removed form the dom so it will make it difficult to allocate space with Grid

Related Issue

This refactor relates to #1715

Checklist

  • Make Playground Mobile Responsive .
  • Fixes Dark Theme UI Bug.
  • Refactor layout from using Flex to Grid which reduces unnecessary HTML components and makes the website more responsive
  • Rollback the desktop design and keep it by using Grid

Additional Notes

Be careful using Conditional rendering with monaco-react when the costume theme is not being rendered by the first update, probably related to this issue, the way to solve it is by adding extra state for theme after adding the theme using monacoInstance

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

Copy link

netlify bot commented Jun 7, 2024

Deploy Preview for modelina canceled.

Name Link
🔨 Latest commit 29975d5
🔍 Latest deploy log https://app.netlify.com/sites/modelina/deploys/6676f352d903000008638286

@jerensl jerensl changed the title style(website): Make Playground Mobile Responsive style(website): make playground mobile responsive Jun 7, 2024
@jerensl
Copy link
Contributor Author

jerensl commented Jun 7, 2024

The new commit should fix the current issue, I'm adding extra state for updating the costume theme

Copy link
Member

@devilkiller-ag devilkiller-ag left a comment

Choose a reason for hiding this comment

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

Hi @jerensl, The mobile version looks great to me. However, we don't need any changes to the desktop design. So please revert those changes. Also, could you open a new Issue + PR for bugs unrelated to this issue? Don't merge those fixes in this PR.

renderModels,
setRenderModels,
]);
const contextValue = useMemo(
Copy link
Member

Choose a reason for hiding this comment

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

Please don't make unnecessary formatting changes, revert these changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's been part of the eslint-config-prettier rule and done automatically by prettier from the parent eslint rules, can we have npm run lint:fix as we did in the parent directory?

Copy link
Member

Choose a reason for hiding this comment

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

Okay sure, can you please create a separate PR for adding the npm run lint:fix command.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

@jerensl
Copy link
Contributor Author

jerensl commented Jun 8, 2024

Hi @jerensl, The mobile version looks great to me. However, we don't need any changes to the desktop design. So please revert those changes. Also, could you open a new Issue + PR for bugs unrelated to this issue? Don't merge those fixes in this PR.

To keep the desktop version, would you mind if I changed the layout approach from Flexbox to Grid?

The bug just happened after we added conditional rendering for supporting mobile version, so it related to this feature

@jerensl
Copy link
Contributor Author

jerensl commented Jun 9, 2024

Hi @devilkiller-ag I already removed the quick bug fixes because it's not relevant anymore, I tried a new approach that uses the hidden property, for more detail, you can read my edited comment above #2028 (comment)

@devilkiller-ag
Copy link
Member

devilkiller-ag commented Jun 10, 2024

To keep the desktop version, would you mind if I changed the layout approach from Flexbox to Grid?

The bug just happened after we added conditional rendering for supporting mobile version, so it related to this feature

Okay sure, if it doesn't break anything.

@coveralls
Copy link

coveralls commented Jun 10, 2024

Pull Request Test Coverage Report for Build 9438059815

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.303%

Totals Coverage Status
Change from base Build 9382165682: 0.0%
Covered Lines: 5996
Relevant Lines: 6327

💛 - Coveralls

Copy link
Member

@devilkiller-ag devilkiller-ag left a comment

Choose a reason for hiding this comment

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

Things look good to me, but we need to have proper lint fix rules before merging this PR. Otherwise, it's creating many formatting changes.

@jonaslagoni I propose to have same eslint and prettier rules as we have in the asyncapi website. Those rules have been properly brainstormed and implemented recently while migrating it to Next.js v14 and Typescript. Having same lint rules will ensure similar formatting rules across all website codebases in the asyncapi ecosystem. What's your thought on this?

@devilkiller-ag
Copy link
Member

@jonaslagoni Can you also check the playground layout on mobile and desktop and share your thoughts on it?

Copy link
Member

@jonaslagoni jonaslagoni left a comment

Choose a reason for hiding this comment

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

This seems a bit too wide in the desktop version 🤔
image

Other then that it looks good 👍

@jonaslagoni
Copy link
Member

jonaslagoni commented Jun 10, 2024

@jonaslagoni I propose to have same eslint and prettier rules as we have in the asyncapi website. Those rules have been properly brainstormed and implemented recently while migrating it to Next.js v14 and Typescript. Having same lint rules will ensure similar formatting rules across all website codebases in the asyncapi ecosystem. What's your thought on this?

Makes sense to me 👍 Just remember to add the website to the root ignore files so there wont be any duplicates.

@jerensl jerensl closed this Jun 10, 2024
@jerensl jerensl reopened this Jun 10, 2024
Copy link

sonarcloud bot commented Jun 10, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@jerensl
Copy link
Contributor Author

jerensl commented Jun 10, 2024

This seems a bit too wide in the desktop version 🤔 image

Other then that it looks good 👍

Noted, I already made a changes and added the final detail in the latest commit and editted the detail changes I made above

@jerensl jerensl changed the title style(website): make playground mobile responsive chore(website): add next eslint automatic fix for the website Jun 10, 2024
@jerensl jerensl changed the title chore(website): add next eslint automatic fix for the website style(website): Make Playground Mobile Responsive Jun 10, 2024
@jerensl jerensl changed the title style(website): Make Playground Mobile Responsive style(website): make Playground Mobile Responsive Jun 10, 2024
@coveralls
Copy link

coveralls commented Jun 18, 2024

Pull Request Test Coverage Report for Build 9561440615

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.304%

Totals Coverage Status
Change from base Build 9561348719: 0.0%
Covered Lines: 5997
Relevant Lines: 6328

💛 - Coveralls

Copy link
Member

@devilkiller-ag devilkiller-ag left a comment

Choose a reason for hiding this comment

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

@jonaslagoni, I am waiting for the PR #2031 to be merged first before reviewing and merging this one. As there are many changes just made by prettier configuration. Or should we merge this one for now?

Copy link
Member

@devilkiller-ag devilkiller-ag left a comment

Choose a reason for hiding this comment

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

Looks good to me. The formatting issue will be handled in #2031

@coveralls
Copy link

coveralls commented Jun 22, 2024

Pull Request Test Coverage Report for Build 9626631986

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.304%

Totals Coverage Status
Change from base Build 9611843317: 0.0%
Covered Lines: 5997
Relevant Lines: 6328

💛 - Coveralls

@devilkiller-ag
Copy link
Member

/rtm

@asyncapi-bot asyncapi-bot merged commit 7c3d127 into asyncapi:master Jun 22, 2024
15 checks passed
@devilkiller-ag
Copy link
Member

devilkiller-ag commented Jun 22, 2024

Thanks @jerensl ✨ I noticed you haven't joined our slack community. Feel free to join it here.

@jerensl
Copy link
Contributor Author

jerensl commented Jun 22, 2024

Thanks @jerensl ✨ I noticed you haven't joined our slack community. Feel free to join it here.

You're welcome, I already joined the Slack channel and got information about this good first issue there

@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 3.7.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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants