Skip to content

Phase 14 — §58/§59 acceptance audit: order-ID search + touch-friendly image reorder - #29

Merged
ManoharPaturi merged 3 commits into
mainfrom
feat/phase14-acceptance-audit
Oct 10, 2026
Merged

ManoharPaturi merged 3 commits into
mainfrom
feat/phase14-acceptance-audit

Conversation

@Pushpak731

Copy link
Copy Markdown
Contributor

Summary

Phase 14: the §58 Client UX and §59 Customer UX acceptance checklists audited item by item against the codebase. 26 of 28 items already pass; this PR fixes the two that didn't and ships the owner walkthrough runbook for the live-verifiable remainder. App code only — no migration, no new dependencies. Branch cut from main @ 81c2d42 (after #28).

§58 Client checklist — audit result

Item Status Where
Create a product ✅ /client/products/new wizard (§15)
Upload images from phone ✅ native file input (accept="image/*" opens gallery/camera) + Add-by-URL fallback
Reorder images fixed here was drag-only — HTML5 drag never fires on touch; ◀▶ buttons added per image, one shared reorder path
Choose primary image ✅ "make primary" + gold badge
Change description ✅ editor autosave
Change price ✅ editor autosave, paise-validated
Change stock ✅ /client/inventory adjustments write the movements ledger
Duplicate product ✅ §17 duplicate → draft copy
Publish/unpublish ✅ §16 status actions
Find order by Order ID fixed here /client/orders had filter chips only — no search; now ?q= matches order number (full or partial), customer name, phone
Find product by Product ID ✅ products search matches name OR product_code
Verify payment ✅ Verify payment + optional UTR (§32)
Enter courier / tracking ID / tracking URL ✅ mark-shipped block (§35)
Mark shipped ✅ guarded mark_shipped (inventory + message builder)

§59 Customer checklist — all 12 pass

Product identity/description/attributes, price + MRP strike, In-stock/Sold-out, variant chips (radiogroup), estimated → server-verified totals, "Delivering to" snapshot on the confirmation page, the "Continue to WhatsApp" explainer + prefilled handoff, Order ID as the page headline, payment-status chip, shipped ladder on /track-order, Tracking ID, "Track with courier ↗" (with website fallback).

What changed in code

  • Order search — pure matchesOrderSearch (lib/orders/search.ts) applied in-memory in listOrders (launch-scale pattern, same as inventory/customers). GET form on /client/orders keeps the active filter chip; chips keep the query. Empty-state copy differentiates "no orders yet" from "no match".
  • Touch reorder — pure moveItem (lib/catalog/media-order.ts); drag-drop and the new ◀▶ buttons share one reorder() → persistOrder() path. Buttons have aria-labels and disable at the edges.

Verification

  • npm run typecheck — clean
  • eslint on all changed files — clean
  • npm test — 273/273 (261 on main + 12 new: 6 order-search matcher cases, 6 moveItem cases incl. bounds + immutability)
  • npm run build — clean
  • No migration, no new dependencies

Owner runbook (what code review can't prove)

docs/ops/phase14-acceptance-walkthrough.md rides this branch — a ~15-minute phone pass over both checklists on production after merge, with ✅/❌ reported back on this PR. Two §58 items are only truly provable there: phone upload flow with real images, and the reorder buttons on a real touch screen.


@ManoharPaturi — Phase 14 is ready for your review. Once the required Typecheck · Lint · Build check is green, please review and merge it yourself (I don't merge — your call, per the standing rule). After merge, the walkthrough runbook is yours to run; report any ❌ here and I'll cut a fix branch.

- /client/orders gains ?q= search (order number, customer name, phone;
  pure matcher, chips preserve the query) — closes §58 'Find order by
  Order ID'
- Media manager: ◀▶ move buttons per image (touch/keyboard path — HTML5
  drag never fires on phones) sharing one reorder path + pure moveItem
- 12 new unit tests (261 → 273); no migration
Copilot AI balanced review requested due to automatic review settings October 10, 2026 04:25
@vercel

vercel Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sri-vartali-commerce Ready Ready Preview Oct 10, 2026 4:31am UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ManoharPaturi

Copy link
Copy Markdown
Contributor

@copilot review

Copilot AI commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

@copilot review

Addressed one high-confidence issue found during review: password sign-in now validates next before redirecting to prevent open redirects. Fixed in commit 47310e2.

@ManoharPaturi
ManoharPaturi merged commit a638b32 into main Oct 10, 2026
4 checks passed
@ManoharPaturi
ManoharPaturi deleted the feat/phase14-acceptance-audit branch October 10, 2026 04:35
ManoharPaturi added a commit that referenced this pull request Oct 10, 2026
…till missing) (#30)

## Summary

Phase 15 (production e2e verification) **stopped at the gate —
honestly**. `/track-order?order=…&phone=1` returns **500** on production
while every public page returns 200: `SUPABASE_SERVICE_ROLE_KEY` is
still not set on Vercel (04-OPEN-ITEMS item 1, pre-dating Phase 6). Per
the phase plan nothing was simulated; this docs-only PR ships the
runbook so the verification runs the moment the key lands.

## Evidence (2026-10-10, full table in the runbook)

- `/`, `/shop`, `/cart`, `/account/login` → 200; `/checkout` (empty) →
307; `/api/health` → 200
- `/track-order` bare → 200; **with order+phone params → 500**
- `/api/health` checks only the public env vars — its "ok" does not
clear this gate

## What's in the runbook (`docs/ops/phase15-production-smoke.md`)

1. The 4-step owner fix (~5 min, Supabase + Vercel dashboards) and the
gate re-check.
2. The full post-fix smoke sequence, ordered so the rate-limit burst
(which throttles the caller for 10 min) goes last: checkout e2e with a
clearly-named test product → payment verify → mark shipped → track-order
ladder → 31-hit burst + `rate_limit_windows` DB read-back via the
ops-file/dispatch path → purge proposal (owner approval required, never
first).
3. Owner self-serve extras: UptimeRobot on `/api/health`, Vercel Web
Analytics, Supabase redirect-URL fix.

Docs-only — no code, no migration, no new tests (nothing executable
changed).

---

@ManoharPaturi — two things are yours here: (1) the **5-minute env fix**
(numbered in the runbook and below) unblocks not just this smoke but
every service-role path in production — place-order, payment
verification, mark-shipped, track lookups, rate limiting; (2) review and
**merge this PR yourself** (I don't merge — standing rule). PR #29
(Phase 14) is also still open and green whenever you're ready.

**The fix:** Supabase dashboard → project `khuumibmulagqgdrrtih` →
Settings → API → copy the **service_role** JWT (`eyJ…`, not
`sb_secret_…`) → Vercel → project settings → Environment Variables → add
`SUPABASE_SERVICE_ROLE_KEY` (tick **Production**) → Save → Deployments →
latest → **⋯ → Redeploy**. Then `/track-order?order=X&phone=1` must
return 200 — say "env is in" and Phase 15 executes end to end next
session.

Co-authored-by: Manohar Paturi <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — 47310e2d Deployed Oct 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants