Repository navigation
feat(notification): 站内通知支持删除,只删点名发给我本人的(#449) - #451
Merged
Merged
Conversation
- 后端:DELETE /sys/notifications/{pk}、批量 DELETE /sys/notifications、清空已读 DELETE /sys/notifications/read
- 能删 = recipient_id 是我本人;公告和全员广播是全员共用的一行,不在可删范围。按 recipient_id 判,不按分类
- 复用现有逻辑删除列,不加表、不加迁移;已读标记一起清掉
- 单条删不掉的一律 404(不区分广播 / 别人的 / 不存在),批量里不能删的静默跳过、返回实际条数
- 列表回填 deletable;删完给本人推一次,其他标签页的红点跟着变
- Web 消息中心:行内删除 + 勾选批量删除 + 清空已读(都二次确认);不能删的行没有按钮、勾不上(含「全选本页」)
- Web 铃铛:悬停出现删除,不弹确认
- 移动端:长按发给我的通知 → 确认删除
- pytest 5 条、E2E 2 条;分册各补一条
Closes #449
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 批量删除 / 清空已读失败时确认框留着、把原因写出来(原来直接关框,错误谁都看不到,硬纪律 9) - 铃铛删除按钮:看不见时也点不到(pointer-events-none),触屏一直显示;能删的行右侧留出按钮位置,不再盖住未读红点 - 未读数接口多返回 clearable_read_count:没有可清的已读时「清空已读」灰掉,确认框写出条数;接口失败时按钮照旧能点 - E2E 用公告代替手动全员发,结尾删公告时收件箱那一行跟着撤回,不再往 fba_test 里留删不掉的广播 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI 的 test_unread_count_is_one_scan 红了:上一个提交往 /unread-count 里加了 clearable_read_count, 多出一条 count 查询。铃铛每次收件箱变动都重拉这个接口,#190 评审定下它只许扫一次。 - /unread-count 恢复原样 - 列表接口加 mine 筛选(只看点名发给我本人的 = 能删的) - 消息中心单独查一页 mine + unread=false 的 total,当「清空已读」能删几条;查询失败时按钮照旧能点 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…te' into feat/issue-449-notification-delete
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 #449
规则
能删 = 点名发给我本人的(
recipient_id = 我)。公告和全员广播(每日问候、手动发送时留空接收人)在库里是全员共用的一行,删了就是所有人一起看不到,所以不在可删范围内。判断看recipient_id,不看分类:全员广播不止公告一种。后端
DELETE /sys/notifications/{pk}DELETE /sys/notifications{pks}DELETE /sys/notifications/readdeleted/deleted_time),收件箱的查询本来就过滤deleted == 0,不用新建表,也不用迁移;已读标记一起删deletable字段,前端只看它决定显不显示删除notification:new,在提交之后发,其他标签页的红点会跟着更新前端
验证
plugin/notification+plugin/notice共 130 条通过,新增 5 条:deletable回填 · 删自己那行不影响别人那行 · 广播和别人的通知返回 404 且数据库不变 · 批量删除跳过广播 · 清空已读只删定向的已读notification.spec.ts5 条通过,新增 2 条:消息中心删除后列表和红点同步,广播那一行不能删也勾不上;铃铛悬停删除enableRowSelection去掉重跑,显示「已选 2 项」,测试失败typecheck --force·lint·i18n:check·ctx:check·arch:check都通过🤖 Generated with Claude Code