Skip to content

Add share ratio colouring and table row separators - #344

Closed
timmyz wants to merge 1 commit into
openscopeproject:masterfrom
timmyz:feature/share-ratio-color-and-row-separators
Closed

timmyz wants to merge 1 commit into
openscopeproject:masterfrom
timmyz:feature/share-ratio-color-and-row-separators

Conversation

@timmyz

@timmyz timmyz commented Oct 30, 2026

Copy link
Copy Markdown

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:

ratio colour meaning
< 1 red not made back yet
1 .. seedRatioLimit orange made back, not at the target yet
>= seedRatioLimit green target reached
< 0 uncoloured unknown or infinite ratio

The upper bound is taken from the server side seedRatioLimit, the ratio at which the
daemon 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 the
active 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 TrguiTable component, so it
applies to the torrents, files, peers and trackers tables.

Implementation notes

Table rows are memoized (MemoizedTableRow = memo(TableRow)), so a change of a value
stored in the config would not reach the cells that render it. The two options are
therefore carried in a small TableDisplayContext provided by the server component, and
the 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 are
toggled 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-prod builds cleanly and npx eslint src/ reports no problems.

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.
@qu1ck

qu1ck commented Oct 30, 2026

Copy link
Copy Markdown
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.

@qu1ck qu1ck closed this Oct 30, 2026
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.

2 participants