Skip to content

Fix torrent state colors for simultaneous upload/download#48

Merged
taylorcox75 merged 5 commits into
mainfrom
claude/improve-interface-colours
Mar 11, 2026
Merged

Fix torrent state colors for simultaneous upload/download#48
taylorcox75 merged 5 commits into
mainfrom
claude/improve-interface-colours

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Mar 11, 2026

The color scheme didn't differentiate between torrents downloading vs. torrents uploading+downloading simultaneously. Both displayed purple despite the theme already defining blue-grey (#6B7B8C) for the combined state.

Changes

Three getStateColor() functions were checking if (downloading && uploading) but returning colors.stateDownloading instead of colors.stateUploadAndDownload:

  • components/TorrentCard.tsx:352 - Main list view
  • app/torrent/[hash].tsx:170 - Detail view
  • components/ExpandableTorrentCard.tsx:59 - Expandable card view

Additionally:

  • constants/changelog.ts - Added v2.1.2 release notes for in-app "What's New" panel
  • package.json - Bumped version from 2.1.1 to 2.1.2

Result

Torrent color states now display correctly:

  • Purple - Downloading only
  • Green - Idle seeding (complete, no activity)
  • Blue-grey - Uploading + downloading simultaneously
  • Pastel blue - Uploading only (active seeding)

Colors apply to borders, status badges, progress bars, and action buttons across all UI components.

Original prompt

This section details on the original issue you should resolve

<issue_title>Minor suggestion - non critical - interface colour improvement</issue_title>
<issue_description>Is your feature request related to a problem? Please describe.

The colours of the app do not display a different colour for idle seeding, active seeding and uploading, and currently uploading only.

Describe the solution you'd like
The pallet style chosen would benefit from two additional colours. A blue grey (purple and green make a blue grey) and a pastel blue.

For downloading colour is already purple.
For idle seeding colour is already green.

Thus, for a torrent uploading and downloading at the same time - colour blue grey. (New colour)

For a torrent active uploading only - pastel blue. (New colour)

I believe these two additional colours would provide at a glance additional information to the user and be part of your current pallet. A user can tell a torrent that is currently in the process of uploading data even if its downloading or finished as both cases are accounted for.

Describe alternatives you've considered
Non important minor suggestion for interface improvement.

Additional context
Just a suggestion only. Not dictating how to create your app. Simple suggestion if desired.
</issue_description>

Comments on the Issue (you are @claude[agent] in this section)

@taylorcox75 That’s a great suggestion, I’ll try and throw it in the next couple of days. @taylorcox75 > [@taylorcox75](https://github.com/taylorcox75) did you try any colurs?

How's? (Releasing to testflight v2.1.0 in a few hours when apple approves). Open to comments.
Image

@taylorcox75 edit: wrong image, updated @taylorcox75 #45 @taylorcox75 Awesome give TestFlight a few hours then v2.1.0 will be live. Assuming no bug reports I’ll release to prod (App Store) in a few days

- Updated TorrentCard.tsx to use stateUploadAndDownload color for simultaneous upload/download
- Updated torrent detail view [hash].tsx to use stateUploadAndDownload color
- Updated ExpandableTorrentCard.tsx to use stateUploadAndDownload color
- Blue-grey (#6B7B8C) now displays when torrent is uploading and downloading
- Pastel blue (#93C5E4) correctly displays for upload-only torrents

Co-authored-by: taylorcox75 <10939863+taylorcox75@users.noreply.github.com>
@Claude Claude AI changed the title [WIP] Add new colors for torrent statuses Fix torrent state colors for simultaneous upload/download Mar 11, 2026
@taylorcox75 taylorcox75 requested a review from Copilot March 11, 2026 02:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes torrent UI state coloring so that torrents doing simultaneous download+upload use the dedicated combined-state color (stateUploadAndDownload) instead of incorrectly reusing the downloading color.

Changes:

  • Update getStateColor() logic to return colors.stateUploadAndDownload when downloading && uploading.
  • Apply the fix consistently across the main list card, expandable card, and torrent detail view.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
components/TorrentCard.tsx Correct combined DL+UL mapping in the main torrent list card state color logic.
components/ExpandableTorrentCard.tsx Correct combined DL+UL mapping in the expandable card state color selection.
app/torrent/[hash].tsx Correct combined DL+UL mapping in the torrent detail screen state color logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/torrent/[hash].tsx
Comment on lines 167 to 171
const getStateColor = (state: string, progress: number, dlspeed: number, upspeed: number): string => {
const downloading = dlspeed > 0;
const uploading = upspeed > 0;
if (downloading && uploading) return colors.stateDownloading;
if (downloading && uploading) return colors.stateUploadAndDownload;
if (uploading && !downloading) return colors.stateUploadOnly;
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getStateColor/transfer-state logic is duplicated across multiple components (TorrentCard, ExpandableTorrentCard, and this detail screen), which makes it easy for the views to drift (as this bug shows). Consider extracting a shared helper (e.g., in utils/torrentState.ts) so future state/color tweaks stay consistent.

Copilot uses AI. Check for mistakes.
Comment on lines 57 to 62
const stateColor =
downloading && uploading
? colors.stateDownloading
? colors.stateUploadAndDownload
: uploading
? colors.stateUploadOnly
: downloading
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This nested ternary encodes the same state→color mapping that also exists in TorrentCard and the detail screen; it’s easy for these to desync over time. Consider reusing a shared helper for state color/label mapping to keep all views consistent.

Copilot uses AI. Check for mistakes.

// Active transfer: DL+UL uses DL color; upload-only uses upload color
if (downloading && uploading) return colors.stateDownloading;
// Active transfer: DL+UL uses blue-grey; upload-only uses pastel blue
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline comment hard-codes specific color names ("blue-grey"/"pastel blue"), but these values are theme/custom-color configurable. Consider wording this in terms of the semantic tokens (stateUploadAndDownload, stateUploadOnly) to avoid the comment becoming inaccurate if users customize colors.

Suggested change
// Active transfer: DL+UL uses blue-grey; upload-only uses pastel blue
// Active transfer: DL+UL uses stateUploadAndDownload; upload-only uses stateUploadOnly

Copilot uses AI. Check for mistakes.
Comment on lines +351 to 353
// Active transfer: DL+UL uses blue-grey; upload-only uses pastel blue
if (downloading && uploading) return colors.stateUploadAndDownload;
if (uploading && !downloading) return colors.stateUploadOnly;
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getStateColor/getStateLabel mappings appear in multiple places (this card, expandable card, and the detail screen). Consider centralizing the state+speed→(color,label) mapping in a shared utility and reusing it here to prevent future inconsistencies.

Copilot uses AI. Check for mistakes.
@taylorcox75 taylorcox75 marked this pull request as ready for review March 11, 2026 03:03
@taylorcox75
Copy link
Copy Markdown
Owner

@claude[agent] Add release notes for this change in common place and bump package version claude/improve-interface-colours

- Created CHANGELOG.md following Keep a Changelog format
- Documented fix for torrent state colors in v2.1.2
- Included release history from v1.0.0 to v2.1.1
- Bumped version from 2.1.1 to 2.1.2 in package.json

Co-authored-by: taylorcox75 <10939863+taylorcox75@users.noreply.github.com>
@Claude
Copy link
Copy Markdown
Contributor Author

Claude AI commented Mar 11, 2026

@claude[agent] Add release notes for this change in common place and bump package version claude/improve-interface-colours

Added CHANGELOG.md and bumped version to 2.1.2 in commit 3dfce14.

The changelog follows the Keep a Changelog format and includes the release history from v1.0.0 through the current changes. Version updated in package.json from 2.1.1 to 2.1.2.

@taylorcox75
Copy link
Copy Markdown
Owner

@claude[agent] no the changelog lives constants/changelog.ts

only mention color fix in it not clerical

- Removed CHANGELOG.md (changelog lives in constants/changelog.ts for in-app display)
- Added v2.1.2 entry to constants/changelog.ts with color fix description
- Kept version bump to 2.1.2 in package.json

Co-authored-by: taylorcox75 <10939863+taylorcox75@users.noreply.github.com>
@Claude
Copy link
Copy Markdown
Contributor Author

Claude AI commented Mar 11, 2026

@claude[agent] no the changelog lives constants/changelog.ts

only mention color fix in it not clerical

Updated in commit 8da9e58. Removed CHANGELOG.md and added v2.1.2 entry to constants/changelog.ts with only the color fix mentioned.

@taylorcox75 taylorcox75 merged commit bb5201f into main Mar 11, 2026
@taylorcox75 taylorcox75 deleted the claude/improve-interface-colours branch March 11, 2026 03:31
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.

Minor suggestion - non critical - interface colour improvement

3 participants