Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Display MethodDetails content on smaller screens #3309

Merged
merged 5 commits into from
Jan 18, 2022

Conversation

usame-algan
Copy link
Member

@usame-algan usame-algan commented Jan 17, 2022

What it solves

Resolves #3284

How this PR fixes it

Adds line breaks to labels and values within MethodDetails if there is not enough space left and adds horizontal scroll.

How to test it

  1. Open https://pr3309--safereact.review-safe.gnosisdev.com/app/eth:0x4FeE396c8d940B801747CA84632580f917690E87/transactions/0x33eb21a8639f9411ae96a388f41b7af573e118771628b5d57c08f96817349ac9
  2. Observe that MethodDetails data is visible/scrollable on smaller screens

Screenshots

Screenshot 2022-01-17 at 12 31 27

@github-actions
Copy link

CLA Assistant Lite All Contributors have signed the CLA.

@github-actions
Copy link

github-actions bot commented Jan 17, 2022

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@coveralls
Copy link

coveralls commented Jan 17, 2022

Pull Request Test Coverage Report for Build 1712268936

  • 1 of 2 (50.0%) changed or added relevant lines in 2 files are covered.
  • 61 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.005%) to 32.49%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/routes/safe/components/Transactions/TxList/MethodValue.tsx 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
src/routes/routes.ts 1 93.33%
src/components/Root/index.tsx 13 0%
src/routes/index.tsx 15 0%
src/logic/safe/store/reducer/gatewayTransactions.ts 32 2.11%
Totals Coverage Status
Change from base Build 1698563494: 0.005%
Covered Lines: 3160
Relevant Lines: 8679

💛 - Coveralls

@github-actions
Copy link

Deployment links

🟠 Safe Rinkeby Safe Mainnet 🟣 Safe Polygon 🟡 Safe BSC Safe Arbitrum 🟢 Safe xDai

@github-actions
Copy link

github-actions bot commented Jan 17, 2022

E2E Tests Failed
Check the results here: https://github.com/gnosis/safe-react-e2e-tests/actions/runs/1712301663

Failed tests:

  • ❌ Safe Apps List Safe Apps List
  • ❌ Safe Balances Safe Balances

Copy link
Member

@iamacook iamacook left a comment

Choose a reason for hiding this comment

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

Looking good @usame-algan, but should it not also wrap Value on line 56? And does the scroll issue only affect contract interactions?

@usame-algan
Copy link
Member Author

Looking good @usame-algan, but should it not also wrap Value on line 56? And does the scroll issue only affect contract interactions?

For some value types we don't set flex box so the value gets displayed in their own row but it wouldn't hurt to still set the min-width to 50% even if there is only one column. The scroll should "trigger" every time there is not enough available space within MethodDetails regardless of the transaction type

@katspaugh
Copy link
Member

katspaugh commented Jan 17, 2022

Please add a screenshot in the description of what an overflowing field looks like.

Nvm, I saw it on the link you provided. IMHO, the value and label should scroll separately if possible.

Also there's plenty of vertical space, yet the label tries to be on a single line. Might be worth adding word-break or hyphens: auto or some other way to break it.

@usame-algan
Copy link
Member Author

Also there's plenty of vertical space, yet the label tries to be on a single line. Might be worth adding word-break or hyphens: auto or some other way to break it.

I agree it would be better to use the available vertical space in those cases. I added flex-wrap: wrap for automatic line breaks if there is not enough space. Hopefully that should cover both large and small values.

@@ -13,6 +13,11 @@ const NestedWrapper = styled.div`
padding-left: 4px;
`

export const ValueWrapper = styled.div`
Copy link
Member

Choose a reason for hiding this comment

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

I'd move this to MethodDetails as it is being used there and not here.

@usame-algan usame-algan changed the title Allow horizontal scroll for TxInfo Allow horizontal scroll for MethodDetails Jan 17, 2022
@usame-algan usame-algan changed the title Allow horizontal scroll for MethodDetails Display MethodDetails content on smaller screens Jan 17, 2022
@katspaugh
Copy link
Member

katspaugh commented Jan 17, 2022

It could look like this with white-space: nowrap removed:
Screenshot 2022-01-17 at 13 20 55

Or, like in your version, with flex-wrap: wrap added (I like this better):
Screenshot 2022-01-17 at 13 21 05

In both cases, removing white-space: nowrap seems to help avoid scrollbars. Dunno if it breaks any other fields.

@usame-algan
Copy link
Member Author

In both cases, removing white-space: nowrap seems to help avoid scrollbars. Dunno if it breaks any other fields.

In combination with flex-wrap: wrap it should be ok to remove white-space: nowrap because labels and values stack on top of each other on smaller screens

@github-actions
Copy link

Deployment links

🟠 Rinkeby Mainnet 🟣 Polygon 🟡 BSC Arbitrum 🟢 Gnosis Chain

@usame-algan usame-algan merged commit ecb6ed5 into dev Jan 18, 2022
@usame-algan usame-algan deleted the fix/tx-data-not-visible branch January 18, 2022 15:51
@github-actions github-actions bot locked and limited conversation to collaborators Jan 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transaction data not visible on smaller screens
4 participants