1.8 KiB
1.8 KiB
Plan 19-02 Summary: InboxList and MessageCard Components
What was built
Created the two core list-view components for the agent inbox:
-
MessageCard (
packages/web/src/components/MessageCard.tsx) — Individual message row showing:- Status indicator: filled circle (requires response) vs empty circle (informational)
- Agent name with parenthesized status label (e.g., "gastown (waiting for input)")
- Message preview truncated to 80 chars with ellipsis
- Relative timestamp via inline
formatRelativeTimehelper - Selected state with accent background
-
InboxList (
packages/web/src/components/InboxList.tsx) — Container list component providing:- Header with "Agent Inbox" title, count badge, and Refresh button
- Filter buttons: All / Waiting / Completed
- Sort buttons: Newest / Oldest
- Agent-message joining (matches
message.senderIdtoagent.id, picks latest) - Empty state: "No pending messages" with subtitle
Decisions
- 19-02: Inline
formatRelativeTimehelper in MessageCard (no separate utils file per plan spec) - 19-02: Filter/sort as button groups (not dropdowns) for simplicity per plan spec
- 19-02: Count badge shows total joined entries (not filtered count) to match wireframe "Agent Inbox (3)"
- 19-02:
cn()import from@/lib/utilsfor className merging (consistent with all other components)
Verification
npx tsc --noEmit -p packages/web/tsconfig.app.json— passes (exit 0)npx vite build— passes (exit 0, 520 kB bundle)
Commits
6450e40: feat(19-02): create MessageCard component for agent inboxbf3521e: feat(19-02): create InboxList component with filter/sort controls
Files modified
packages/web/src/components/MessageCard.tsx(new)packages/web/src/components/InboxList.tsx(new)