[Activity panel 2/3] Add a Mark all as seen action for large backlogs
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 42/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- full-stack
调研方向
Start with markTicketSeen and its unseen condition in lib/db/queries/tickets.ts, then markTicketSeenAction in lib/actions/notifications.ts for the access check. The panel is in components/dashboard/activity-panel.tsx, rendered from app/(dashboard)/dashboard/page.tsx. Done means a set-based update limited to the organization and to replies at or before the page load time, with tests for the query, action and confirmation flow. The issue says part 1 (#618) should land first, so check whether that is merged before starting.
由索引模型根据 Issue 内容生成。
描述
Copied from DeadantCo/answerLoops#129 · originally opened by sethr07 on 2026-11-20
Copied from https://github.com/answerLoops/answerLoops/issues/619 — originally opened by
@NathanTarberton 2026-11-17
Series
This is part 2 of 3 of the dashboard Activity panel work. Each part is its own pull request. Build part 1 first, because this adds a control to the panel it redesigns.
- #618: collapse on load, preview 5, and always show the true count
- #619: a "Mark all as seen" action for large backlogs (this issue)
- #620: a channel breakdown, with a channel filter on the tickets page
Summary
Add a Mark all as seen action to the Activity panel, so a team can clear a large backlog of customer replies in one step instead of opening tickets one at a time.
How it works today
- A ticket counts as unseen when it has a customer reply that is newer than its last-seen time, or it has never been seen.
- Opening a ticket (
markTicketSeeninlib/db/queries/tickets.ts) does two things together: it sets the ticket's last-seen time to now, and it marks that ticket's unread notifications as read. - "Seen" is stored on the ticket, so it is shared by the whole team. When one person opens a ticket it is seen for everyone.
- There is no bulk way to do this. With 200 tickets waiting, the only way to clear the panel and the notification badges is to open all 200.
The problem
A backlog that is never cleared makes the Activity count meaningless: people stop trusting it because it never reaches zero, and real new replies hide inside the pile. Teams need a deliberate way to say "I have dealt with all of these, start fresh".
What to build
1. Where it lives
- A secondary Mark all as seen button inside the expanded Activity panel, next to the footer from part 1. It is not in the collapsed header, so it cannot be clicked by accident.
- It is shown only while the panel is shown, which means there is at least one unseen ticket.
2. Confirmation first
- Clicking it opens an inline confirmation, not an immediate action. The text says how many tickets are affected and what it does, for example: "Mark 200 tickets as seen? This clears them for your whole team and removes their unread notifications. Nothing is deleted and the tickets stay open. This cannot be undone."
- Cancel is focused by default and Escape dismisses it. Only an explicit confirm button runs the action.
3. What the action does
- It sets the last-seen time to now for every ticket in the person's organization that is unseen as of the moment the dashboard was loaded, and it marks those tickets' unread notifications as read, matching what opening a ticket does.
- A customer reply that arrives after the page loaded must not be cleared by accident. Pass the page's load time to the action and only touch tickets whose latest customer reply is at or before that time.
- It runs as one set-based update, not a loop over tickets, so it is safe for thousands of tickets and either fully applies or does not apply.
- It is scoped to the person's own organization and never touches another workspace's tickets.
4. What the person sees afterwards
- A confirmation message using the number actually updated, for example "Marked 198 tickets as seen". It can be lower than the number shown, if a teammate opened some in the meantime.
- The Activity panel, the tickets list and the notification badge all refresh. If nothing is left unseen, the panel renders nothing, as it does today.
- If the action fails, the person gets an error message and nothing is changed.
5. Access
- Use the same access check as opening a ticket today (see
markTicketSeenActioninlib/actions/notifications.ts). - In review, confirm whether a bulk action that affects the whole team should be limited to some roles. Do not widen access beyond what opening a ticket needs.
Out of scope
- Undo.
- Marking only a subset, such as one channel or the tickets on screen. That can follow once part 3 exists.
- Any change to what counts as unseen, per-person seen state, or opening the panel automatically.
- Any change to the notification system beyond marking the affected tickets' notifications read.
- An audit log entry for the bulk action.
Where to look
lib/db/queries/tickets.tsformarkTicketSeenand the unseen condition. The new query should reuse the same condition so the two can never disagree.lib/actions/notifications.tsfor the existing server action and its access check.components/dashboard/activity-panel.tsxandapp/(dashboard)/dashboard/page.tsxfor the panel and where it is rendered.
Acceptance criteria
- The button appears only in the expanded panel, and needs an explicit confirmation to run.
- Cancel is focused by default and Escape dismisses the confirmation.
- Every unseen ticket in the organization as of page load is marked seen, and its unread notifications are marked read.
- A customer reply that arrived after the page loaded stays unseen.
- No ticket or notification in another organization changes.
- The person sees the number actually updated, and the panel and notification badge refresh.
- On failure the person sees an error and nothing is partly applied.
Tests
Add tests for the query and action: it updates only unseen tickets up to the load time, leaves later replies alone, marks the matching notifications read, stays inside one organization, and returns the updated count. Add component tests for the confirmation flow, focus, Escape, and the success and error messages.
Start here: new to the project? Read CONTRIBUTING.md first. It covers the ground rules, running answerLoops locally, and how to open a pull request.
- 主要语言
- TypeScript
- 星标
- 0
- 派生
- 0
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
DeadantCo/answerLoopsdev 的其他 Issue
-
Widget: match the chat bubble color to the rest of the widget可能已有人在做 @sethr07 今天认领。 未关闭enhancement frontend help wanted
难度 2/5 半天 新手友好度 75/100
DeadantCo/answerLoopsdev#68 · 3 条评论 ·
-
Widget: make the chat window fit on small phones可能已有人在做 @sethr07 今天认领。 未关闭enhancement frontend good first issue help wanted
难度 2/5 1-3 小时 新手友好度 70/100
DeadantCo/answerLoopsdev#67 · 9 条评论 ·
-
Add 'select all' option to Slack channel picker in Settings可能已有人在做 @sethr07 今天认领。 未关闭frontend good first issue
难度 2/5 1-3 小时 新手友好度 68/100
DeadantCo/answerLoopsdev#22 · 5 条评论 ·
-
enhancement frontend help wanted
难度 4/5 3-5 天 新手友好度 45/100
DeadantCo/answerLoopsdev#141 ·
-
backend enhancement frontend help wanted
难度 4/5 3-5 天 新手友好度 45/100
DeadantCo/answerLoopsdev#140 ·
查看 DeadantCo/answerLoopsdev 的全部 Issue
相似的 Issue
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1 小时以内 新手友好度 92/100
lingdojo/kana-dojo#34545 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
-
blocklist addition
难度 1/5 1 小时以内 新手友好度 82/100
MetaMask/eth-phishing-detect#315455 ·
维护者通常 1 天内回复
-
area: telegram bug
难度 2/5 1-3 小时 新手友好度 76/100
griffinwork40/agent-afk#5275 ·
维护者通常 1 天内回复
-
macOS: the Save Diagnostics panel goes behind the editor after an app switch and can't be reached未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
getopenscreen/openscreen#1667 ·
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 68/100
erkamyaman/rust-anything#371 ·
维护者通常 1 天内回复