~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

A moderator reviews, labels, takes down and reports from one dialog

Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:console/moderation-actions
docs/guides/shots/moderating-escalate-sent-dark.png+0−0
A binary file, not shown.
docs/guides/shots/moderating-escalate-sent.png+0−0
A binary file, not shown.
docs/guides/shots/moderating-escalate-sent.txt+4−1
@@ -1,12 +1,15 @@
- main:
- link "← Garden share":
- heading "Moderation" [level=1]
- button "Label someone"
- navigation "The queue":
- link "Open":
- link "Escalated":
- link "Resolved":
- heading "Subjects1" [level=2]
- search:
- text: Find an account
- combobox "Find an account"
- button "Review"
- list:
- listitem:
- text: maximilianaquinces.test Account · Reported on <date> Spam
docs/guides/shots/moderating-found-dark.pngnew+0−0
A binary file, not shown.
docs/guides/shots/moderating-found.pngnew+0−0
A binary file, not shown.
docs/guides/shots/moderating-found.txtnew+18−0
@@ -0,0 +1,18 @@
- dialog "Review":
- heading "Review" [level=2]
- button "Close": ×
- paragraph: frank.test · Account · Not in the queue
- heading "Labels" [level=3]
- paragraph: No labels yet.
- paragraph: "Labels the group has used, to add with a press:"
- button "spam"
- text: Add a label
- textbox "Add a label":
- /placeholder: off-topic
- button "Add"
- paragraph: Apps that follow the group's labels decide what each one does.
- paragraph: Asks apps that follow the group's labels to hide everything this account posted. They stay in the group.
- button "Take down"
- heading "Decision" [level=3]
- paragraph: Nobody has reported them. Report them to put them in the queue, for you or another moderator to decide.
- button "Report this account"
docs/guides/shots/moderating-label-dialog-dark.png+0−0
A binary file, not shown.
docs/guides/shots/moderating-label-dialog.png+0−0
A binary file, not shown.
docs/guides/shots/moderating-label-dialog.txt+23−9
@@ -1,12 +1,26 @@
- dialog "Label someone":
- heading "Label someone" [level=2]
- dialog "Review":
- heading "Review" [level=2]
- button "Close": ×
- paragraph: The group puts the label on their account. Apps that follow the group's labels can act on it.
- text: Their handle
- combobox "Their handle": maximilianaquinces.test
- text: Label
- textbox "Label":
- /placeholder: spam
- paragraph: maximilianaquinces.test · Account · Reported on <date>
- heading "Labels" [level=3]
- paragraph: No labels yet.
- text: Add a label
- textbox "Add a label":
- /placeholder: off-topic
- text: spam
- button "Add"
- paragraph: Apps that follow the group's labels decide what each one does.
- paragraph: Asks apps that follow the group's labels to hide everything this account posted. They stay in the group.
- button "Take down"
- heading "Decision" [level=3]
- text: A note, if you like
- textbox "A note, if you like"
- button "Cancel"
- button "Label them"
- button "Escalate"
- button "Resolve"
- group:
- text: History
- list:
- listitem:
- strong: Reported
- text: by frank.test <date> Spam. Posts the same seed shop link in every thread.
docs/guides/shots/moderating-labelled-dark.png+0−0
A binary file, not shown.
docs/guides/shots/moderating-labelled.png+0−0
A binary file, not shown.
docs/guides/shots/moderating-labelled.txt+10−13
@@ -1,13 +1,10 @@
- listitem:
- text: maximilianaquinces.test Account · Reported on <date> Spam
- button "Review maximilianaquinces.test": Review
- paragraph: Posts the same seed shop link in every thread.
- group:
- text: History
- list:
- listitem:
- strong: Reported
- text: by frank.test <date> Spam. Posts the same seed shop link in every thread.
- listitem:
- strong: Labelled
- text: by dan.test <date> spam
- heading "Labels" [level=3]
- list:
- listitem:
- text: spam
- button "Remove the label spam": ×
- text: Add a label
- textbox "Add a label":
- /placeholder: off-topic
- button "Add"
- paragraph: Apps that follow the group's labels decide what each one does.
docs/guides/shots/moderating-queue-dark.png+0−0
A binary file, not shown.
docs/guides/shots/moderating-queue.png+0−0
A binary file, not shown.
docs/guides/shots/moderating-queue.txt+4−1
@@ -1,12 +1,15 @@
- main:
- link "← Garden share":
- heading "Moderation" [level=1]
- button "Label someone"
- navigation "The queue":
- link "Open":
- link "Escalated":
- link "Resolved":
- heading "Subjects2" [level=2]
- search:
- text: Find an account
- combobox "Find an account"
- button "Review"
- list:
- listitem:
- text: maximilianaquinces.test Account · Reported on <date> Spam
docs/guides/shots/moderating-remove-dialog-dark.png+0−0
A binary file, not shown.
docs/guides/shots/moderating-resolve-dialog-dark.png+0−0
A binary file, not shown.
docs/guides/shots/moderating-resolve-dialog.png+0−0
A binary file, not shown.
docs/guides/shots/moderating-resolve-dialog.txt+6−10
@@ -1,10 +1,6 @@
- dialog "Resolve or escalate":
- heading "Resolve or escalate" [level=2]
- button "Close": ×
- paragraph: maximilianaquinces.test · Account
- paragraph: Resolve it once it's dealt with, or escalate it for someone else to look at.
- text: A note, if you like
- textbox "A note, if you like": Taken down and removed from the group.
- button "Cancel"
- button "Escalate"
- button "Resolve"
- heading "Decision" [level=3]
- text: A note, if you like
- textbox "A note, if you like": Taken down and removed from the group.
- button "Cancel"
- button "Escalate"
- button "Resolve"
docs/guides/shots/moderating-takedown-dark.png+0−0
A binary file, not shown.
docs/guides/shots/moderating-takedown.png+0−0
A binary file, not shown.
docs/guides/shots/moderating-takedown.txt+13−16
@@ -1,16 +1,13 @@
- listitem:
- text: maximilianaquinces.test Account · Reported on <date> Spam
- button "Review maximilianaquinces.test": Review
- paragraph: Posts the same seed shop link in every thread.
- group:
- text: History
- list:
- listitem:
- strong: Reported
- text: by frank.test <date> Spam. Posts the same seed shop link in every thread.
- listitem:
- strong: Labelled
- text: by dan.test <date> spam
- listitem:
- strong: Labelled
- text: by dan.test <date> !takedown
- heading "Labels" [level=3]
- list:
- listitem:
- text: spam
- button "Remove the label spam": ×
- listitem:
- text: "!takedown"
- button "Remove the label !takedown": ×
- text: Add a label
- textbox "Add a label":
- /placeholder: off-topic
- button "Add"
- paragraph: Apps that follow the group's labels decide what each one does.
docs/guides/moderating.md+53−45
@@ -67,14 +67,14 @@ the tabs.
When a report is not yours to decide, escalate it.
1. Press **Review** on the post's row. The dialog **Resolve or escalate**
opens.
2. Under **A note, if you like**, type why, such as "Third time this
month; over to the admins."
1. Press **Review** on the post's row. The dialog **Review** opens, with
everything you can do about the post and its history.
2. Under **Decision**, in **A note, if you like**, type why, such as
"Third time this month; over to the admins."
3. Press **Escalate**. The dialog closes, and the subject leaves the
**Open** tab.
<!-- look /g/gardens.groups.test/moderation --as frank --click 'button[popovertarget=resolve-1]' --type '#resolve-1 [name=note]=Third time this month; over to the admins.' --click '#resolve-1 button[value=escalated]' --element main -->
<!-- look /g/gardens.groups.test/moderation --as frank --click 'li.subject:has(> .row-main .who:text-is("frank.test")) > .row-actions button' --type ':popover-open [name=note]=Third time this month; over to the admins.' --click ':popover-open button[value=escalated]' --element main -->
![The Open tab after escalating, Subjects 1: only the account reported for spam is left](shots/moderating-escalate-sent.png)
The post now waits on the **Escalated** tab, your note in its history.
@@ -82,54 +82,63 @@ The post now waits on the **Escalated** tab, your note in its history.
## How do I label an account?
A label is a tag the group puts on an account, such as "spam". Apps that
follow the group's labels decide what to do with it. Two labels mean
more: `!takedown` and `!hide`, which the next part shows. Any other
word is yours to choose.
follow the group's labels decide what to do with it. Any word is yours to
choose, but two mean more: `!takedown` and `!hide`, which the next part
shows.
The console cannot take a label back. Only a terminal can, so check the
label before you send it.
1. Press **Review** on the account's row.
2. Under **Add a label**, type the label, such as "spam".
The dialog asks for the account's handle, as the queue shows it.
<!-- look /g/gardens.groups.test/moderation --as dan --click 'li.subject:has(> .row-main .who:text-is("maximilianaquinces.test")) > .row-actions button' --type ':popover-open input[name=val]:not([type=hidden])=spam' --element ':popover-open' -->
![The Review dialog for maximilianaquinces.test, No labels yet, and spam typed under Add a label, with Add](shots/moderating-label-dialog.png)
1. Press **Label someone**.
2. Under **Their handle**, type the account's handle, such as
"maximilianaquinces.test".
3. Under **Label**, type the label, such as "spam".
3. Press **Add**. The dialog stays open, and the label shows under
**Labels**, with a × beside it.
<!-- look /g/gardens.groups.test/moderation --as dan --click 'button[popovertarget=label]' --type '#label-handle=maximilianaquinces.test' --type '[name=val]=spam' --element ':popover-open' -->
![The Label someone dialog, maximilianaquinces.test under Their handle and spam under Label, with Cancel and Label them](shots/moderating-label-dialog.png)
<!-- look /g/gardens.groups.test/moderation --as dan --click 'li.subject:has(> .row-main .who:text-is("maximilianaquinces.test")) > .row-actions button' --type ':popover-open input[name=val]:not([type=hidden])=spam' --click ':popover-open .row-form button[type=submit]' --element ':popover-open .review-part' -->
![The Labels part of the dialog, the label spam with a × beside it](shots/moderating-labelled.png)
4. Press **Label them**. The dialog closes, and the account's history
gains a line saying it was labelled.
Press the × to take a label back. Once the group has used a label, the
dialog offers it to add with one press, under the field.
<!-- look /g/gardens.groups.test/moderation --as dan --click 'button[popovertarget=label]' --type '#label-handle=maximilianaquinces.test' --type '[name=val]=spam' --click ':popover-open button[type=submit]' --click 'li.subject:has-text("maximilianaquinces.test") summary' --element 'li.subject:has-text("maximilianaquinces.test")' -->
![The account's row, its history open and ending in Labelled by dan.test, spam](shots/moderating-labelled.png)
If the handle is not found, the dialog stays open and says so. The
dialog labels accounts only.
Posts are labelled from a terminal only, as the last part shows.
## How do I take an account down?
A takedown asks apps to hide what an account posted. The host writes
the label but hides nothing itself. Apps that follow the group's labels
do the hiding. The account stays in the group until you remove it, as
the next part shows.
the label `!takedown` but hides nothing itself. Apps that follow the
group's labels do the hiding. The account stays in the group until you
remove it, as the next part shows.
The dialog shows **Take down** only to a role with `takedown`.
1. In the account's Review, press **Take down**, beside the line on
what a takedown does.
2. Press **Take down** again in the dialog that asks you to be sure.
<!-- look /g/gardens.groups.test/moderation --as dan --click 'li.subject:has(> .row-main .who:text-is("maximilianaquinces.test")) > .row-actions button' --click ':popover-open button[popovertarget$=takedown]' --click '[id$=-takedown]:popover-open button[type=submit]' --element ':popover-open .review-part' -->
![The Labels part of the dialog, the labels spam and !takedown, each with a ×](shots/moderating-takedown.png)
The label `!takedown` shows under **Labels**. Press its × to undo the
takedown. The label `!hide` works the same way: type it under **Add a
label**. Both need the same permission.
## How do I act on someone nobody reported?
There is no takedown button. You type the label `!takedown` in the same
dialog, and it needs a role with `takedown`.
You can label, take down or report anyone in the group, reported or not.
1. Press **Label someone**.
2. Under **Their handle**, type "maximilianaquinces.test".
3. Under **Label**, type "!takedown".
4. Press **Label them**. The account's history gains a line for the
takedown.
1. Under **Find an account**, at the top of the queue, type their
handle, such as "frank.test".
2. Press **Review** beside it. Their Review opens. If nobody has reported them, it
says **Not in the queue**, and in place of a decision it offers
**Report this account**.
<!-- look /g/gardens.groups.test/moderation --as dan --click 'button[popovertarget=label]' --type '#label-handle=maximilianaquinces.test' --type '[name=val]=!takedown' --click ':popover-open button[type=submit]' --click 'li.subject:has-text("maximilianaquinces.test") summary' --element 'li.subject:has-text("maximilianaquinces.test")' -->
![The account's row, its history ending in labels spam and !takedown, both by dan.test](shots/moderating-takedown.png)
<!-- look /g/gardens.groups.test/moderation --as dan --type '#find-handle=frank.test' --click 'form.find button[type=submit]' --element ':popover-open' -->
![The Review dialog for frank.test, Account, Not in the queue, with Labels, Take down and Report this account](shots/moderating-found.png)
The label `!hide` works the same way and needs the same permission. A
moderator without it is refused, and the dialog stays open with the
words "missing takedown".
To put them in the queue for you or another moderator to decide, press
**Report this account**, choose why, and send the report. They go into the **Open**
tab with your report, as a member's report would.
## How do I remove someone from the group?
@@ -157,11 +166,11 @@ they can ask to join again.
## How do I resolve a report?
1. On the Moderation page, press **Review** on the account's row.
2. Under **A note, if you like**, type what was done, such as "Taken down
and removed from the group."
2. Under **Decision**, in **A note, if you like**, type what was done,
such as "Taken down and removed from the group."
<!-- look /g/gardens.groups.test/moderation --as dan --click 'button[popovertarget=resolve-0]' --type '#resolve-0 [name=note]=Taken down and removed from the group.' --element ':popover-open' -->
![The Resolve or escalate dialog for maximilianaquinces.test's account, the note Taken down and removed from the group. typed, with Cancel, Escalate and Resolve](shots/moderating-resolve-dialog.png)
<!-- look /g/gardens.groups.test/moderation --as dan --click 'li.subject:has(> .row-main .who:text-is("maximilianaquinces.test")) > .row-actions button' --type ':popover-open [name=note]=Taken down and removed from the group.' --element ':popover-open .review-part:has([name=note])' -->
![The Decision part of the Review dialog, the note Taken down and removed from the group. typed, with Cancel, Escalate and Resolve](shots/moderating-resolve-dialog.png)
3. Press **Resolve**. The subject moves to the **Resolved** tab, with
all that was done and your note in its history.
@@ -182,8 +191,7 @@ Each act here has a command in [the `opensocial` command](../reference/cli.md):
A takedown is the same with `!takedown`.
- Label a post: `opensocial mod label gardens.groups.test <at:// uri> <label> --cid <cid>`.
Only the terminal labels posts.
- Take a label back: the same command with `--undo`. Only the terminal
does this.
- Take a label back: the same command with `--undo`.
- Remove a member: `opensocial member eject gardens.groups.test maximilianaquinces.test`.
No command makes a report. An AI app connected to the group has the same
harness/e2e/flows.spec.mjs+46−27
@@ -697,40 +697,59 @@ test('adding a recovery key, and removing it', async () => {
test('moderating: a label, and the queue', async () => {
await page.goto(url('/g/hikers.groups.test'));
await page.getByRole('link', { name: 'Moderation' }).click();
// A subject's row, by its handle, not those whose history names it.
const row = (handle) =>
page
.locator('li.subject')
.filter({ has: page.locator(':scope > .row-main .who', { hasText: handle }) });
const review = page.getByRole('dialog', { name: 'Review' }).filter({ visible: true });
// Putting him out is already in the queue, on him.
const ejected = page.locator('.subject', { hasText: who.bob.handle });
await expect(ejected.locator('.events')).toContainText('Removed');
await page.getByRole('button', { name: 'Label someone' }).click();
await page.getByRole('combobox', { name: 'Their handle' }).fill('bob.test');
await page.getByRole('textbox', { name: 'Label' }).fill('troll');
await page.getByRole('button', { name: 'Label them' }).click();
const subject = page.locator('.subject', { hasText: who.bob.handle });
await expect(subject.locator('.events')).toContainText('troll');
await expect(row(who.bob.handle).locator(':scope > .history .events')).toContainText('Removed');
// Found by his handle, he is reviewed where his row is.
await page.getByRole('combobox', { name: 'Find an account' }).fill(who.bob.handle);
await page.getByRole('search').getByRole('button', { name: 'Review' }).click();
await review.getByRole('textbox', { name: 'Add a label' }).fill('troll');
await review.getByRole('button', { name: 'Add', exact: true }).click();
await expect(review.locator('.labels')).toContainText('troll');
// Taken off, it is a label the group has used, to put back with a press.
await review.getByRole('button', { name: 'Remove the label troll' }).click();
await expect(review.locator('.labels')).toHaveCount(0);
await review.locator('.label-choices').getByRole('button', { name: 'troll' }).click();
await expect(review.locator('.labels')).toContainText('troll');
// Taking him down asks first.
await review.getByRole('button', { name: 'Take down' }).click();
await page
.getByRole('dialog', { name: 'Take this account down?' })
.getByRole('button', { name: 'Take down' })
.click();
await expect(review.locator('.labels')).toContainText('!takedown');
// Escalated with a note, it leaves the open queue for the escalated.
await subject.getByRole('button', { name: 'Review' }).click();
const resolving = page
.getByRole('dialog', { name: 'Resolve or escalate' })
.filter({ visible: true });
await resolving.getByRole('textbox', { name: 'A note, if you like' }).fill('Asked him to stop');
await resolving.getByRole('button', { name: 'Escalate' }).click();
await expect(page.locator('.subject', { hasText: who.bob.handle })).toHaveCount(0);
await review.getByRole('textbox', { name: 'A note, if you like' }).fill('Asked him to stop');
await review.getByRole('button', { name: 'Escalate' }).click();
await expect(row(who.bob.handle)).toHaveCount(0);
await page
.getByRole('navigation', { name: 'The queue' })
.getByRole('link', { name: 'Escalated' })
.click();
await expect(
page.locator('.subject', { hasText: who.bob.handle }).locator('.events')
).toContainText(/Escalated by[\s\S]*Asked him to stop/);
await page
.locator('.subject', { hasText: who.bob.handle })
.getByRole('button', { name: 'Review' })
.click();
await resolving.getByRole('button', { name: 'Resolve' }).click();
await expect(resolving).toHaveCount(0);
await expect(row(who.bob.handle).locator(':scope > .history .events')).toContainText(
/Escalated by[\s\S]*Asked him to stop/
);
await row(who.bob.handle).getByRole('button', { name: 'Review' }).click();
await review.getByRole('button', { name: 'Resolve' }).click();
await expect(review).toHaveCount(0);
await page.goto(url('/g/hikers.groups.test/moderation?status=resolved'));
await expect(
page.locator('.subject', { hasText: who.bob.handle }).locator('.events')
).toContainText('Resolved');
await expect(row(who.bob.handle).locator(':scope > .history .events')).toContainText('Resolved');
// Someone nobody reported is reported from their review, into the open queue.
await page.goto(url('/g/hikers.groups.test/moderation'));
await page.getByRole('combobox', { name: 'Find an account' }).fill(who.dan.handle);
await page.getByRole('search').getByRole('button', { name: 'Review' }).click();
await expect(review).toContainText('Not in the queue');
await review.getByRole('button', { name: 'Report this account' }).click();
const reporting = page.getByRole('dialog', { name: 'Report an account' });
await reporting.getByRole('radio', { name: 'Rude' }).check();
await reporting.getByRole('textbox', { name: 'What happened' }).fill('Shouted at a newcomer.');
await reporting.getByRole('button', { name: 'Report', exact: true }).click();
await expect(row(who.dan.handle)).toContainText('Shouted at a newcomer.');
});
test('signing an app in as her group', async () => {
web/src/lib/molecules/Dialog.svelte+8−0
@@ -7,20 +7,28 @@
* button to close it, then `children`. Light dismiss closes it too, as a
* popover does, with no script. `wide` for one with much in it. Closed,
* however it closes, what was typed into it goes, and `onclose` is told.
* `opened` opens it whenever it turns true, as the page is drawn or
* drawn again, for a page that is asked for with it open.
*/
let {
id,
title,
wide = false,
opened = false,
onclose,
children
}: {
id: string;
title: string;
wide?: boolean;
opened?: boolean;
onclose?: () => void;
children: Snippet;
} = $props();
$effect(() => {
const el = document.getElementById(id);
if (opened && !el?.matches(':popover-open')) el?.showPopover();
});
// Opened, the first thing to fill in is the one being typed into.
function toggled(e: ToggleEvent) {
if (e.newState !== 'open') {
web/src/lib/molecules/SubjectHistory.sveltenew+36−0
web/src/lib/organisms/FindAccount.sveltenew+24−0
web/src/lib/organisms/LabelDialog.sveltedeleted+0−14
web/src/lib/organisms/ModerationQueue.svelte+63−132
web/src/lib/organisms/ReportDialog.sveltenew+48−0
web/src/lib/organisms/ReviewDialog.sveltenew+187−0
web/src/lib/forms.ts+25−0
web/src/lib/moderation.tsnew+112−0
web/src/routes/g/[handle]/moderation/+page.server.ts+93−16
web/src/routes/g/[handle]/moderation/+page.svelte+13−7
web/src/app.css+78−8