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

Development: Enhance Share Modal of Apollon standalone #34

Merged
merged 26 commits into from
May 25, 2022

Conversation

minrows
Copy link
Contributor

@minrows minrows commented May 17, 2022

Motivation and Context

This PR enhances the currently existing share modal of Apollon Standalone.
The current version of the Share modal requires 4 clicks to be done before sharing a link, which is a time-consuming task.
This proposed share modal reduces the number of clicks to 2.

Steps for Testing

To test locally:

  1. Clone the repo
  2. checkout the enhancement/change-share-modal branch
  3. yarn install && yarn start
  4. Once the application is running, go to the share menu and observe the newly implemented buttons instead of the old dropdown menu entries.

To test in test server:

  1. Goto https://test1.apollon.ase.in.tum.de

Screenshot:

Before:
screen-capture

After:
screen-capture-1

Todo:

  • Deploy in test server

@minrows minrows self-assigned this May 17, 2022
Copy link

@Dominik-Weinzierl Dominik-Weinzierl 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. Some minor suggestions:

  • When I shrink the window to the minimum width, the text exceeds the button:
    image

  • I think it would be better if we center the entire row (or shrink the pop up):
    image

@Dominik-Weinzierl
Copy link

Works now 👍 Well done

Copy link

@ole-ve ole-ve left a comment

Choose a reason for hiding this comment

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

Tested on Apollon-TS1, works as expected. Nice improvement

Copy link

@canberkanar canberkanar left a comment

Choose a reason for hiding this comment

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

Tested on Apollon test server on the testing session. The new share modal is much more convenient in my opinion. Nicely done!

Copy link

@akesfeden akesfeden left a comment

Choose a reason for hiding this comment

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

Tested on test server 1 during testing session, new modal seems good and simple. We talked about improving the error message saying "Are you sure it contains a diagram.json?" when and empty model is shared but it is decided that this is outside of the scope of this PR.

Copy link

@Lugitan Lugitan left a comment

Choose a reason for hiding this comment

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

Tested on Apollon-TS1, works as described. Very nice improvement.

Copy link

@Dominik-Weinzierl Dominik-Weinzierl left a comment

Choose a reason for hiding this comment

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

It seems like the icon is not centered - i am not sure if this is intended or not 🤔
Screenshot 2022-05-23 at 12 42 03

And you define colors in multiple files e.g. in packages/webapp/src/main/styles.css and in packages/webapp/src/main/themings.json - i guess it would be better to define those colors only at one place (as part of another PR).

You can also think about to extract the text into an additional file - e.g. to support multiple languages in the future.

But thanks for incorporating my suggestions 👍

Copy link
Member

@bassner bassner left a comment

Choose a reason for hiding this comment

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

Seems like this has already been tested by enough people, so I had a look at the code and got a few remarks:

@@ -70,16 +91,16 @@ body {
cursor: pointer;
}

.theme-toggle.dark .sun-and-moon > .sun-beams {
.theme-toggle.dark [class$='sun-and-moon'] > [class$='sun-beams'] {
Copy link
Member

Choose a reason for hiding this comment

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

That looks weird. Why can't we keep the normal class selector?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"svgr webpack" package added prefix "tooltip_svg__" to the classname that I assigned.
Since I did not have control over it and was not sure that's the constant prefix that will be added, I thought of using the selector that selects the class ending with the class name that I assigned.

image

@minrows minrows requested a review from bassner May 23, 2022 16:46
@minrows
Copy link
Contributor Author

minrows commented May 23, 2022

It seems like the icon is not centered - i am not sure if this is intended or not 🤔 Screenshot 2022-05-23 at 12 42 03

And you define colors in multiple files e.g. in packages/webapp/src/main/styles.css and in packages/webapp/src/main/themings.json - i guess it would be better to define those colors only at one place (as part of another PR).

You can also think about to extract the text into an additional file - e.g. to support multiple languages in the future.

But thanks for incorporating my suggestions 👍

Hi @Dominik-Weinzierl,

  1. The icon, currently, is aligned centrally with the description of texts. And IMO, is okay as it is now. Do you want me to align as shown in the snippet (b)?
    (a) image
    (b) image

  2. Regarding the color definition, themings.json is responsible for defining and injecting colors for dark/light mode while style.css is responsible for setting them. If the colors are common for both dark/light modes, that's when we define the color in the style.css file. But yes, this can be discussed and changed in other PR if needed.

  3. Thanks for your suggestion, could be a next possible feature to be implemented in Standalone. 👍

@@ -47,6 +47,10 @@ module.exports = {
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.svg$/,
Copy link
Contributor

@martindevtum martindevtum May 24, 2022

Choose a reason for hiding this comment

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

Is that really necessary?

why don't we just include the svg as the src of a normal img tag. I think svgr/webpack is just an unnessecary additional dependency

Copy link
Contributor

Choose a reason for hiding this comment

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

or including the svgs via the < use >

Copy link
Contributor Author

@minrows minrows May 25, 2022

Choose a reason for hiding this comment

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

We would then not be able to style it via an external CSS file, which is needed for theme-switcher icon.

@@ -35,6 +35,7 @@
"websocket": "1.0.34"
},
"devDependencies": {
"@svgr/webpack": "^6.2.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

see my comment in the webpack config

Copy link
Contributor

@martindevtum martindevtum left a comment

Choose a reason for hiding this comment

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

Code looks good overall. My remarks regarding svgr are optional in my opinion.

@krusche krusche merged commit afafa18 into main May 25, 2022
@krusche krusche deleted the enhancement/change-share-modal branch May 25, 2022 15:50
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.

9 participants