microsoft / microsoft/simplechat

Allow admins to archive or delete safety violations from the admin page

Open
#988 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
153
Forks
116
Avg merge
7h 7m
Merged PRs (30d)
122

Description

Summary

Admins need a way to remove safety violation records from the active Safety Violations admin queue by archiving them, and where appropriate, permanently deleting them from the admin page.

User Value

Safety violation admins can keep the review queue clean after remediation, reduce noise in operational dashboards, and remove records that should no longer be retained in the active admin workflow.

Proposed Behavior

  • Add archive controls to the Safety Violations admin page for authorized safety violation admins.
  • Archived violations should be hidden from the default active queue, stats, and export results unless the admin explicitly filters for archived records.
  • Provide an archived-record view/filter so admins can audit archived violations and, if supported by the implementation, restore them to the active queue.
  • Add a separate permanent delete action only behind an explicit confirmation flow, with clear destructive wording.
  • Ensure archive/delete actions refresh the list, cards, stats, pagination, and CSV export behavior consistently.
  • Preserve authorization boundaries: only authenticated users who satisfy the SafetyViolationAdmin admin page requirements should be able to archive or delete records.

Acceptance Criteria

  • The admin Safety Violations page exposes archive/delete actions from the list/card/detail workflow without affecting the user-facing “My Safety Violations” profile tab unexpectedly.
  • Archiving a violation records who archived it and when, hides it from the default admin queue, and allows admins to filter/view archived records.
  • Permanent deletion requires an explicit confirmation and removes the violation record from storage only after server-side authorization succeeds.
  • Backend routes for archive/delete are protected with the existing Swagger, login, SafetyViolationAdmin, and content-safety-enabled decorators.
  • Stats, pagination, and CSV export use the same archived/default filtering semantics as the visible admin table.
  • Unauthorized users cannot archive or delete safety violations.
  • Functional tests cover archive behavior, delete authorization/confirmation contract, and admin UI control presence.

Notes

Relevant current implementation surface:

  • application/single_app/route_frontend_safety.py renders /admin/safety_violations.
  • application/single_app/route_backend_safety.py currently supports list, stats, export, and PATCH review updates for safety logs.
  • application/single_app/templates/admin_safety_violations.html contains the admin page table, cards, filters, and review modal.
  • application/single_app/static/js/admin/admin-safety-violations.js renders the admin list/card views and saves review changes.
  • Current statuses are New, In-Review, Resolved, and Dismissed; archive should probably be represented separately from remediation status so existing status semantics stay intact.

Duplicate search performed with: "safety violation" admin archive delete; no matching issues were found.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with application/single_app/route_frontend_safety.py and route_backend_safety.py, then read admin_safety_violations.html and admin-safety-violations.js to trace list, stats, export, and review-update behavior. Add archive and delete workflows while preserving SafetyViolationAdmin authorization and existing status semantics. Done means archived filtering, stats, pagination, export, confirmation, authorization, and functional test coverage match the acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python
Domain
authorization, backend, frontend, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.