[PR #5150] [MERGED] feat(clients): restore traffic usage progress bars on Clients page #5795

Closed
opened 2026-11-02 04:04:07 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5150
Author: @nima1024m
Created: 6/9/2026
Status: ✅ Merged
Merged: 6/11/2026
Merged by: @MHSanaei

Base: main ← Head: feature/client-traffic-progress-bar


📝 Commits (3)

  • e217850 feat(clients): restore traffic usage progress bars on Clients page
  • a1b940d Merge branch 'main' into feature/client-traffic-progress-bar
  • 3abfad7 Merge branch 'main' into feature/client-traffic-progress-bar

📊 Changes

5 files changed (+314 additions, -11 deletions)

View changed files

➕ frontend/src/components/clients/ClientTrafficCell.css (+90 -0)
➕ frontend/src/components/clients/ClientTrafficCell.tsx (+85 -0)
➕ frontend/src/lib/clients/traffic-display.ts (+64 -0)
📝 frontend/src/pages/clients/ClientsPage.tsx (+20 -11)
➕ frontend/src/test/client-traffic-display.test.ts (+55 -0)

📄 Description

Summary

  • Restore the v2.9.x Clients traffic column UX: used | progress bar | limit/∞ layout
  • Hover/tap popover shows ↑ upload, ↓ download, and remaining traffic
  • Color states: green/orange/red by quota, purple for unlimited, gray when disabled, exception when depleted
  • Compact progress bars on mobile client cards

Why

The React v3 rewrite replaced progress bars with plain text (401 MB / 94 GB), making quota usage harder to scan at a glance. This brings back the familiar visual pattern from v2.9.x without backend changes.

Screenshots

desktop mobile

Files affected

  • frontend/src/components/clients/ClientTrafficCell.tsx — reusable traffic cell + popover
  • frontend/src/components/clients/ClientTrafficCell.css — pill layout styling
  • frontend/src/lib/clients/traffic-display.ts — percent/color/status helpers
  • frontend/src/pages/clients/ClientsPage.tsx — wire into desktop table + mobile cards
  • frontend/src/test/client-traffic-display.test.ts — unit tests

Test plan

  • npx tsc --noEmit
  • npx vitest run src/test/client-traffic-display.test.ts (5 passed)
  • Manual desktop: Clients table shows bars for limited/unlimited/depleted/disabled clients
  • Manual mobile: compact bars on client cards
  • Hover popover shows ↑/↓/remained breakdown

Risks

  • Frontend-only change; no API or migration impact
  • Remaining column kept as-is (tags) alongside the new bar

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/5150 **Author:** [@nima1024m](https://github.com/nima1024m) **Created:** 6/9/2026 **Status:** ✅ Merged **Merged:** 6/11/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `feature/client-traffic-progress-bar` --- ### 📝 Commits (3) - [`e217850`](https://github.com/MHSanaei/3x-ui/commit/e217850d1c6c6b2afc0c4cbc0694c938d11f096c) feat(clients): restore traffic usage progress bars on Clients page - [`a1b940d`](https://github.com/MHSanaei/3x-ui/commit/a1b940d4d520635e2452e1cc140ca66e54bab3da) Merge branch 'main' into feature/client-traffic-progress-bar - [`3abfad7`](https://github.com/MHSanaei/3x-ui/commit/3abfad7739c55c6380b35618f4f238d3de39a612) Merge branch 'main' into feature/client-traffic-progress-bar ### 📊 Changes **5 files changed** (+314 additions, -11 deletions) <details> <summary>View changed files</summary> ➕ `frontend/src/components/clients/ClientTrafficCell.css` (+90 -0) ➕ `frontend/src/components/clients/ClientTrafficCell.tsx` (+85 -0) ➕ `frontend/src/lib/clients/traffic-display.ts` (+64 -0) 📝 `frontend/src/pages/clients/ClientsPage.tsx` (+20 -11) ➕ `frontend/src/test/client-traffic-display.test.ts` (+55 -0) </details> ### 📄 Description ## Summary - Restore the v2.9.x Clients traffic column UX: **used | progress bar | limit/∞** layout - Hover/tap popover shows ↑ upload, ↓ download, and remaining traffic - Color states: green/orange/red by quota, purple for unlimited, gray when disabled, exception when depleted - Compact progress bars on mobile client cards ## Why The React v3 rewrite replaced progress bars with plain text (`401 MB / 94 GB`), making quota usage harder to scan at a glance. This brings back the familiar visual pattern from v2.9.x without backend changes. ## Screenshots <img width="714" height="477" alt="desktop" src="https://github.com/user-attachments/assets/b30aa325-1fa0-46b4-a54c-cd931de156c4" /> <img width="374" height="606" alt="mobile" src="https://github.com/user-attachments/assets/c31e7796-769d-4292-86d7-e33e08742c86" /> ## Files affected - `frontend/src/components/clients/ClientTrafficCell.tsx` — reusable traffic cell + popover - `frontend/src/components/clients/ClientTrafficCell.css` — pill layout styling - `frontend/src/lib/clients/traffic-display.ts` — percent/color/status helpers - `frontend/src/pages/clients/ClientsPage.tsx` — wire into desktop table + mobile cards - `frontend/src/test/client-traffic-display.test.ts` — unit tests ## Test plan - [x] `npx tsc --noEmit` - [x] `npx vitest run src/test/client-traffic-display.test.ts` (5 passed) - [x] Manual desktop: Clients table shows bars for limited/unlimited/depleted/disabled clients - [x] Manual mobile: compact bars on client cards - [x] Hover popover shows ↑/↓/remained breakdown ## Risks - Frontend-only change; no API or migration impact - Remaining column kept as-is (tags) alongside the new bar --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:04:07 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#5795
No description provided.