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

Adjust UI code to be properly responsive #530

Merged
merged 38 commits into from
Dec 7, 2023

Conversation

karpov-sv
Copy link
Collaborator

Copy link
Member

@JulienPeloton JulienPeloton left a comment

Choose a reason for hiding this comment

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

Thanks @karpov-sv -- this is a super interesting PR! As it touches many aspects of the code, I will break into sections. Also when it comes to the layout, I test on several screen sizes using the responsive mode of Firefox:

Name screen size resolution DPR Comment
Laptop 1 13'' 1920 x 1080 1 e.g. HP elitebook from 2020 (my default)
Laptop 2 14'' 1280 x 800 2 e.g. macbook pro from 2020
Desktop 24'' 1920 x 1080 1 e.g. DELL P2417H (my default)
Smartphone 6'' 360 x 800 4 e.g. Galaxy S20

Let's start with the main page :-)

Main page (index.py)

search bar & logo

I think would even be more disruptive in the look change of the main page, and keep reducing the logo to 20% and center the logo+bar (in the case of no table shown) in the page. In the end, that would feel more like popular search engine main page (small logo on top of the search bar, all centered in the page). What do you think?

General layout for table

I like the fact that buttons are on top, and visible by default:

Screenshot from 2023-12-01 10-15-05

I would add a space between these buttons, and the header and the table though, to avoid crowded zone. What do you think?

However, the basic look for the result table looks to me too 'raw' and too small for large resolution devices, such as laptop 1 and desktop screen (this is why I've added transparency before, and make it bigger):

Previous:
Screenshot from 2023-12-01 10-22-56

This PR:
Screenshot from 2023-12-01 10-23-03

Any strong opinion to revert back to the previous look? Or proposal to improve the current look for all platforms?

Skymap

There used to be transparency around the map -- can we keep it?

Previous:
Screenshot from 2023-12-01 10-25-10

This PR:
Screenshot from 2023-12-01 10-25-15

Preview

The new look is too "raw" from my opinion:

Previous
Screenshot from 2023-12-01 14-32-50

This PR
Screenshot from 2023-12-01 14-32-43

Maybe a dark background on the simple_card object (to contrast more with the underlying page), and a bit of transparency on the card elements?

Also, I see that you change the cutout colormap from Greys_r to Hot. What was the motivation?

…er. Also, invert the difference cutouts of negative detections to make them more visible
…. Uses js-based POST as direct GET tends to just open plainly in the browser, until we change its Content-Disposition.
apps/cards.py Outdated
html.Div(APIURL, id='download_apiurl', className='d-none'),
], position="center"
),
help_popover(
Copy link
Member

Choose a reason for hiding this comment

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

Instead of having the helper here, can we add a third button labeled for example 'Code snippet' (propose something better if you find!) that actually opens the popover?

Screenshot from 2023-12-04 08-40-59

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Committed a fix that makes this a button. For readability, saving space on smaller screens, and to better distinguish from download formats, it has just a help icon, with no text.
Screenshot 2023-12-04 at 13 48 25

@JulienPeloton
Copy link
Member

JulienPeloton commented Dec 4, 2023

Summary of this work -- @karpov-sv do I miss something?

Layout improvement or change

  • Uniformisation of the code for all screen sizes (incl. mobile)
  • Improve layout management by using more CSS
  • Improve loading display
  • Improve the display of the last alert content dropdown by scrolling instead of the changing page.
  • Improve external links display
  • Improve cutouts display (incl. inverting the difference cutout for negative detection) & zoom, and set the color map to Blues
  • Disable irrelevant tabs in the object page (e.g. disable Solar System when there is no match with MPC)

New features

  • Auto-close the drawer when clicking on a link
  • Move the light-curve helper into a popover
  • Allow toggling visibility of lightcurve upper limit independently of the rest
  • Properly update the content of the last alert content dropdown when clicking on a measurement in the lightcurve
  • Enable the direct download of object data with buttons (JSON & VOTable)
  • Display the info on whether a lightcurve point is negative or low quality in the popup
  • Display the alert content for the clicked data point on the right accordion, like the cutout.

Code improvement

  • Generate QR code asynchronously to speed-up the page loading
  • Remove HBase access outside the API part
  • Enable Dash callback debugging

@karpov-sv
Copy link
Collaborator Author

Summary of this work -- @karpov-sv do I miss something?

There are also newly introduced features for displaying the info on whether the point is negative or low quality in the popup, and for inverting the difference cutout for negative detection. Also, now it displays the alert content for the clicked data point, like the cutout.
Btw - maybe we should now change the titles of these two tabs - from "Last alert (cutout|content)" to just "Alert ..." ?

@JulienPeloton
Copy link
Member

Btw - maybe we should now change the titles of these two tabs - from "Last alert (cutout|content)" to just "Alert ..." ?

Agree!

@karpov-sv
Copy link
Collaborator Author

Btw - maybe we should now change the titles of these two tabs - from "Last alert (cutout|content)" to just "Alert ..." ?

Agree!

Committed!

@JulienPeloton JulienPeloton added this to the 2.4 milestone Dec 7, 2023
@JulienPeloton JulienPeloton merged commit f6fcc65 into astrolabsoftware:master Dec 7, 2023
1 check failed
@karpov-sv karpov-sv deleted the ui branch January 22, 2024 23:13
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.

2 participants