Skip to content

feat: redesign User Management page (avatars, search, skeleton, confirm dialog)#583

Merged
pancacake merged 1 commit into
HKUDS:devfrom
IliaAvdeev:feat/admin-users-redesign
Jun 23, 2026
Merged

feat: redesign User Management page (avatars, search, skeleton, confirm dialog)#583
pancacake merged 1 commit into
HKUDS:devfrom
IliaAvdeev:feat/admin-users-redesign

Conversation

@IliaAvdeev

@IliaAvdeev IliaAvdeev commented Jun 22, 2026

Copy link
Copy Markdown

Description

Redesigns the User Management page (/admin/users) for clarity and scale.
Part 2 of issue #553 (part 1 — profile page + avatar picker — merged in #573).

Changes:

  • Avatars — each row now shows a UserAvatar (32 px) with an amber ring
    and shield badge for admins, reusing the component from feat: user profile page with avatar (account info, icon/image avatar, sign out) #573.

  • Live search — a full-width search bar filters by username
    (case-insensitive, substring, trims whitespace). The counter shows
    N of M users while filtering and a ✕ Clear button resets it.

  • Skeleton loading — replaces the plain "Loading…" text with 3 pulsing
    placeholder rows while the user list fetches.

  • Empty state — when there are no users, shows a Users icon, a heading,
    and an Add user shortcut instead of a bare "No users found." message.

  • No-match state — when search yields nothing, shows a friendly message
    with a Clear search link (no list renders at all).

  • ConfirmDialog — new focus-trapped modal (web/components/ui/ConfirmDialog.tsx)
    replaces all three window.confirm() calls (delete, promote, demote).
    Cancel button takes initial focus so a stray Enter never fires a destructive
    action. Supports tone="danger" (red button) and a busyLabel while
    the request is in flight. Closes on Escape and overlay click.

  • Header fix — Back link moved to its own row above the title

New files:

  • web/components/ui/ConfirmDialog.tsx
  • web/lib/admin-users.ts — pure filterUsersByQuery<T> function
  • web/tests/admin-users-filter.test.ts — 5 node:test unit tests

Related Issues

Module(s) Affected

  • agents
  • api
  • config
  • core
  • knowledge
  • logging
  • services
  • tools
  • utils
  • web (Frontend)
  • docs (Documentation)
  • scripts
  • tests
  • Other: ...

Checklist

  • I have read and followed the contribution guidelines.
  • My code follows the project's coding standards.
  • I have run pre-commit run --all-files and fixed any issues.
  • I have added relevant tests for my changes.
  • I have updated the documentation (if necessary).
  • My changes do not introduce any new security vulnerabilities.

Additional Notes

Tests: filterUsersByQuery is covered by 5 unit tests in
web/tests/admin-users-filter.test.ts (empty query, case-insensitive,
trim, non-latin/Cyrillic, no-match). npm run test:node → 147 passed.
ConfirmDialog and the page component are React — not testable in the
node:test harness; no Playwright e2e precedent exists in this repo for
admin pages.

Screenshots:

State Light Dark
Table 02-table 07-table-dark
Search filter 03-search-filter 08-search-filter-dark
No match 04-no-match 09-no-match-dark
Confirm dialog 05-confirm-delete 10-confirm-delete-dark
Empty state 06-empty-state 11-empty-state-dark

Open to any feedback — if this doesn't fit the project's direction, no worries at all, happy to discuss and rework as needed.

pancacake added a commit that referenced this pull request Jun 23, 2026
refactor: move Back link to its own row in the profile page header

Stacks the Back link above the title on /profile, matching the header
layout the admin Users page also adopts in #583.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@pancacake
pancacake merged commit ae570b4 into HKUDS:dev Jun 23, 2026
11 checks passed
vaskoyudha added a commit to vaskoyudha/deeptutor-for-programmer-fork that referenced this pull request Jul 25, 2026
refactor: move Back link to its own row in the profile page header

Stacks the Back link above the title on /profile, matching the header
layout the admin Users page also adopts in HKUDS#583.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
vaskoyudha added a commit to vaskoyudha/deeptutor-for-programmer-fork that referenced this pull request Jul 25, 2026
feat: redesign admin User Management page (avatars, search, skeleton, confirm dialog)

Part 2 of HKUDS#553. Adds per-row UserAvatar, live username search backed by a
pure filterUsersByQuery helper (unit-tested), skeleton loading, richer
empty/no-match states, and a focus-managed ConfirmDialog replacing the
window.confirm() prompts for delete/promote/demote. Frontend-only; no
auth/permission paths touched.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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