Skip to content

feat(bot): redesign case menus, command browser and status replies - #421

Merged
kodiakhq[bot] merged 18 commits into
mainfrom
feat/case-menu
Nov 27, 2026
Merged

kodiakhq[bot] merged 18 commits into
mainfrom
feat/case-menu

Conversation

@RedStar071

@RedStar071 RedStar071 commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

🔗 Linked issue

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

Moderators can browse and manage cases from one menu, with a layout matching the supplied Discord screenshots.

  • /case list has filters, pagination and a button for each case. Details offer edit, close, history and confirmed deletion.
  • Edits support staff notes, proof uploads and optional user notifications. Private notes never send notifications.
  • Case buttons recheck current command restrictions. History fits Discord's message limit, and case details retain saved roles.
  • Status replies share neutral info, green success, yellow warning and red error containers.
  • /commands opens a public menu. Its search button opens a modal and sends results separately below the menu.
  • Moderation commands answer as Flamey does: the type's emoji and what was done to whom. The recent-case confirmation has Proceed and Cancel buttons.
  • The member's direct message is a container in the type's colour, with the moderator, duration, reason and appeal link.
  • Moderation options follow Flamey's order. New proof and note options keep a file and a staff note with the case.
  • /roles browse drops its colour bar.
flowchart LR
  D[Discord] --> C[Case menu]
  C --> A[Current command permissions]
  C --> E[Edit and close cases]
  E --> P[(Case details and edit history)]
  E --> M[Moderation lifecycle]
  C --> S[Shared status replies]
  S --> D
  D --> B[Public command browser]
  B --> R[Separate search result]
  R --> D
Loading

⚠️ Breaking Changes

The command option of /commands is removed. Use the menu's search button instead.

The dm option of the moderation commands is renamed notify.

📝 Migration

Apply 20261126T1759_add_case_details_and_edits before running the new bot against an existing database.
The production image runs migrations during startup.
For a separately managed deployment, run NODE_ENV=production pnpm --filter wolfstar-database migrate:deploy with its database configuration.
This adds staff notes, proof references and edit history. It cannot reconstruct earlier edits.

🤖 AI disclosure: Wolfstar Agent Kit modified this description. AI open source policy.


Read this PR faster    Follow each request

Confidence Score: 5/5 · The PR appears safe to merge; both numbered previous findings are fixed, and no new blocking issue was found.RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; both numbered previous findings are fixed, and no new blocking issue was found.

Reviews (17) · Last reviewed commit: "fix(bot): read cases under their lock an..." · Reviewed by Greptile

/case list answered with one page of an embed, picked with options.
It now opens a menu: a select menu filters the cases, the buttons go
from a page to another and open a case with the actions on it. The
answers of the case commands take the shape of renderStatus, the one
every status message of the bot is moving to.
@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.74528% with 141 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.88%. Comparing base (1f58b25) to head (9d2f0f1).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
projects/bot/src/lib/moderation/caseEdits.ts 55.00% 51 Missing and 12 partials ⚠️
...rc/lib/moderation/actions/base/ModerationAction.ts 0.00% 17 Missing ⚠️
projects/bot/src/lib/structures/case-menu/view.ts 87.32% 2 Missing and 7 partials ⚠️
...cts/bot/src/lib/structures/commands/publicRoles.ts 0.00% 9 Missing ⚠️
...t/src/lib/moderation/managers/ModerationManager.ts 0.00% 8 Missing ⚠️
...src/lib/moderation/structures/ModerationCommand.ts 78.57% 6 Missing ⚠️
projects/bot/src/lib/moderation/reports/submit.ts 50.00% 4 Missing ⚠️
...ojects/bot/src/lib/structures/case-menu/details.ts 0.00% 4 Missing ⚠️
projects/bot/src/lib/structures/commands/prune.ts 0.00% 4 Missing ⚠️
projects/bot/src/lib/moderation/common/wording.ts 83.33% 2 Missing and 1 partial ⚠️
... and 9 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #421      +/-   ##
==========================================
+ Coverage   62.33%   62.88%   +0.54%     
==========================================
  Files         280      287       +7     
  Lines        9944    10246     +302     
  Branches     2367     2456      +89     
==========================================
+ Hits         6199     6443     +244     
- Misses       3329     3367      +38     
- Partials      416      436      +20     
Flag Coverage Δ
unit 62.88% <66.74%> (+0.54%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

A case could only be changed with one command for each change, and
nothing kept who changed what. The case now has buttons: Edit and
Close open a modal, History lists the edits, Delete asks first.
The moderators can add a note only they read and a proof, and can
tell the user about an edit in a direct message. The note, the proof
and the history are new columns and a new table of the contract.
The commands menu was ephemeral, its search replaced the menu, and
the command took a search option that did the same as the button.
The menu is now a message the channel sees, the search answers under
it with a message only who searched sees, and the option is gone.
A description sat an empty line under its command: Discord draws one
after a line that is all bold, so only the number is bold now.
@RedStar071 RedStar071 changed the title feat(bot): redesign the case menu, the status messages and /commands feat(bot): redesign case menus, command browser and status replies Nov 26, 2026
@RedStar071

Copy link
Copy Markdown
Member Author

Agent verification: opened the case list, case detail, Edit and Close modals, empty History, and Delete confirmation in Discord staging. Cancelled all actions on the existing case. These screenshots cover the earlier staging image. The live /commands check still showed the previous private menu and search option, so staging verification must be repeated with the e07be3b image before marking this PR ready.

The answer of a moderation command said the case it made, the direct
message of the user was an embed of fields, and the confirmation after
a recent case was a line of text. They now take the shape of Flamey:
what was done to whom with the emoji of the type, a container in the
colour of the type for the user, and a prompt with Proceed and Cancel.
The options follow Flamey too: dm is notify, and proof and note keep
a file and a staff note with the case. The roles menu loses its bar.
Discord quotes the whole rest of a message after >>>, so the note under
the reason of a case read as a literal >>>, and the appeal and the
footer of a direct message were quoted with its reason.
Two moderators editing a case on two processes both recorded the old
value, so edits now take the shared lock of the case. A note of many
short lines grew past the 4000 characters of a message once quoted,
so it is cut after quoting. A recent case prompt sent before the
update is a classic message, and its answer still empties it.
The menus mixed the icons of the bot with Unicode emojis: a magnifying
glass, folders, a lock, a bin, a chart, a speech bubble, a minus. They
are now application emojis drawn in the style of the others, from the
Discord assets where it has one, and the search of the roles menu sits
on the right of its title, as the one of the commands menu does.
@RedStar071
RedStar071 marked this pull request as ready for review November 27, 2026 09:43
@coldtea-pr-lens

coldtea-pr-lens Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
  • Redraw · drawn at c4900b3, the branch has moved on

Architecture

Walkthrough of Interactive case management and status system, in four steps

Read this PR faster

Inside the changed components — 1 view

Component view — Case management UI

Detailed interaction flow and rendering modules for moderation cases

Architecture view of Component view — Case management UI in wolfstar-project/wolfstar

Data flow

Data flow diagram for wolfstar-project/wolfstar at c4900b3

Follow each request


Data model

Data model diagram for wolfstar-project/wolfstar at c4900b3

Open the canvas


Tip

The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change

🪧 More tips
  • Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists
  • Click the link under each diagram to open it on a canvas you can zoom, pan and step through
  • Open a diagram on the canvas, then press W or click play to walk through the change one step at a time
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture… row. Drawing still runs as before
  • Set github.draw: on-demand in .github/pr-lens.yml and PR Lens stops drawing pull requests on its own. Comment @pr-lens draw on a pull request when you want that one drawn
  • Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works
  • After a push, tick Redraw to draw the latest commit
  • Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion
  • Set github.description: false in .github/pr-lens.yml to stop PR Lens adding buttons to your PR descriptions

Thanks for using PR Lens! It's free for OSS. If it helped, a star helps other teams find it.  Star PR Lens on GitHub

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

The case edit lock does not protect what it claims to, because the case is read before the lock is taken.

Approach: sound. Case editing goes through one shared editCase/closeCase path with its own history table, and the status replies share one renderer, so the commands and menus stay consistent.

Reviewed changes

Read the complete diff at c4900b3, except the generated emoji assets and migration snapshots.

  • Case menu — /case list and /case view render Components V2 menus (lib/structures/case-menu), driven by the caseMenu interaction handler. The handler is stateless, and commandsEnabled now also gates the caseMenu handler against the case command.
  • Case edits — lib/moderation/caseEdits.ts adds editCase, closeCase and addCaseDetails, with a history table (ModerationCaseEdit, capped at 50 per case). ModerationCaseData gains staff_note and proof columns, added by migration 20261126T1759_add_case_details_and_edits.
  • Moderation commands — New proof and note options; dm is renamed notify. The answer, the user's direct message and the recent-case prompt are redrawn.
  • Status replies — lib/utilities/status.ts gives info, success, warning and error containers. Most handlers and commands move to it mechanically.
  • /commands — The menu is public, the command option is gone, and search results are a separate ephemeral message.

ℹ️ /case list also loses type, pending-only and page, which the PR does not list as breaking

The description lists the /commands command option and the dm → notify rename as breaking changes. /case list also drops its type, pending-only and page options in favour of the menu's select and pagination, which src/@types/commands.d.ts confirms. Anyone with saved usage of those options, or documentation that names them, will see them vanish.

Technical details
# Undocumented breaking option removals on `/case list`

## Affected sites
- `projects/bot/src/commands/Moderation/Utilities/case/list.ts` — `type`, `pending-only` and `page` options removed from the builder.
- PR description, "Breaking Changes" section — mentions only `/commands command` and `dm` → `notify`.

## Required outcome
- Add the removed `/case list` options to the breaking changes section, or confirm they are intentionally dropped.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-sonnet-5-5 | 𝕏

The lock of a case can be waited on for up to 10 seconds.
Discord gives an interaction 3 seconds to answer.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ No new issues in this delta. The three threads from the previous review are untouched by it and stay open.

Reviewed changes

Reviewed the one commit since the prior pullfrog review (f276770).

  • Deferred case edit and archive — /case edit and /case archive now call interaction.defer({ flags: MessageFlags.Ephemeral }) before editCase/closeCase and answer with deferred.update(...), so waiting for the case lock cannot pass the 3 second window. resolveCaseDuration still throws before the defer, so its string errors reach handleCase's interaction.reply while the interaction is unacknowledged.

The open threads on the stale entry read outside the lock (caseEdits.ts), the missing try/catch after deferUpdate() (caseMenu.ts) and the proof fetch before the first response (case/view.ts) are not addressed by this commit.

Pullfrog  | Fix it ➔ | View workflow run | Using claude-sonnet-5-5 | 𝕏

# Conflicts:
#	projects/database/migrations/app/refs/db.json
Review of #421: the case was written back from the cache of the process,
the proof upload could outlast the lock, the view replied after a request
to Discord, a failed modal edit left no answer, and the direct message of
an edit ignored the opt-out of /settings user.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

Reviewed the one commit since the prior pullfrog review (9d2f0f1, "read cases under their lock and defer the case views"). It addresses the three threads from the earlier review, which are already resolved.

  • Case read under its lock — editCase and closeCase call the new ModerationManager#refetch inside withCaseLock, so before values, the duration fallback and isArchived() come from the database instead of the process cache. The entry is patched in place by #performUpdate, so the outcome's entry carries the new values.
  • Proof and direct message off the lock — the proof is downloaded and re-uploaded before the lock is taken, and the user is told after it is released (notifyCaseUserWithWarning). A user who turned off moderation messages now gets an optedOut warning instead of a message.
  • Deleted cases — both functions return null when the case is gone, and /case edit, /case archive and the menu answer with caseUnknownEntry.
  • Deferred case views — /case view, the view verb and deleteCancel defer before reading the proof message. The modal submits in caseMenu wrap editCase/closeCase in try/catch and answer through failAfterDefer.
  • Tests — caseNotifications.test.ts covers the stale cache, a case deleted meanwhile, a case closed elsewhere and the opted-out user.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@github-project-automation github-project-automation Bot moved this from Todo to Review Approved in Wolfstar Nov 27, 2026
@kodiakhq
kodiakhq Bot merged commit 5e0fa75 into main Nov 27, 2026
25 of 26 checks passed
@kodiakhq
kodiakhq Bot deleted the feat/case-menu branch November 27, 2026 16:34
@github-project-automation github-project-automation Bot moved this from Review Approved to Done in Wolfstar Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant