Skip to content

Support filtering Beatmap Discussion by multiple users#12939

Open
notbakaneko wants to merge 21 commits into
ppy:masterfrom
notbakaneko:feature/discussions-replies-user-filter-multiselect-rebased
Open

Support filtering Beatmap Discussion by multiple users#12939
notbakaneko wants to merge 21 commits into
ppy:masterfrom
notbakaneko:feature/discussions-replies-user-filter-multiselect-rebased

Conversation

@notbakaneko
Copy link
Copy Markdown
Collaborator

@notbakaneko notbakaneko commented Apr 23, 2026

Filter by multiple users, include/exclude replies, hide/include replies from other users within the discussion.
Also moves the filters down to be next to the discussions closer with all the other sorting and filter options, and pins them to the top for easier access.

image

with a user selected:
image

I did think about putting all the usernames selected as the main dropdown text but it just gets long and truncated so I went with Multiple users selected instead...

closes #11666

@computed
private get visibleReplies() {
if (this.props.discussionsState == null
|| this.props.discussionsState.selectedUserIds.size === 0
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

there's an existing issue if the url param contains a user id that isn't in the discussions, I wonder if state initialization should sanitize and normalize the urls first 🤔

@nanaya
Copy link
Copy Markdown
Collaborator

nanaya commented Apr 27, 2026

The floating bar seems like something people will be annoyed with as it takes up vertical space...? (and even worse on mobile)

@notbakaneko
Copy link
Copy Markdown
Collaborator Author

I did have an idea of adding the filters into the floating toolbar as a popup but that would have been a next step.

Also realized the filter font sizes not shrinking down when the other tabbar sticky does looks odd...

@nanaya
Copy link
Copy Markdown
Collaborator

nanaya commented Apr 27, 2026

maybe a toggle button on the page tab bar?

@notbakaneko notbakaneko force-pushed the feature/discussions-replies-user-filter-multiselect-rebased branch from 90631bb to 4491f7f Compare April 28, 2026 14:56
@notbakaneko
Copy link
Copy Markdown
Collaborator Author

how about a collapsible bar? 🤔
image

@nanaya
Copy link
Copy Markdown
Collaborator

nanaya commented May 11, 2026

that looks weird and the expanded view takes even more space ಠ_ಠ

it being still collapsed when scrolled up seems a bit pointless as well (and it should not be floating by default either?)

@notbakaneko
Copy link
Copy Markdown
Collaborator Author

I don't think stacking even more optionally pinable elements is the solution and looks even more weird, and having a toggle button in the tab bar that can also scroll sideways doesn't make sense either (and does nothing on the history tab).

@nanaya
Copy link
Copy Markdown
Collaborator

nanaya commented May 12, 2026

how about just not make it floatable/pinnable for now...?

(also the new one cuts off the user list dropdown when it's too long instead of extending the page, although it really should just have its height limited and show scrollbar instead)

@notbakaneko
Copy link
Copy Markdown
Collaborator Author

Removing the pinning for now so the feature can go out while I try something else out, but that has some refactoring involved and may have additional changes that conflict

Comment thread resources/css/bem/page-extra-tabs.less Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should be removed/renamed?

text: (
<>
<div className='osu-switch-v2'>
<input
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

input can't be inside an a

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm just removing the link instead of adding more workarounds for this, since it also doesn't seem to make sense to open in new tab with multi selection options.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

but button can't have input either ಠ_ಠ (and it just doesn't make sense if you think about it - like, are you checking the box or pressing the button)

even worse, div can't be inside button.

maybe add --checked, --checkbox modifiers to the class and use divs instead? It's not like the checkbox itself have much meaning in term of actual input.

@notbakaneko notbakaneko force-pushed the feature/discussions-replies-user-filter-multiselect-rebased branch 5 times, most recently from 1ad3908 to d1b7209 Compare May 22, 2026 14:58
Comment thread resources/js/components/icon-expand.tsx Outdated
interface Props {
expand: boolean;
parentClass: string;
parentClass?: string;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

where's this needed?

Comment on lines +111 to +113
<span className={`${bn}__checkmark`}>
{selected && <span className='fas fa-check' />}
</span>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

technically can be done using the fa-fw class instead (className={`fa-fw ${selected ? ... }`}) although that'll ignore the decoration colour thing

but then again the --colour/--decoration-colour thing don't seem to be used anywhere at the moment...

Comment on lines +20 to +21
display: grid;
grid-template-columns: minmax(0, 500px) repeat(var(--num-columns), auto);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what does this do over just flex/row 🤔 (which would remove the need to specify the num-columns)

'user_filter' => [
'everyone' => 'Everyone',
'label' => 'Filter by user',
'multiple' => 'Multiple users selected',
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I wonder if showing the selected count would be useful

@@ -70,7 +70,9 @@ export default class DiscussionsState {
@observable repliesIncludeSelectedUsers = false;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

already mentioned somewhere else but this addition should've also updated the user listing to include replying users

Comment thread resources/css/bem/counter-box.less Outdated
.@{top}--beatmap-discussions & {
margin-right: 10px;
&--beatmap-discussions {
margin-right: 0;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

or make it a variable and replace it in the block's modifier?

Comment on lines +347 to +349
if (reply.system) yield reply;
if (!this.props.discussionsState.showOtherReplies && !this.props.discussionsState.selectedUserIds.has(reply.user_id)) continue;
yield reply;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

reply.system may end up being yielded twice

(also the only usage of this generator does ...thisGenerator() anyway so might as well return plain array instead?)

</button>
<button
className={`${bn}__item ${bn}__item--link`}
onClick={this.toggleShowOtherReplies}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

probably fine as is for now but it's kind of weird the checkbox options don't persist on reload/modify the url like the other filters in the same section

return (
<SelectOptions
href={this.props.discussionsState.url}
blackout={false} // css sticky elements render on a different stacking context and always get covered by the blackout.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the comment may get confusing without it being sticky

@notbakaneko notbakaneko force-pushed the feature/discussions-replies-user-filter-multiselect-rebased branch from d1b7209 to bca7a3e Compare May 29, 2026 08:06
don't assume system post doesn't match other conditions
export default function IconExpand({ expand = false, parentClass }: Props) {
return (
<span className={`icon-stack ${parentClass}`}>
<span className={`icon-stack ${parentClass ?? ''}`}>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

not nullable atm 🤔

text: <span className='u-group-colour u-ellipsis-overflow' style={this.styleForUser(user)}>{user.username}</span>,
};
};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the spacing should probably stay

return this.discussionsState.beatmapset.user_id;
}

// TODO: add actual multi user selection.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the comment can be removed?

Comment on lines +53 to +55
@media @desktop {
display: contents;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

seems fine without?

gap: 5px;
flex: none;

&--link {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

all of them have this modifier? might as well make this the default and remove the modifier?

(also they are buttons...?)

render() {
return (
<>
<div className='beatmapset-discussions-toolbar'>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

some others use bn variable, some others like this one use the name directly...


render() {
return (
<>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this wrapper doesn't do anything

if (!canModeratePosts()) return null;

return (
<button
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

extracting this button to its own component/function may be nice?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sorting by multiple people on Beatmap's Discussion page

2 participants