Skip to content

feat: Add comprehensive mobile sorting for users table with multilingual support - #37

Merged
x0sina merged 5 commits into
PasarGuard:nextfrom
MatinDehghanian:expire-sort-mobile
Oct 11, 2025
Merged

x0sina merged 5 commits into
PasarGuard:nextfrom
MatinDehghanian:expire-sort-mobile

Conversation

@MatinDehghanian

Copy link
Copy Markdown
Contributor

Overview

Adds comprehensive mobile-friendly sorting functionality to the users table, solving the issue where expire date sorting was only available on desktop devices.

Technical Changes

Modified Components

  • src/components/users/filters.tsx - Added sorting dropdown with section organization
  • src/components/users/users-table.tsx - Added handleSort prop integration
  • src/components/users/columns.tsx - Cleaned up unused mobile sorting code

Translation Files Updated

  • public/statics/locales/en.json - English translations
  • public/statics/locales/fa.json - Persian translations
  • public/statics/locales/ru.json - Russian translations
  • public/statics/locales/zh.json - Chinese translations

UI/UX Improvements

  • Visual Feedback: Blue dot indicator when custom sorting is active
  • Section Organization: Clear grouping by Username, Expire Date, and Data Usage
  • Intuitive Icons: User, Calendar, and ChartPie icons for each section
  • Active State: Highlighting and chevron indicators for current sort
  • Responsive Design: Works perfectly on mobile, tablet, and desktop

Quality Assurance

  • ✅ Zero TypeScript errors introduced
  • ✅ Maintains all existing functionality
  • ✅ Defensive programming with null checks
  • ✅ Clean code with proper imports
  • ✅ Consistent with existing design patterns

Problem Solved

Previously, users on mobile devices couldn't sort by expire date or other columns, limiting table functionality. This PR provides a comprehensive solution that:

  • Makes all sorting options available on mobile
  • Improves discoverability by centralizing sort options
  • Maintains desktop functionality unchanged
  • Provides excellent multilingual support

User Impact

  • Mobile users can now sort by any column
  • Better table management on small screens
  • Consistent experience across all devices
  • Clear visual feedback for sorting state

Sort Logic

Maintains existing 3-state cycle: column → -column → default (-created_at)

Translation Keys Added

"sortOptions": "Sort Options",
"sort": {
  "username": { "asc": "Username (A-Z)", "desc": "Username (Z-A)" },
  "expire": { "oldest": "Expire Date (Oldest First)", "newest": "Expire Date (Newest First)" },
  "usage": { "low": "Data Usage (Low to High)", "high": "Data Usage (High to Low)" }
}

@x0sina
x0sina merged commit d21c492 into PasarGuard:next Oct 11, 2025
Free-Guy-IR added a commit to Free-Guy-IR/panel that referenced this pull request Nov 2, 2026
…ain bba95f274

Checked with git ls-remote on 2026-10-11 02:55 UTC. Panel dev moved from
d94e157 to 83fe90e with 22 commits; main is still v5.4.1.

- PasarGuard#879 (2d0ca81, loopback Xray client inbounds) is ported by design: the
  fork took the open pull request on 2026-09-25 as 2e7fc45 with migration
  bfd88026565b, the same listener rewrite.
- PasarGuard#934 (a5b28f3) moves from the port queue to a dated waiver until
  2026-11-09: the fork refuses to delete a core that nodes still use
  (W3-013, fix/node-health) instead of restarting those nodes.
- PasarGuard#993 (Hysteria2 FinalMask without a udp mask) is queued until 2026-10-18:
  the fork has the same FinalMask | dict field and the same non-null-safe
  udpHop reads, so a udpHop-only host can fail the whole subscription.
- PasarGuard#984, PasarGuard#985, PasarGuard#986, PasarGuard#989, PasarGuard#944, PasarGuard#864, PasarGuard#948, PasarGuard#951, PasarGuard#778, PasarGuard#774, PasarGuard#787, PasarGuard#994,
  PasarGuard#865, PasarGuard#875, PasarGuard#718, PasarGuard#967, PasarGuard#772, PasarGuard#662, PasarGuard#995 and PasarGuard#913 are queued as
  security: no until 2026-10-25, each with its reason; PasarGuard#913's node-removal
  half is already in the fork through sync_remove_users.
- The branch commits that upstream squash-merged (the three dashboard
  branches, telegram/tests, fix/core-editor-api-section-followup,
  fix/hwid-count-test-cleanup, fix/hysteria-finalmask-quic-only) follow
  their squash, by patch-id or by an equal tree.

Scripts main moved to bba95f274 (PasarGuard#35, PasarGuard#36, PasarGuard#37 after PasarGuard#34). The three
squashes are queued security: no until 2026-10-25, and their pre-squash
branch commits are waived as superseded (equal trees).

Against live upstream the panel gate now fails only on the 17 port-queue
commits classified security: yes, and the forks gate only on node
f72ac0ef (security: yes). No upstream commit is undecided.
Free-Guy-IR added a commit to Free-Guy-IR/panel that referenced this pull request Nov 4, 2026
… own lines are on fork main

A security fix ported by design counted as carried when a named fork
commit, or an upstream squash merged into fork main, brought any part of
it, so a squash that kept a harmless hunk and dropped the security line
passed the fork gate. For the fork ledgers the gate now checks every hunk
of the upstream commit itself against fork main: each must be on fork
main and brought by one of the commits its reason names, which may be a
chain of several, or be named as missing `<path>:<line>` because
<reason>. An exception without a reason, or one that names a hunk that is
carried or does not exist, is refused. The panel's own ledger keeps the
rule of main, where only a fork commit outside the upstream range carries
a security design port.

The node and scripts ledgers name each hunk of their security design
ports that is not on fork main as it stands upstream, with the reason.
For scripts a7417383 the second hunk is lib/pasarguard-restore.sh:+2247,
whose lines are all on fork main around a condition upstream PasarGuard#37 changed,
not a second Farsi line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants