-
Notifications
You must be signed in to change notification settings - Fork 179
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
fix(app): DQA fixes for protocol details pages #12922
Conversation
@shlokamin I've tagged you specifically as a reviewer because I've made a change to the module schema to make it easier to display the correct icon as needed and that seems like something you should bless or shame. |
Codecov Report
@@ Coverage Diff @@
## edge #12922 +/- ##
==========================================
+ Coverage 73.30% 73.31% +0.01%
==========================================
Files 2324 2332 +8
Lines 63708 64119 +411
Branches 6984 7172 +188
==========================================
+ Hits 46699 47011 +312
- Misses 15354 15417 +63
- Partials 1655 1691 +36
Flags with carried forward coverage won't be shown. Click here to find out more.
|
The desktop app uses a different component and has a hardcoded map of modules to icons. Seems like this is something the module should know about itself (especially since the icons are now used in several places across app platforms). From
|
06cc817
to
fadbd07
Compare
fadbd07
to
f6ed177
Compare
f6ed177
to
2aa99a9
Compare
Having been sufficiently shamed, this bit has been taken out and replaced with the mapping we already had in the ModuleIcon component. |
width="42.125rem" | ||
> | ||
<Btn | ||
paddingLeft="0rem" | ||
paddingRight={SPACING.spacing20} | ||
paddingRight={SPACING.spacing24} |
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.
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.
The 16 gap is in the Flex gridGap a couple lines up: gridGap={SPACING.spacing16}
. This padding of 24 is required to give the entire button a touch target of 48x48 with the chevron on the left half.
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.
oh okay. that makes sense.
thank you for your explanation.
const [truncate, setTruncate] = React.useState<boolean>(true) | ||
const toggleTruncate = (): void => setTruncate(value => !value) | ||
|
||
let displayedTitle = title | ||
if (title.length > 92 && truncate) { | ||
displayedTitle = truncateString(title, 92, 69) | ||
displayedTitle = truncateString(title, 69) |
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.
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.
That works. I swear the truncation had changed to being at the end of the string when I made that edit, but it's not that way now. I blame all the absinthe I drank in my youth.
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.
oh wait, the size is 16%.
I tested truncateString(title, 86, 63) from the font-size 75/(38/44) and the name was 4-line.
truncateString(title, 80, 60) would be better than (75,55)
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.
I'll do that to move things forward. It depends on character size too, so a title that's in all caps is longer than the same title in mixed case and even 80 characters can spill over to four lines in the right circumstances.
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.
L198 the time format was updated from yyyy
-> yy
recently. ex 2023 -> 23
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.
@ewagoner
Seems that this PR needs to update the test for this time format change.
<StyledText | ||
as="p" | ||
fontWeight={TYPOGRAPHY.fontWeightSemiBold} | ||
>{`${i18n.format(t('author'), 'capitalize')}: `}</StyledText> | ||
<StyledText as="p" fontWeight={TYPOGRAPHY.fontWeightSemiBold}> | ||
{author} | ||
</StyledText> |
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.
totally optional
probably we can do something like this
auther_name: "Auther: {{author}}"
<StyledText
as="p"
fontWeight={TYPOGRAPHY.fontWeightSemiBold}
>{`${i18n.format(t('author'), 'capitalize')}: `}
${i18n.format(t('author', {author: author}), 'capitalize')}
</StyledText>
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.
Wouldn't this hard code the Author:
portion instead of using the localized string?
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.
I left a couple of comments. But otherwise, looks good to me.
717db18
to
6e10d06
Compare
6e10d06
to
f84f201
Compare
Overview
This PR addresses the DQA feedback provided on RAUT-451 for the Protocol Details pages.
Closes RAUT-451
Test Plan
Visually verified changes, made storybook changes when needed, and changed unit tests to match new work
Changelog
Review requests
Please compare the protocol details pages to the requested revisions on RAUT-451 (including my comments on that ticket)
Risk assessment
Low
Screen.Recording.2023-06-15.at.2.27.25.PM.mov