[Activity panel 2/3] Add a Mark all as seen action for large backlogs
まだ誰も着手していません。
評価
- 難易度
- 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 ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 件 ·
メンテナーはふだん 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 日以内に返信