mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #7080] feat(clients): let the admin choose which table columns to show #6636
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6636
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/7080
Author: @Mo7amadd
Created: 11/5/2026
Status: 🔄 Open
Base:
main← Head:feat/clients-column-picker📝 Commits (3)
8569637feat(clients): let the admin choose which table columns to showbf314e7test(clients): cover the column picker1a8fd2dfeat(i18n): add pages.clients.columns to all locales📊 Changes
19 files changed (+274 additions, -2 deletions)
View changed files
➕
frontend/src/pages/clients/ClientColumnPicker.tsx(+58 -0)📝
frontend/src/pages/clients/ClientsPage.css(+5 -0)📝
frontend/src/pages/clients/ClientsPage.tsx(+19 -2)➕
frontend/src/pages/clients/columnVisibility.ts(+69 -0)➕
frontend/src/test/client-column-picker.test.tsx(+109 -0)📝
internal/web/translation/ar-EG.json(+1 -0)📝
internal/web/translation/en-US.json(+1 -0)📝
internal/web/translation/es-ES.json(+1 -0)📝
internal/web/translation/fa-IR.json(+1 -0)📝
internal/web/translation/id-ID.json(+1 -0)📝
internal/web/translation/ja-JP.json(+1 -0)📝
internal/web/translation/pt-BR.json(+1 -0)📝
internal/web/translation/ru-RU.json(+1 -0)📝
internal/web/translation/sk-SK.json(+1 -0)📝
internal/web/translation/tr-TR.json(+1 -0)📝
internal/web/translation/uk-UA.json(+1 -0)📝
internal/web/translation/vi-VN.json(+1 -0)📝
internal/web/translation/zh-CN.json(+1 -0)📝
internal/web/translation/zh-TW.json(+1 -0)📄 Description
Summary
Adds a Columns button next to Filter on the Clients page. It opens a menu of checkboxes to show or hide table columns; the choice is remembered per browser.
Why
Not every column is useful in every setup. On my panel, Speed shows "—" for almost every client, and together with Attached inbounds it pushes Remaining and Duration off-screen on a laptop, so I scroll sideways for the two columns I actually look at.
What changed
ClientColumnPicker.tsx: an antdDropdownmenu with one checkbox per column. It stays open while columns are ticked (only the trigger, an outside click or Escape closes it), opens with focus inside so arrow keys work, and the trigger carriesaria-haspopup/aria-expanded.columnVisibility.ts: the list of hideable columns, thelocalStoragehook (keyclientsHiddenColumns) and two pure helpers the page uses to build the menu options and to applyhiddento the column list.ClientsPage.tsx: the existingcolumnsmemo becomesbaseColumns;columnsis derived from it plus the hidden set. The picker is rendered on desktop only (the mobile card view has no columns).scroll.xchanges from1200to'max-content', so hiding columns can actually remove the horizontal scrollbar. Every column already has an explicit width, so with nothing hidden the table lays out exactly as before.pages.clients.columnsin all 14 locales.Type of change
Areas affected
How was this tested?
npm run typecheck,npm run lint,npm run format:check,npx vitest run --project unit --project components(1982 tests, 5 of them new),npm run buildandnpm run build-storybookpass.src/test/client-column-picker.test.tsxrenders the real picker, the hook and the helpers through an antdTable. Every test was checked against a deliberately broken implementation and goes red:!column.hiddenguard removed → "keeps Group hidden … while no groups exist"npm run devwith a mocked API (120 clients) at 1366×768 and 1920×900, light and dark: tick/untick columns, reload, hide enough columns to make the horizontal scrollbar disappear, switch to mobile width (no button there).Screenshots / recordings
Breaking changes
None. With nothing hidden the table shows the same columns as before.
Checklist
go build ./...and the test suite pass locally. (Frontend-only change; no Go code touched, so the Go suite was not run.)npm run lint,npm run typecheck, andnpm run buildpass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.