[Activity panel 1/3] Collapse on load, preview 5, and always show the true count
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 70/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- nextjs, react, typescript
- 領域
- frontend
調査の方向性
Start with components/dashboard/activity-panel.tsx and the call site in app/(dashboard)/dashboard/page.tsx, where the limit is currently 8 and needs to become one shared constant of 5. Make the panel collapsed by default with a real toggle (details/summary or a small client component), then add the 99+ badge, the footer above 5, and the aria-expanded and aria-controls wiring. Run tests/unit/activity-panel.test.tsx, adding cases for collapsed default, the preview limit, 99+, the footer, and the empty state. Done when the acceptance criteria in the issue pass and the page checks out at 375px with the keyboard.
索引モデルが issue の本文から書いたものです。
説明
Copied from DeadantCo/answerLoops#128 · originally opened by sethr07 on 2026-11-20
Copied from https://github.com/answerLoops/answerLoops/issues/618 — originally opened by
@NathanTarberton 2026-11-17
Series
This is part 1 of 3 of the dashboard Activity panel work. Each part is its own pull request. Build this one first, because the other two add to the panel it redesigns.
- #618: collapse on load, preview 5, and always show the true count (this issue)
- #619: a "Mark all as seen" action for large backlogs
- #620: a channel breakdown, with a channel filter on the tickets page
Summary
The dashboard's Activity panel should start collapsed, show a small bounded preview when opened, and always show the true number of tickets with new customer replies, however large it gets. The alerts and everything else on the dashboard stay as they are.
How it works today
- The panel (
components/dashboard/activity-panel.tsx) is always open when the dashboard loads. - It lists tickets with customer replies the team has not opened yet, most recent reply first. The dashboard page asks for at most 8 of them (the default limit of
getUnseenActivityTickets). - The badge next to "Activity" is the exact total of such tickets (
countUnseenActivityTickets), with no upper limit. - "View all →" is a link to
/tickets?newActivity=1&sort=activity. It does not expand the panel. - "Seen" is stored on each ticket and is shared by the whole team. Opening a ticket marks it seen for everyone, which removes it from the panel and lowers the count.
- When no ticket has unseen replies, the panel renders nothing.
The problem
Even capped at 8, the open list pushes the stat cards and the rest of the dashboard down the page on every load, and people who just want the numbers have to scroll past tickets they have already seen. The panel also gives no hint of scale: with 200 tickets waiting, it looks the same as with 12 apart from the badge.
What to build
1. Collapsed by default
- The panel is collapsed on every page load. Nothing is remembered between visits.
- Collapsed, it shows only its header: the "Activity" title, the count badge, the existing helper line ("Customers replied on these tickets. Opening one marks it seen."), the "View all" link, and an expand control.
2. The count badge
- It shows the exact count up to 99, and 99+ above that.
- Its accessible name always carries the exact number, for example "Activity, 200 tickets with new customer replies", so a screen reader user is never given the capped figure.
3. The "View all" link
- Same destination as today.
- Its text carries the exact total: View all 200 →. It is not capped at 99.
- It is a separate link beside the expand control, never nested inside it.
4. The expanded preview
- Expanding shows the latest 5 tickets, most recent reply first. The rows look exactly as they do today.
- The preview size is one named constant, used both for the query limit and the display, so the two cannot drift apart. Change the dashboard page to request 5, not 8.
- When the total is more than 5, a footer line under the rows says Showing the latest 5 of 200 and repeats the "View all 200 →" link. When the total is 5 or fewer, there is no footer.
- Expanding does not make any new request. The rows are rendered on the server with the page and revealed on expand.
5. The expand control
- The header title and badge act as the toggle. It is a real button (or a native details and summary), operable with Enter and Space.
- It exposes
aria-expandedand points at the list it controls witharia-controls. - It has a visible focus ring and a chevron that turns when open.
- Its touch target is at least 44px tall at phone width.
6. Unchanged behavior
- When no ticket has unseen replies, the panel still renders nothing.
- The banners above the page heading (manual-review notice, AI usage banner, trial-ending banner), the Feedback button, the stat cards and every other panel are not touched.
- What counts as unseen, the tickets page filter, and how tickets are marked seen are not touched.
Out of scope
Please do not include these in this issue. They are separate pieces of work.
- A "Mark all as seen" action for clearing a large backlog.
- A breakdown of the count by channel.
- Remembering the open or closed state between visits.
- Per-person seen state, or opening the panel automatically when something new arrives.
- Any change to the database, the queries' conditions, or the notification system.
Where to look
components/dashboard/activity-panel.tsxis the panel. It is a server component today with no state, so the toggle needs either a native details and summary element or a small client component that wraps only the toggle.app/(dashboard)/dashboard/page.tsxrenders it and fetches the tickets and the count.lib/db/queries/tickets.tsholdsgetUnseenActivityTicketsandcountUnseenActivityTickets.tests/unit/activity-panel.test.tsxhas the existing tests.
Acceptance criteria
- The dashboard loads with the Activity list hidden, and its count and "View all" link visible.
- Opening it shows at most 5 rows, newest reply first, with no extra network request.
- With 5 or fewer tickets there is no footer. With more, the footer reads "Showing the latest 5 of N" and links to the same place as "View all N →".
- The badge shows "99+" above 99, while its accessible name and the link text carry the exact total.
- The toggle works with mouse, keyboard and a screen reader, with a visible focus ring and
aria-expanded. - With zero unseen tickets the panel still renders nothing.
- The banners, the Feedback button and the other dashboard panels are unchanged.
- The layout works at 375px wide, including a count of 3 digits.
Tests
Update tests/unit/activity-panel.test.tsx and add cases for: collapsed by default, opening and closing again, the 99+ badge with its exact accessible name, the footer appearing only above 5, the preview limit of 5, and the empty case. Check the page by hand at phone width and with the keyboard before opening a pull request.
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 日以内に返信