discourse/spec/system/page_objects/pages/admin_groups.rb
Krzysztof Kotlarek d992559cea
UX: Prevent page reload on admin groups search (#35960)
When searching for groups in the admin panel, each keystroke was
triggering a full page reload due to `refreshModel: true` on the filter
query parameter. This made the search experience jarring and unusable
for fast typers.

Changes:
- Remove `refreshModel: true` from filter query param
- Add client-side filtering that manually fetches filtered groups
- Maintain server-side filtering and pagination support
- Keep URL sync for bookmarking/sharing

Demo:

https://github.com/user-attachments/assets/431c6632-d459-417d-9e33-a01e7624e260
2025-11-12 09:26:15 +08:00

26 lines
571 B
Ruby

# frozen_string_literal: true
module PageObjects
module Pages
class AdminGroups < AdminBase
def visit
page.visit("/admin/groups")
self
end
def search(filter)
find(".groups-header-filters input").fill_in(with: filter)
self
end
def has_groups?(groups)
page.has_css?(".group-info-name", count: groups.length, wait: 5) &&
all(".group-info-name", wait: 5).map(&:text) == groups
end
def has_no_groups?
page.has_no_css?(".group-info-name")
end
end
end
end