Repository navigation
Add admin tools to /food: empty lists and comments (#236) - #237
Merged
Merged
Conversation
- Add two new admin buttons to empty wishlist or out-of-stock list - Both show confirmation with danger button before clearing - Mention that the action cannot be undone - Add comments system (admin-only, as requested) - Admins can add, edit, and remove comments on wishlist items - Multiple comments per item supported - 250 character limit per comment - Comments shown inline beneath items (💬 emoji + author + relative time) - Comments visible only to admins - Comments stored in wishlist items only (not carried to out-of-stock) - Data model: Add Comment type with text, author, addedAt - Service layer: Add emptyWishlist(), emptyOutOfStock(), addComment(), editComment(), removeComment() methods - UI: New 'Manage comments' button opens item picker → comment management panel - Tests: Full coverage for all new functionality (56 service tests, 79 feature tests) Closes #236 Co-authored-by: NinjaLikesCheez <NinjaLikesCheez@users.noreply.github.com>
- Add CHANGELOG.md entry for new admin tools - Fix form submissions to include item/index in submit args - Replace unsupported 'prefill' with field 'value' property - Limit comment selects to 25 options (Discord max) - Fix relative time formatting for 360-364 day range - Add optional chaining for TypeScript strictness - Convert forms to functions to properly pass context Fixes all CI failures and addresses Sentry bugs: - HIGH: Forms now pass required args on submit - MEDIUM: Comment selects capped at 25 (shows notice if more) - LOW: Time formatting no longer shows '0 years ago' Co-authored-by: NinjaLikesCheez <NinjaLikesCheez@users.noreply.github.com>
- Add tests for empty wishlist and out-of-stock actions - Add tests for comment CRUD operations (add, edit, remove) - Add tests for admin-only checks - Add tests for error conditions and edge cases - Add test for 25-comment select limit - Improve coverage from 66% to 91% for food feature Co-authored-by: NinjaLikesCheez <NinjaLikesCheez@users.noreply.github.com>
- Add tests for comment validation (over 250 chars, empty text) - Add tests for missing/nonexistent items in comment operations - Add tests for invalid indices and out-of-bounds access - Add tests for empty list edge cases - Add tests for picker panel fallback - Brings coverage to 92.8% lines, 82% functions (passing thresholds) Co-authored-by: NinjaLikesCheez <NinjaLikesCheez@users.noreply.github.com>
Replace the five admin buttons on /food with a single Admin tools… entry that drills into Wishlist… / Out of stock… panels. Show only a compact comment count on the home wishlist; full comments stay in the Comments… flow. Co-authored-by: NinjaLikesCheez <NinjaLikesCheez@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #236
Overview
Implements the three requested admin enhancements for the
/foodpanel from member feedback (Sentry PIXEL-29):Admin actions are staged so the home panel stays uncluttered: one Admin tools… button opens a short menu, then the action you need.
UX flow
Home (
/food) — members see the usual add / remove / out-of-stock controls. Admins get one extra button:Admin tools → choose a area:
Wishlist tools →
Out of stock tools →
Comments… → pick an item → add / edit / remove comments for that item.
On the home wishlist, admins only see a compact
💬 Ncount; full comment text lives in the Comments flow.Changes
Empty Lists
Comments
data/food-wishlist.yaml(not carried to out-of-stock)Data / service
Commenttype andWishlistItem.comments?emptyWishlist(),emptyOutOfStock(),addComment(),editComment(),removeComment()Testing
Security
escapeMarkdownbefore display