Apps: Display extrinsic meta documentation on hover

Created on 11 Apr 2019  Â·  23Comments  Â·  Source: polkadot-js/apps

Goal:

To make specific extrinsic information available at the fingertips of the user, as opposed to referencing more external documentation.

Background:

Currently the metadata returns in-code documentation that expands on the methods for both the extrinsics and chain state. This information is used to display a very condensed summary in the extrinsic selection, i.e.

image

We wish to expand this to actually show all information.

Actions:

  • Expand the submit the following extrinsic label (or any label passed for an Extrinsic/Proposal to contain help with the actual documentation.
  • As the method selection changes, the updated documentation becomes available as part of the hover. (This is actually better suited to the dropdown itself, and _may_ work as a tooltip - but these things are large)

Bonus:

Also apply to the chain state app

!bounty -size-s @app-extrinsics [documentation]

All 23 comments

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


__This issue now has a funding of 150.0 DAI (150.0 USD @ $1.0/DAI) attached to it as part of the W3F fund.__

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


__Work has been started__.

These users each claimed they can complete the work by 11 months from now.
Please review their action plans below:

1) sebastiancaso has applied to start work _(Funders only: approve worker | reject worker)_.

No questions on the ticket, seems pretty straightforward. I'll review the code then come up with the best solution possible.
2) pbteja1998 has been approved to start work.

I will start working on this as per the given requirements.

Learn more on the Gitcoin Issue Details page.

@georgiemathews Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@jacogr Is this available? If so, I want to give this a try.

@pbteja1998 It has been assigned as of now, however if the status does change, it should reflect here via the Gitcoin updates.

@georgiemathews Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot still working, should be done in the next two days!

@georgiemathews Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


@georgiemathews due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

  • [x] reminder (3 days)
  • [x] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

Hey @georgiemathews just checking in on you. Is this bounty still a WIP for you?

@jacogr I think this bounty's status returned to open. I want to give this a try. Shall I take this?

@pbteja1998 Yes, please. You can just apply via gitcoin

@jacogr I have applied through gitcoin. Before I start, I have a few doubts.

  • You want to show more information about all the labels in the form... like rendering a "?" symbol next to each label, which acts similar to a tooltip. Is this what is required?

Also, in bonus section, you wrote Also apply to chain state app. What do u mean by this? Is this another repo?

Also, in bonus section, you wrote Also apply to chain state app. What do u mean by this? Is this another repo?

What is meant here is: we can apply the same changes to another app, it is another section in the UI called "Chain state", it's in the same repo, just a different package: https://github.com/polkadot-js/apps/tree/master/packages/app-storage

I let Jaco answer the first question.

@pbteja1998 So yes, if you look at the app, we already have that available everywhere we use labels (not in extrinics and not in state), i.e.

image

So the label wrapper already take and (optional) help prop, that handles the rendering. So on extrinsics, when we swap the section/method, we just need to dynamically determine what the metadata is (it already gets rendered in the method dropdown) and then pass that to the help prop.

Dos this make sense?

On what basis should I determine the meta data for a given label?

The metadata is return from the chain. So each call has documentation. So currently when constructing the dropdowns, these are attached and appear (in summary form), inside the item, i.e.

image

This is extracted from the methods itself (as an example), here -

https://github.com/polkadot-js/apps/blob/master/packages/ui-app/src/InputExtrinsic/options/method.tsx#L41

So the same logic would apply in the onChange event of the extrinsic selection, i.e. here https://github.com/polkadot-js/apps/blob/master/packages/app-extrinsics/src/Selection.tsx#L125

Since an extrinsic gets passed, you can inspect it in the same way as above and then just attache the documentation as the help.

The same (from extrinsic) takes place when submitting -

image

i.e. here is an actual complete example as to how to extract from the actual extrinsic,

https://github.com/polkadot-js/apps/blob/master/packages/ui-signer/src/Transaction.tsx#L29-L40

@jacogr Thanks for the detailed explanation. Can you please approve me in gitcoin. I will start working on this immediately.

@pbteja1998 approved.

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


__Work for 150.0 DAI (150.0 USD @ $1.0/DAI) has been submitted by__:

  1. @pbteja1998

@Web3Foundation please take a look at the submitted work:

  • PR by @pbteja1998

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


__The funding of 150.0 DAI (150.0 USD @ $1.0/DAI) attached to this issue has been approved & issued to @pbteja1998.__

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

laurogripa picture laurogripa  Â·  6Comments

iammelea picture iammelea  Â·  6Comments

illlefr4u picture illlefr4u  Â·  6Comments

soc1c picture soc1c  Â·  5Comments

talfco picture talfco  Â·  5Comments