Skip to content

[web] Do not reserve space for section icons#549

Merged
dgdavid merged 2 commits intomasterfrom
improve-sections-indentation
Apr 25, 2023
Merged

[web] Do not reserve space for section icons#549
dgdavid merged 2 commits intomasterfrom
improve-sections-indentation

Conversation

@dgdavid
Copy link
Contributor

@dgdavid dgdavid commented Apr 25, 2023

Problem

The initial sketch of Agama UI included icons close to the section titles, not only for aesthetic reasons but as a visual aid for people with no sight problems. They can help to quickly identify a section and also to create an indentation that helps to identify at first sight the section related content.

But, sadly, we do not have icons for all sections. What is more, we can have full pages without a section icon, which is the case of the Storage Proposal Page right now.

For these pages, the indentation looks not justified or a bit wrong, specially when adding elements that do not obey the section layout.

Page mounting sections with icons Page mounting sections w/o icons
Screen Shot 2023-04-25 at 11 46 12 Screen Shot 2023-04-25 at 11 45 56

Solution

Since at this time we're using a CSS grid for laying out the section elements, using a not fixed value for the "icon" column looks like a good compromise fix.

Before After
Screen Shot 2023-04-25 at 11 45 56 Screen Shot 2023-04-25 at 11 45 47

The only caveats I'm able to see at this time are,

  • Missing both in a same page, sections with and without icons, will create a lot of miss alignments
  • Using the loading prop in a section not using a representative icon (and, thus, reserving the space) will cause an ugly space distribution.
Mixed kind of sections A fake example of section using loading prop but not icon
Screen Shot 2023-04-25 at 11 47 18 Screen Shot 2023-04-25 at 12 11 50

But, as mentioned, this is a compromise fix, and we can see these caveats as a guideline of things we must avoid doing. What is more, for a section without icon the loading prop would be ignored and it must use a Skeleton instead. But that it's for another PR, if this got merged.

Testing

  • Tested manually

To allow having no indentation in pages mounting sections without icons.

It's achieved by not using a fixed width but sizing the column with
`min-content` [1] CSS keyword instead.

[1] https://developer.mozilla.org/en-US/docs/Web/CSS/min-content
@dgdavid dgdavid force-pushed the improve-sections-indentation branch from 0d07572 to 1a099b7 Compare April 25, 2023 12:23
@coveralls
Copy link

coveralls commented Apr 25, 2023

Pull Request Test Coverage Report for Build 4797421061

  • 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 73.786%

Totals Coverage Status
Change from base Build 4755725623: 0.0%
Covered Lines: 4759
Relevant Lines: 6218

💛 - Coveralls

Copy link
Contributor

@joseivanlopez joseivanlopez left a comment

Choose a reason for hiding this comment

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

If I am not wrong, we don't mix sections with and without icon yet. So I think the fix is a good compromise for now.

@dgdavid dgdavid merged commit 626c84c into master Apr 25, 2023
@dgdavid dgdavid deleted the improve-sections-indentation branch April 25, 2023 13:40
@dgdavid dgdavid mentioned this pull request Oct 4, 2023
5 tasks
dgdavid added a commit that referenced this pull request Nov 28, 2023
A kind of rollback of #549 to
avoid UI changes when a section without icon enters in a loading mode
and renders the "section loading icon".
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

Comments