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

Add support for filtering TX lists for method type #1679

Merged
merged 8 commits into from
Jan 24, 2025

Conversation

csillag
Copy link
Contributor

@csillag csillag commented Jan 9, 2025

This PR exposes the runtime tx method search feature added to Nexus in oasisprotocol/nexus#824.

It adds support for filtering runtime TX lists for method type.

Depends on:

It also adds the same feature for consensus TX lists, for which the Nexus support has been there for a while.

It works on all consensus and runtime dashboards, transaction list, also including transactions for blocks, accounts and validators.

I suggest reviewing the PR commit by commit, because there are multiple semi-independent small changes.

The account transactions page looks like this:

image

Or this, when there are no results:

image

Latest transactions page, on mobile:

image

For consensus:

image

Copy link

github-actions bot commented Jan 9, 2025

Deployed to Cloudflare Pages

Latest commit: 8ea8fb273aae15cde97777ea13102d1f4096ccca
Status:✅ Deploy successful!
Preview URL: https://2975ecb5.oasis-explorer.pages.dev
Alias: https://pr-1679.oasis-explorer.pages.dev

@csillag csillag force-pushed the csillag/filter-txs-for-method branch from 051268e to 07e7251 Compare January 9, 2025 03:04
@csillag csillag marked this pull request as ready for review January 9, 2025 03:04
@csillag csillag force-pushed the csillag/filter-txs-for-method branch from 0b7e0ce to 4a589e6 Compare January 10, 2025 05:02
@csillag csillag force-pushed the csillag/filter-txs-for-method branch 8 times, most recently from 6befb60 to e092000 Compare January 11, 2025 01:39
@csillag
Copy link
Contributor Author

csillag commented Jan 11, 2025

As discussed with @donouwens, the type filter list for the consensus layer is too long to be convenient. Ideally, it should be replaced with a combo-box with type-ahead search.

However, we plan to support multiple values anyway (later, when nexus will add support for that), so we will replace the widget with a searchable combo-box at that time.

Which means, the current version is as good as it will get, in the current round of implementation.

src/app/components/Select/index.tsx Outdated Show resolved Hide resolved
src/app/components/Select/index.tsx Outdated Show resolved Hide resolved
src/app/components/Select/index.tsx Outdated Show resolved Hide resolved
/**
* An optional second title which will be displayed under title / subheader / action
*/
title2?: ReactNode
Copy link
Contributor

Choose a reason for hiding this comment

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

subtitle maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem is that currently we have title, subheader (and action), all displayed in the same row.
If we introduced subtitle, it would be very easy to accidentally confuse it with subheader.

That was my thinking, but I don't have a strong opinion. If you think subtitle would be better, I am open to rename it. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

In reality this is a workaround to supplement action layouting on mobile. Ideally it should be solved with css instead of misleading abstractions. Maybe a correctly placed flex-wrap would work

src/app/components/Table/index.tsx Outdated Show resolved Hide resolved
Copy link
Member

@lukaw3d lukaw3d left a comment

Choose a reason for hiding this comment

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

Typescript can make sure these are kept in sync

@csillag csillag force-pushed the csillag/filter-txs-for-method branch 3 times, most recently from e6dcb06 to 0b41a3c Compare January 15, 2025 03:10
@csillag csillag changed the title Add support for filtering latest TX list for method type Add support for filtering TX lists for method type Jan 16, 2025
@csillag csillag force-pushed the csillag/filter-txs-for-method branch 2 times, most recently from dc66285 to 5023109 Compare January 16, 2025 11:13
@csillag
Copy link
Contributor Author

csillag commented Jan 16, 2025

Please note that filtering for runtime tx type can get some inconsistent results until oasisprotocol/nexus#883 is implemented.

@csillag csillag force-pushed the csillag/filter-txs-for-method branch from 5023109 to 28d1944 Compare January 18, 2025 02:51
@csillag csillag self-assigned this Jan 18, 2025
@csillag
Copy link
Contributor Author

csillag commented Jan 20, 2025

This will be greatly improved when oasisprotocol/nexus#890 lands, because it will make it possible to search for the "transfer" type coherently.

@csillag csillag force-pushed the csillag/filter-txs-for-method branch from 28d1944 to f1ffc24 Compare January 20, 2025 14:53
@csillag csillag force-pushed the csillag/filter-txs-for-method branch 6 times, most recently from 93e9d3f to 0f19dd2 Compare January 22, 2025 17:54
src/app/components/ConsensusTransactionMethod/index.tsx Outdated Show resolved Hide resolved
src/app/components/Select/index.tsx Outdated Show resolved Hide resolved
/**
* An optional second title which will be displayed under title / subheader / action
*/
title2?: ReactNode
Copy link
Member

Choose a reason for hiding this comment

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

In reality this is a workaround to supplement action layouting on mobile. Ideally it should be solved with css instead of misleading abstractions. Maybe a correctly placed flex-wrap would work

src/app/components/Table/index.tsx Outdated Show resolved Hide resolved
src/app/pages/ConsensusTransactionsPage/index.tsx Outdated Show resolved Hide resolved
@csillag csillag force-pushed the csillag/filter-txs-for-method branch from 7dfabb1 to 9476dfb Compare January 22, 2025 23:27
@csillag csillag force-pushed the csillag/filter-txs-for-method branch 7 times, most recently from f39783d to d79ea64 Compare January 24, 2025 15:44
Currently, if a <Table> receives zero rows, and it is not loading,
it is simply hidden without any trace.

This commit introduces the possibility to show a message where the
table was supposed to be.
This works on:
- the latest transactions page (i.e. /mainnet/sapphire/tx )
- the account transactions page
  ( /mainnet/sapphire/address/0x683dC5f8cFa3e156b0F695CEa0b8EdeC7322CbF6 )
- block transactions ( /mainnet/consensus/block/22847794 )
(As preparation for filtering for them)
 - Add missing methods
 - Use exhaustedTypeWarning for warning on new,
   unhandled values, both for labels and icons
@csillag csillag force-pushed the csillag/filter-txs-for-method branch from d79ea64 to 8ea8fb2 Compare January 24, 2025 15:44
@csillag csillag enabled auto-merge January 24, 2025 15:45
@csillag csillag merged commit cce5c40 into master Jan 24, 2025
7 checks passed
@csillag csillag deleted the csillag/filter-txs-for-method branch January 24, 2025 15:46
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