Hide the names of banned users behind a spoiler tag#32424
Conversation
|
Tweaked title, originally thought "banned names" was like profanity detection or something |
b3ceecc to
3127eac
Compare
3127eac to
314b1c7
Compare
314b1c7 to
d6941d0
Compare
d6941d0 to
7e3fc72
Compare
|
T&S team feedback: this is a welcome change - it materially improves the status quo. Longer term, we'd be interested in exploring whether those events should be displayed in the timeline, or be viewable elsewhere. This is a welcome incremental change while we debate that question! |
src/TextForEvent.tsx
Outdated
| ? _t("timeline|m.room.member|ban_reason", { senderName, targetName: "<<TARGET>>", reason }) | ||
| : _t("timeline|m.room.member|ban", { senderName, targetName: "<<TARGET>>" }); | ||
| const targetI = text.indexOf("<<TARGET>>"); |
There was a problem hiding this comment.
This is all sorts of wild, we should not be doing things like this, the 3rd param to _t can apply React element replacers, it may need updates to the i18n strings but that is worth everyone's collective sanity. Again see textForJoinRulesEvent for an example.
There was a problem hiding this comment.
Yeah, didn't think this was the right way! Hopefully better attempt in 42986fc
|
Going to request design review as spoilers are something which is seldom seen by users and not sure if design ever signed them off, this will be putting them a lot more front and centre |
|
I think this is a wonderful idea. Is it using the same spolier UI we already have on element web? |
|
@amshakal yes it is, with the known issue that spoilers do not work for users relying on accessible technologies such as screen readers |
0f03422 to
948a1dd
Compare
src/TextForEvent.tsx
Outdated
| return allowJSX | ||
| ? reason | ||
| ? () => | ||
| _t( | ||
| "timeline|m.room.member|ban_reason_spoiler", | ||
| { | ||
| senderName, | ||
| reason, | ||
| }, | ||
| { | ||
| user: () => <Spoiler>{targetName}</Spoiler>, | ||
| }, | ||
| ) | ||
| : () => | ||
| _t( | ||
| "timeline|m.room.member|ban_spoiler", | ||
| { | ||
| senderName, | ||
| reason, | ||
| }, | ||
| { | ||
| user: () => <Spoiler>{targetName}</Spoiler>, | ||
| }, | ||
| ) | ||
| : reason | ||
| ? () => _t("timeline|m.room.member|ban_reason", { senderName, targetName, reason }) | ||
| : () => _t("timeline|m.room.member|ban", { senderName, targetName }); |
There was a problem hiding this comment.
please no, nested ternary is hellish. I suggest looking at the previous example I pointed you to for something to copy
948a1dd to
8244607
Compare
8244607 to
3ca5726
Compare
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [vectorim/element-web](https://github.com/element-hq/element-web) | patch | `v1.12.11` → `v1.12.12` | --- ### Release Notes <details> <summary>element-hq/element-web (vectorim/element-web)</summary> ### [`v1.12.12`](https://github.com/element-hq/element-web/releases/tag/v1.12.12) [Compare Source](element-hq/element-web@v1.12.11...v1.12.12) #### ✨ Features - Add stable support for MSC4380 invite blocking ([#​31966](element-hq/element-web#31966)). Contributed by [@​richvdh](https://github.com/richvdh). - Hide the names of banned users behind a spoiler tag ([#​32424](element-hq/element-web#32424)). Contributed by [@​andybalaam](https://github.com/andybalaam). - Room list: remove bold effect on selected room ([#​32593](element-hq/element-web#32593)). Contributed by [@​florianduros](https://github.com/florianduros). - Use Compound buttons in auth screens ([#​32562](element-hq/element-web#32562)). Contributed by [@​t3chguy](https://github.com/t3chguy). - Track room list sorting algorithm changes ([#​32556](element-hq/element-web#32556)). Contributed by [@​MidhunSureshR](https://github.com/MidhunSureshR). - Update `sso_redirect_options` to work for Native OIDC ([#​32537](element-hq/element-web#32537)). Contributed by [@​t3chguy](https://github.com/t3chguy). #### 🐛 Bug Fixes - Room list: avoid excessive re-renders on room list store update or filter change ([#​32663](element-hq/element-web#32663)). Contributed by [@​florianduros](https://github.com/florianduros). - Room list: listen to call event to check number of participants ([#​32677](element-hq/element-web#32677)). Contributed by [@​florianduros](https://github.com/florianduros). - Fix invite-specific join errors not being shown ([#​32621](element-hq/element-web#32621)). Contributed by [@​Half-Shot](https://github.com/Half-Shot). - Prevent logging lots of "Browser unsupported" lines ([#​32647](element-hq/element-web#32647)). Contributed by [@​Half-Shot](https://github.com/Half-Shot). - Update critical gradient for room status bar ([#​32575](element-hq/element-web#32575)). Contributed by [@​Half-Shot](https://github.com/Half-Shot). - Room list: avoid header overflowing when too long ([#​32645](element-hq/element-web#32645)). Contributed by [@​florianduros](https://github.com/florianduros). - Room list: center focus outline of room list item ([#​32637](element-hq/element-web#32637)). Contributed by [@​florianduros](https://github.com/florianduros). - Fix misaligned cross in complete security dialog ([#​32614](element-hq/element-web#32614)). Contributed by [@​dbkr](https://github.com/dbkr). - Room list: fix keyboard navigation ([#​32585](element-hq/element-web#32585)). Contributed by [@​florianduros](https://github.com/florianduros). - Don't show empty privacy section ([#​32582](element-hq/element-web#32582)). Contributed by [@​dbkr](https://github.com/dbkr). - Disable room list image dragging ([#​32590](element-hq/element-web#32590)). Contributed by [@​florianduros](https://github.com/florianduros). - Update UserMenu theme toggle to use IconButton ([#​32591](element-hq/element-web#32591)). Contributed by [@​t3chguy](https://github.com/t3chguy). - Room list: make room list item scales with large font size ([#​32523](element-hq/element-web#32523)). Contributed by [@​florianduros](https://github.com/florianduros). </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41OS4yIiwidXBkYXRlZEluVmVyIjoiNDMuNTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiYXV0b21lcmdlIiwiaW1hZ2UiXX0=--> Reviewed-on: https://gitea.alexlebens.dev/alexlebens/infrastructure/pulls/4596 Co-authored-by: Renovate Bot <renovate-bot@alexlebens.net> Co-committed-by: Renovate Bot <renovate-bot@alexlebens.net>
Make banned users' names (which may be offensive) hidden by default.
Demo
rec-2026-02-09_16.43.32.mp4