Skip to content

feat: add shadow ban support for users (#270)#822

Open
dotWee wants to merge 1 commit into
Awesome-Technologies:masterfrom
dotWee:feature/270-enable-shadow-banning
Open

feat: add shadow ban support for users (#270)#822
dotWee wants to merge 1 commit into
Awesome-Technologies:masterfrom
dotWee:feature/270-enable-shadow-banning

Conversation

@dotWee

@dotWee dotWee commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

This PR adds UI controls to view and toggle shadow banning of users via the Synapse Admin API. Shadow banned users can send messages but they won't be delivered to anyone.

  • Add shadow_banned boolean mapping in user data provider
  • Add shadow_banned column in user list
  • Add shadow_banned filter toggle in user list
  • Add shadow_banned toggle with helper text in user edit form
  • Add translations for all 7 languages (en, de, fr, it, ru, fa, zh)
  • Add tests for data mapping, list column, filter, and edit toggle

Closes #270.


Cheers & greets!

Add UI controls to view and toggle shadow banning of users via the
Synapse Admin API. Shadow banned users can send messages but they
won't be delivered to anyone.

- Add shadow_banned boolean mapping in user data provider
- Add shadow_banned column in user list
- Add shadow_banned filter toggle in user list
- Add shadow_banned toggle with helper text in user edit form
- Add translations for all 7 languages (en, de, fr, it, ru, fa, zh)
- Add tests for data mapping, list column, filter, and edit toggle
@dotWee dotWee marked this pull request as ready for review March 31, 2026 14:49
Copilot AI review requested due to automatic review settings March 31, 2026 14:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds shadow ban support to the admin UI by surfacing Synapse’s shadow_banned user flag in the data provider and user management screens, plus translations and related tests (per #270).

Changes:

  • Map shadow_banned from Synapse user payloads into the UI record model.
  • Add shadow_banned column, list filter toggle, and edit-form toggle (with helper text) to the Users resource.
  • Add i18n strings for 7 locales and extend/adjust tests for the new UI/data mapping.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/synapse/dataProvider.ts Adds shadow_banned boolean mapping for users.
src/synapse/dataProvider.test.ts Extends mapping tests to cover shadow_banned and reformats several expectations.
src/resources/users.tsx Adds shadow_banned filter, column, and edit toggle.
src/resources/users.test.tsx Adds UI tests ensuring the new column/filter/toggle render.
src/i18n/en.ts Adds shadow_banned field label, list filter label, and helper text.
src/i18n/de.ts Same as above (German).
src/i18n/fr.ts Same as above (French).
src/i18n/it.ts Same as above (Italian).
src/i18n/ru.ts Same as above (Russian).
src/i18n/fa.ts Same as above (Persian).
src/i18n/zh.ts Same as above (Chinese).
src/i18n/index.d.ts Updates translation message typings for new keys.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/resources/users.tsx
Comment on lines 85 to 110
const userFilters = [
<SearchInput source="name" alwaysOn />,
<BooleanInput source="guests" alwaysOn />,
<BooleanInput label="resources.users.fields.show_deactivated" source="deactivated" alwaysOn />,
<BooleanInput label="resources.users.fields.show_locked" source="locked" alwaysOn />,
<BooleanInput label="resources.users.fields.show_shadow_banned" source="shadow_banned" alwaysOn />,
];

const UserBulkActionButtons = () => (
<>
<ServerNoticeBulkButton />
<BulkDeleteButton
label="resources.users.action.erase"
confirmTitle="resources.users.helper.erase"
mutationMode="pessimistic"
/>
</>
);

export const UserList = (props: ListProps) => (
<List
{...props}
filters={userFilters}
filterDefaultValues={{ guests: true, deactivated: false, locked: false }}
filterDefaultValues={{ guests: true, deactivated: false, locked: false, shadow_banned: false }}
sort={{ field: "name", order: "ASC" }}
actions={<UserListActions />}

Copilot AI Mar 31, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new shadow_banned Boolean filter is wired into the Users list UI (and given a default), but the data provider's getList query builder does not currently include params.filter.shadow_banned in the request query. As a result, toggling this filter (and the default value) will have no effect on API requests. Please plumb shadow_banned through getList (and add/adjust a test asserting the query string includes it).

Copilot uses AI. Check for mistakes.
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.

Feature Request: Shadow Ban users

2 participants