MPCAutofill/cardpicker: contextual report panel and per-user hidden card feed exclusion - #757
Merged
Merged
Conversation
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.
Summary
Closes #714 — "What's That": contextual report button that flags an image for moderators against the relevant tags, with an optional per-user hide.
Backend
HiddenCardmodel + migration0108_hiddencard(stacks on master's0107_question_feed_pools_schedule_dedupe, keeping the migration graph a single leaf).post_report_cardaccepts an optionalhideflag: when true, creates aHiddenCardfor the reporting anonymous identity inside the same transaction as theCardReport.question_feed_poolsthreading + per-voter filter inquestion_feed.py). No caching added — the latency caching is master's own content and is untouched.Frontend
hide: trueand the card is hidden locally.hiddenCardsSlice+ listener middleware persist hidden identifiers to localStorage keyed by anonymous identity;Layouthydrates the slice at app start for an existing identity only (never mints a new one just by loading).hideisundefinedand dropped byJSON.stringify).Test plan
python3 -m pytest cardpicker/tests/test_question_feed.py cardpicker/tests/test_question_feed_pools.py -q— 106 passedpython3 -m pytest cardpicker/tests/test_moderation_views.py -q— 48 passedblack --checkon the 9 touched Python files — cleanisort --check-only --profile black cardpicker/— cleanruff checkon touched Python files — cleanmypy --config-file ../mypy.inion the touched production files — Success: no issues found in 5 source files.github/scripts/check_migration_leaves.py --base origin/master— OK, one leaf per appnpm run build(frontend) — compiled successfullynpx jest src/common/cookies.test.ts src/features/reporting/ReportCardPanel.test.tsx— 27 passedsearchSettings/comparison.test.ts(TypeError: a.isSubsetOf is not a function). That file is byte-identical to master; the tests useSet.prototype.isSubsetOf(Node 22 API) and fail only under the local Node 20. CI runs Node 22.15.