-
Notifications
You must be signed in to change notification settings - Fork 157
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
[#2098] Add show more button for error messages #2105
[#2098] Add show more button for error messages #2105
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I think I like the blue option more because it's distinct from the surrounding colours. Also, the rest of RepoSense also uses blue for toggles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work on the PR!
However, it seems like CI is failing due to some linting mistakes!
@sopa301 @asdfghjkxd Thanks for the insight! Fixed the linting issue also |
@jonasongg Thanks for tacking this issue!
For now, I think we can define it in the view file and later move it to a dedicated Vue component.
Currently, the 'Show More' button takes up a lot of vertical space at the bottom of the error box. Moreover, we do not expect most users to click on 'Show More' so it can be more subtle. I think what would work better to fit in with the compact style of RepoSense is using a right-aligned button styled like a red link.
I think the transition isn't too bad but if you're interested in implementing smoother transitions, please go ahead! |
One other comment about the UI: I feel the fact that some errors have been omitted should be more apparent. The current For example, the last line of error message could be
What do you all think? Other alternatives? |
Thanks @ckcherry23 I'm OK with either. Will leave you all to decide. |
@ckcherry23 @damithc Added the changes as specified! |
@ckcherry23 Wondering if I should add some tests in chartView_errorSummary_messageBox.cy.js to test this show more button; if I do, then I will need to add some repos to summary.json |
Yes, it would be great if we added a test case to test this behaviour! However, adding repos to In your case, would it be okay to show only 3 errors by default? |
If I'm not wrong, the default cypress configuration will only result in one error message, so I'm not too sure on how best to test this! |
@jonasongg Okay, I thought the Cypress configuration had 4 errors, which is why I suggested the default of 3. In that case, let's make changes to the |
@ckcherry23 Sorry for the late update, just added the aforementioned tests! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Pleasantly surprised other tests didn't break because of this change.
@jonasongg Please edit the title of the PR to include the issue number |
frontend/cypress/tests/chartView/chartView_errorSummary_messageBox.cy.js
Outdated
Show resolved
Hide resolved
@ckcherry23 Made the changes! Thanks |
@vvidday @ckcherry23 I added the variable in data() as I'm not too sure what the idiomatic way to define constants in our Vue files are, let me know if I should change it! |
Tests seem to be failing due to the new title component + added error messages pushing the charts out of viewport - Might be worth looking into the visibility selectors in our tests. chrome_AojBzTIZzQ.mp4 |
@vvidday thanks for pointing this out! a very simple fix for most of these tests would like you suggested to remove the |
We can either use the |
@sopa301 Thanks for the suggestions! I decided to go with the exist assertion because it's an easier change (and also |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes, LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The following links are for previewing this pull request:
|
Fixes #2098
Proposed commit message
Other information
Currently, I opted for an easier JS implementation of the feature that displays the button if the number of error messages are above 4. About this, I wanted to ask what the best place would be to put a constant that defines this number (maximum number of error messages displayed without showing more).
Regarding the design of the show more button, I wanted to also get some thoughts on what would work best for RepoSense:
(default a tag, bad contrast)
(default MUI text button)
Lastly, with JS, the transition when clicking show more is visually a bit jarring as the new elements appear programmatically. If needed, I can investigate a way to better animate showing more through CSS, which would also eliminate the need to have a constant to define the number of error messages displayed by default (preliminarily, this would involve adding a transition to max-height).