Repository navigation
Conversation
Colour the share ratio column based on its value. A ratio below 1 is shown in red, a ratio between 1 and the seed ratio limit in orange and a ratio at or above the limit in green. The limit is taken from the server side seed ratio limit, the ratio at which the daemon stops seeding, so it matches the requirement of the tracker site without extra configuration. A negative ratio means the ratio is unknown or infinite and is left uncoloured. Add an optional horizontal separator between the table rows. It makes wide tables easier to follow across. Both options are enabled by default and can be toggled from the layout menu.
Member
|
There is a "Ratio progress" column (hidden by default) that shows ratio as a progress bar that fills up to seedRatioLimit and turns from blue to green. It already does what this change is doing, except for being red at < 1 ratio, which as a hardcoded value is not a good idea. As for row separators they are not needed, tables already have striped even-odd background for that purpose. |
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.
Share ratio colouring and table row separators
Two small table display improvements, both enabled by default and toggleable from the layout menu.
Share ratio colouring
The share ratio column is now coloured according to its value:
< 11..seedRatioLimit>= seedRatioLimit< 0The upper bound is taken from the server side
seedRatioLimit, the ratio at which thedaemon stops seeding. It defaults to 2 when the daemon does not report one. Using the
server value means the colouring matches the requirement of the tracker site without
any extra configuration, and it stays correct when the limit is changed in the session
settings.
Colours are taken from the Mantine palette and use
light-dark(), so they follow theactive color scheme instead of being hardcoded.
Table row separators
An optional horizontal separator between the table rows. It makes wide tables easier
to follow across. The separator is drawn by the shared
TrguiTablecomponent, so itapplies to the torrents, files, peers and trackers tables.
Implementation notes
Table rows are memoized (
MemoizedTableRow = memo(TableRow)), so a change of a valuestored in the config would not reach the cells that render it. The two options are
therefore carried in a small
TableDisplayContextprovided by the server component, andthe new value is written to the config before the state update, so the change is picked
up on the very same render.
Both options are added to the interface settings with a default of
true, and aretoggled from the layout menu in the toolbar.
This is based on the request in jayzcoder#68.
Testing
Verified in the browser against a stub transmission RPC server with ratios covering all
three ranges plus the unknown/infinite case. The row separator was confirmed to render
at every row boundary and to disappear when the option is toggled off.
npm run webpack-prodbuilds cleanly andnpx eslint src/reports no problems.