"
```
---
## Task 3: Compact info on delivery-note rows
**Files:**
- Modify: `src/app/(app)/deliveries/page.tsx` (only `DeliveryNoteRowComponent`, lines ~1475-1588)
- [ ] **Step 1: Add the Paperclip import**
In `src/app/(app)/deliveries/page.tsx`, the lucide-react import already includes `Pencil`, `Truck`, `User`. Add `Paperclip`:
Locate the lucide-react import (around lines 86-94) and add `Paperclip` to the named-imports list:
```ts
import {
CheckSquare,
FileText,
Loader2,
PackageOpen,
Paperclip, // ← add this
Pencil,
Square,
Truck,
User,
} from "lucide-react";
```
- [ ] **Step 2: Replace the subline with the compact pieces list**
In `src/app/(app)/deliveries/page.tsx`, locate `DeliveryNoteRowComponent` (lines ~1475-1588). Find the `…
` block (around line 1537-1547). Replace its **children** (the `{dn.delivery_date && …}` + `{subline}` content) with the following compact pieces list:
```tsx
{dn.order ? (
<>
{dn.order.customer_name}
{dn.order.company_name && (
<>
·
{dn.order.company_name}
>
)}
{dn.order.order_number && (
<>
·
{dn.order.order_number}
>
)}
>
) : (
Counter pickup
)}
{dn.signed_copy && dn.signed_copy.length > 0 && (
<>
·
signed copy
>
)}
{dn.delivery_date && (
<>
·
Delivery {dn.delivery_date}
>
)}
```
This keeps the existing `text-muted-foreground` / `tabular-nums` styling and adds: customer name (truncated, with title tooltip), optional company, optional order number, optional signed-copy indicator, optional delivery date. Counter-pickup DNs (`dn.order === null`) collapse to a single "Counter pickup" label per the spec.
Leave the rest of `DeliveryNoteRowComponent` (the `` icon, the title row with `DN {n}`, the status badge column, the two buttons) untouched.
- [ ] **Step 3: Smoke-check in the dev server**
Start the dev server:
```bash
npm run dev
```
Open `http://localhost:4001/deliveries`. Verify on the To Load tab:
- A DN with an order attached renders the customer name + company + order number under the DN number, joined by `·`.
- A counter-pickup DN (no order) shows "Counter pickup" in the same slot.
- A DN with a signed copy uploaded shows a paperclip icon + "signed copy" text.
- Hovering the paperclip reveals the filenames.
- Layout is otherwise unchanged — buttons still on the right, status badge still on top.
Stop the dev server (Ctrl+C).
- [ ] **Step 4: Commit**
```bash
git add "src/app/(app)/deliveries/page.tsx"
git commit -m "feat(deliveries): enrich DN row subline with customer/order/paperclip
The /deliveries To Load + Back from Driver + Checked In tabs each
render delivery-note rows showing only 'DN {number}' + a one-line
status subline. Operators couldn't identify the customer or tell
whether the signed copy was back without scrolling up to the
customer/order group header.
Replace the existing subline with a compact pieces list:
customer name (truncated, with title tooltip) · company name ·
parent order number · signed-copy indicator (paperclip icon +
filenames in title=) · delivery date (if set). Counter-pickup DNs
(no parent order) collapse to 'Counter pickup'.
All data is already on the row payload from /api/v1/deliveries —
no server or schema changes.
Co-Authored-By: Claude Code "
```
---
## Self-review
**Spec coverage check (against `docs/superpowers/specs/2026-09-01-delivery-row-info-and-order-age-badge-design.md`):**
| Spec section | Plan task |
|---|---|
| § Feature 1: Compact info on delivery-note rows — 4 pieces (customer, company, order, signed-copy indicator) + edge cases | Task 3 ✓ |
| § Feature 1: Counter-pickup fallback ("Counter pickup") | Task 3 Step 2 ✓ |
| § Feature 1: Signed-copy indicator (paperclip + filename tooltip) | Task 3 Step 2 ✓ |
| § Feature 1: Long customer name truncation | Task 3 Step 2 (`max-w-[40ch]` + title) ✓ |
| § Feature 1: No new network request | Task 3 only edits rendering, no fetch added ✓ |
| § Feature 2: New `src/lib/order-age.ts` with `getOrderAge` + `bucketToBadgeClass` | Task 1 ✓ |
| § Feature 2: Bucket thresholds (0/1-2/3-7/8-14/≥15) | Task 1 Step 1 (tests cover all edges) ✓ |
| § Feature 2: Calendar-day delta in Africa/Johannesburg | Task 1 Step 1 (timezone test) + Step 3 (`OFFICE_TZ` + `toLocalDayKey`) ✓ |
| § Feature 2: Future-date clamp | Task 1 Step 1 (clamp test) + Step 3 (`rawDays < 0 ? 0 : rawDays`) ✓ |
| § Feature 2: Tailwind classes (4 buckets, dark variants) | Task 1 Step 3 (`bucketToBadgeClass`) ✓ |
| § Feature 2: Unit tests for all bucket thresholds | Task 1 Step 1 ✓ |
| § Feature 2: JNB-tz edge case test (same calendar day = daysOld 0) | Task 1 Step 1 ✓ |
| § Feature 2: `bucketToBadgeClass` stability test | Task 1 Step 1 ✓ |
| § Feature 2: `OrderAgeBadge` inline component | Task 2 Step 2 ✓ |
| § Feature 2: Replace bare date with badge, preserving `title=` for absolute date | Task 2 Step 3 ✓ |
| § Feature 2: Existing `formatDate` import kept on page | Task 2 Step 3 (uses local `formatDate`) ✓ |
| § What's NOT in scope: no server changes, no schema, no MCP, no other pages | All tasks comply ✓ |
**Placeholder scan:** No "TBD" / "TODO" / "implement later" / "fill in details". All code blocks are complete. The one hedge (`if cn is not available…`) is an explicit fallback instruction for a real ambiguity, not a placeholder.
**Type consistency:** `OrderAgeBucket`, `OrderAge`, `getOrderAge`, `bucketToBadgeClass` are defined and used with matching signatures across Tasks 1 and 2. `OrderAgeBadge` props match its usage at Task 2 Step 3.
**Ambiguity check:** None found. The `cn`-available vs. not-available branch is the only conditional, and the plan gives an explicit fallback.
All spec requirements are addressed; no gaps.