Repository navigation
explorer: Line up cards, rows and tooltips, and keep large amounts exact - #341
Merged
Merged
Conversation
The node writes its u64s as bare JSON numbers, and a JavaScript number holds an integer exactly only up to 2^53 LUX, 9,007,199.254740991 DUSK. Past it, amounts shown as exact lost their last digits: the two largest stakes on mainnet showed as 14,927,768.807078792 and 13,102,790.940789548 DUSK. The node's answers are read with parseJson, which gives an integer past 2^53 as a bigint of every digit it was written with. JSON.parse's source text access would do it, but not in every browser the build supports. Fees, the stakes' totals and their order are worked out exactly, and the raw payload and header are shown as the node wrote them. Rounded figures stay numbers.
- A phone's transaction row keeps its sender and receiver whole: the receiver, with its arrow, goes to the next line when both don't fit, where it was cut to a letter, or lost with its arrow. - The home page's cards share their rows with subgrid, so a label on two lines no longer pushes its number below the one beside it, and a line under a number that is longer than its card wraps inside it. - Narrower than 1280 px, the line under a provisioner's stake breaks between its parts, so the table fits the page; a sort's arrow hangs after its label, which stays over its numbers. - A tooltip is never narrower than the largest amount of DUSK, so an exact amount no longer breaks in two, and its arrow moves back as far as the tooltip was moved to stay in the window. - A button's label shows its descenders, a switch's knob is a block that text alignment can't move out of its track, and the footer stays at the window's foot when a search that found nothing hides the page.
The tooltip set aria-described-by, which nothing reads, so screen readers never heard it. It now sets aria-describedby while it shows, and takes off only its own: a control that describes itself, as a row's help does, keeps its description.
The map keyed each place by its coordinates, but places are grouped by city and country, and IP lookups can put two of them at one point. Two such places made Svelte throw each_key_duplicate, and the home page showed most of its numbers as dashes. Each place is now its own key.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
parseJson(src/lib/dusk/json), which gives such an integer as a bigint of every digit written. It uses onlyJSON.parsewith a reviver andBigInt, sinceJSON.parse's source text access isn't in every browser the build supports. Fees, stake totals and stake and reward order are worked out exactly; the raw payload and header show the numbers as the node wrote them. An answer with no run of 16 digits, which no integer past 2^53 can have, goes straight toJSON.parse: 40 ms against 18 ms native for 10 MB; one with such a run takes the slower path (about 0.4 s for 10 MB, against small answers in practice). Node info stays plain JSON: it holds u64::MAX heights, is never shown, and is compared as JSON text.aria-described-by, which nothing reads. It now setsaria-describedby, and leaves a control's own description alone.each_key_duplicateand blanked most of the home page's numbers. Each place is now its own key.How it was checked
parseJson, the map with two places at one point, and the tooltip's accessible description.npm audit signatures, format, lint, typecheck, 415 tests and the build.