Skip to content

fix: search roles server-side in the space permissions picker#725

Merged
NagariaHussain merged 5 commits into
developfrom
fix/role-picker-search
Jul 26, 2026
Merged

fix: search roles server-side in the space permissions picker#725
NagariaHussain merged 5 commits into
developfrom
fix/role-picker-search

Conversation

@NagariaHussain

Copy link
Copy Markdown
Member

Problem

Only the first 20 enabled roles were selectable under Space Settings → Permissions. The role list passed pageLength: 0 intending "no limit", but frappe-ui falls back to 20 for a falsy pageLength, and the picker then filtered that single page in the browser — so every role past the first page was unreachable.

Closes #709

Solution

  • Replaced the hand-rolled dropdown with frappe-ui's Combobox. It is reka-ui based, so its portalled popover works inside the settings dialog — which is why the old dropdown was hand-rolled. Keyboard navigation and ARIA combobox semantics come along for free.
  • The typed query now drives a debounced server-side like search on Role instead of a client-side filter over one page.
  • Pick a role to fill the field, then Add it to the table, same as before.
  • Also: the old loading branch read allRoles.loading, which the list resource never exposes, so the spinner never rendered.

Tests

New e2e/tests/space-permissions-role-search.spec.ts seeds a role named to sort last alphabetically, searches for it, adds it and asserts it persisted. Verified it fails against the pre-fix code and passes after.

🤖 Generated with Claude Code

NagariaHussain and others added 5 commits July 26, 2026 15:33
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Only the first 20 enabled roles were ever selectable under Settings ->
Permissions. The list resource passed `pageLength: 0` intending "no
limit", but frappe-ui falls back to 20 for a falsy pageLength, and the
picker then filtered that single page in the browser — so every role
past the first page was unreachable.

Replace the hand-rolled dropdown with frappe-ui's Combobox (reka-ui
based, so its portalled popover works inside the settings dialog) and
drive it from a debounced server-side `like` search. Picking a role now
adds it straight to the table.

Fixes #709

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Selecting a role committed the row immediately, which read as abrupt next
to the rest of the panel. The Combobox fills the field again and Add
commits it, as before.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Jul 26, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge.

No concrete changed-code failure was established from the available repository evidence.

Reviews (1): Last reviewed commit: "style(permissions): make the Beta badge ..." | Re-trigger Greptile

@NagariaHussain
NagariaHussain merged commit d349d11 into develop Jul 26, 2026
10 checks passed
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.

Not all roles are shown/searchable under Settings -> Permissions

1 participant