sui
sui copied to clipboard
[explorer] Search Disambiguation
The Problem
Suppose a user wishes to see results on the object 0000000000000000000000000000000000000002. If they search for this value, that get the address of this label (https://explorer.devnet.sui.io/addresses/0000000000000000000000000000000000000002) rather than the object. The only way for the user to find the results on the object is by directly typing in the correct URL (https://explorer.devnet.sui.io/objects/0000000000000000000000000000000000000002).
How can a user search for an entity when both an object and address share the same ID?
Proposed Solution
When both an address and object have the same ID and the user searches for this ID, they are redirected to a Search Results Page. The user then selects whether they want to see results on the address or the object.
Wikipedia-style disambiguation page sounds fine - show links to the results with a type label beside them
for consideration, another way we could allow the search box to be used for type-specific nav:
an addition to the text in the search bar, like Twitter or Unity have
(t|type):(address|transaction|object)
t:address 0000000000000000000000000000000000000002
type:object 0000000000000000000000000000000000000002
@stella3d --> I like the idea of having a search filter. If the user specified the type of entity, then the search would only have to ping the one API resource. We could either have a dropdown box next to the search bar where the user specifies one category of entity to search within or provide a checklist where the user specifies one or more categories to search across.
Perhaps this is best handled under a separate issue?
I've created a new issue for the search filter idea here: https://github.com/MystenLabs/sui/issues/1871
Fixing this issue is blocked by the RPC API not providing a way of distinguishing objects owning objects from addresses owning objects. Following a Slack discussion, there is buy-in on adding the following two functions in the RPC API (exact labels may vary):
get_owned_objects_of_address: returns objects owned by an address.get_owned_objects_of_object: returns objects owned by an object.
For now, the address 0000000000000000000000000000000000000002 has had its owned objects removed thus facilitating searching for the object of this ID.
anyone working on this for the backend? @mystenmark? If not I will take a look
I can do this but I have a few other things to finish first so if you want to take it @patrickkuo go ahead
Cool I will start working on it tomorrow
Question, what if the user wants to find the address 0000000000000000000000000000000000000002? Right now the search defaults to the object.
@bwann52 , right now they have to use the filter box.
The proposed solution is that When both an address and object have the same ID and the user searches for this ID, they are redirected to a Search Results Page. The user then selects whether they want to see results on the address or the object.
Per feedback from @adeabiodun , we will implement the proposed solution and remove the existing filter box.
@666lcz so basically
- we will display a result page whenever there are multiple results for the same search ID
- The result page will present the user with the option to select either the
AddressorObject
This is done https://github.com/MystenLabs/sui/pull/2434
@Jibz1 --> Please see comments in PR - I've specified line-by-line changes to expedite the process.
this is done.