Skip to content

feat(banlist): demo download, comment gates, and in-place comment composer - #29

Merged
maxijabase merged 6 commits into
mainfrom
fix/upstream-1568-demo-comment-gates
Sep 8, 2026
Merged

maxijabase merged 6 commits into
mainfrom
fix/upstream-1568-demo-comment-gates

Conversation

@maxijabase

@maxijabase maxijabase commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Ports the security and demo-list pieces of upstream sbpp#1568, then replaces the public ?comment= page editor with composers that stay on the current view.

Demo download

Comment and demo gates (from sbpp#1568)

  • bans.add_comment / bans.edit_comment for submissions (S) and protests (P) require the matching BanSubmissions / BanProtests flags. A generic web admin can no longer write queue comments.
  • Public ?p=banlist&comment= never opens an S/P editor, even when public comments are on.
  • getdemo.php and bans.add demo attach stay under SB_DEMOS. A bad filename cannot leave an orphan ban or follow a symlink out of the demo root.

Comment composer (this follow-up; different from upstream)

Upstream sbpp#1568 still used a page-level ?comment= editor. We did not port that rewrite. Instead:

Banlist / commslist Add or Edit

  • Before: navigate to ?p=banlist&comment= (or commslist). The list is replaced by a form. Scroll, page number, and open row state are lost.
  • After: opens the player drawer composer. The list stays. After save, the row chip and inline comment list update without a reload.

Protest / submission cards

  • Before: Add Comment bounced to the public banlist editor.
  • After: inline composer on the same card. Save still reloads the queue (cards have no drawer).

Banlist / commslist / drawer Delete

  • Before: after confirm, message.redir reloaded the list (or remounted the drawer). Page 3, mid-page scroll, and an open disclosure all reset.
  • After: the comment <li> is removed in place. Pagination, scroll, open disclosure, and open drawer survive.

Public ?comment=

  • Before: rendered a full-page editor and could leak S/P editors onto the public route.
  • After: not an editor. The list still renders.

Mods chrome and dependency bumps from upstream sbpp#1568 stay out of this PR.

Test plan

  • PHPUnit filter for the comment + demo-attach tests (BansTest, BanlistCommentsVisibilityTest, AdminEditBanDemoTest)
  • Playwright banlist-comments-visibility.spec.ts (drawer compose, table patch on save, in-place table delete, in-place drawer delete)
  • Playwright comment-delete-dispatcher.spec.ts (queue ctype P still confirms + calls the API)
  • Confirm a demo download button appears on ?p=banlist for a row with a demo
  • As a generic web admin without queue flags, S/P comment add/edit is rejected; with the matching flag it succeeds
  • Add/Edit on banlist or commslist opens the drawer, not ?comment=
  • Delete a comment on page 3 with the disclosure open: the comment is gone, scroll and page stay
  • Delete a comment from the open drawer: the drawer stays open, no skeleton remount
  • getdemo.php rejects symlink / path-escape filenames; bans.add rejects malformed or missing demo metadata before INSERT

The drawer already had a download CTA; the public table still hid demos behind that extra click.
A generic web-admin session was enough to write S/P comments. Those records belong to the moderation queues.
Public comments must not open S/P editors. Those records belong to the queues and need the matching flags plus a live parent.
A bad filename must not leave an orphan ban, and getdemo must not follow a symlink out of the demo root.
Add and edit open the player drawer on banlist/commslist, or an inline composer on protest/submission cards. Delete removes the comment in place so pagination, scroll, and open disclosures survive. The public ?comment= page editor is gone.
@maxijabase maxijabase changed the title feat(banlist): demo row download plus comment and demo gates (#1568) feat(banlist): demo download, comment gates, and in-place comment composer Sep 7, 2026
@maxijabase
maxijabase merged commit cfba83f into main Sep 8, 2026
7 checks passed
@maxijabase
maxijabase deleted the fix/upstream-1568-demo-comment-gates branch September 8, 2026 01:11
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.

1 participant