2026-03-17

Residuals Product Spec — Mike Request (2:19 AM ET)

Mike sent a detailed request to build the Residuals section of the Twill portal. Shared:

  • NMI/IRIS webinar transcript (PDF) covering their residuals tool
  • 16 screenshots of NMI Merchant Central residuals dashboards, analytics, fee verifier, dynamic splits, pay order, partner properties
  • Key direction: Twill should offer similar functionality but more user-friendly, actionable (AI alerts), not just displaying data. NMI’s UI is terrible but functional — we can do better.
  • NMI is missing: processor comparison, most profitable processors/merchants in analytics
  • Items deferred to partner management: Schedule A uploads, partner split entry, partner Schedule A management

Full product spec written to: /data/.openclaw/workspace/product/residuals/RESIDUALS_PRODUCT_SPEC.md

Spec covers:

  • Competitive analysis of NMI (what they do well, where they fall short)
  • 8 dashboard/page specifications with wireframe layouts
  • AI-powered features: anomaly detection, monthly briefs, NL queries, predictive attrition, portfolio valuation
  • Data model (ResidualImport, ResidualLineItem, MerchantHealth, FeeAuditItem, AgentPayout)
  • Role-based access (ISO Admin, Manager, Agent, Referral Partner)
  • Design principles

Awaiting Mike’s review before routing to engineering.

Residuals Dashboard Built & Deployed (2:30–3:00 AM ET)

Mike approved the spec and asked to build it into the live demo environment at https://twill-partner-dashboard.pages.dev.

Built and deployed the complete Residuals section into the existing partner dashboard mockup (partner-dashboard-mockup/index.html, now ~9,350 lines). All 7 sub-views implemented:

  1. Overview — KPIs (Gross Income 508K, ISO Profit $339K, 1,247 merchants), AI Insights panel, Processor breakdown (stacked bar + table), AI Alert Feed (billing discrepancies, volume drops, attrition warnings, concentration risk), 12-month income trend chart, Top Merchants by Profit, Needs Attention list
  2. Processors — Side-by-side comparison table (TSYS/Fiserv/Paysafe/WorldPay) with Billing Accuracy metric (NMI doesn’t have this), 6-month processor trend overlay chart, per-processor detail cards
  3. Agents — Leaderboard with 8 mock agents, ranked by net income, showing growth %, merchant adds/losses, health indicators
  4. Merchants — Health scoring (🟢🟡🔴⚫), 15 merchants with varied health states, Concentration Risk widget (top 5 = 22.4%), filterable by health status
  5. Analytics — Income & Profitability (12-month area), Growth & Attrition (bar), BPS Margin trend, Industry Breakdown by MCC (horizontal bar), Processor Profitability Matrix (bubble chart)
  6. Fee Audit — Summary KPIs ($3,142/mo potential loss), Billing Accuracy by Processor table, Conflict feed sorted by dollar impact with resolution workflow (Open/Investigating/Disputed/Resolved)
  7. Import — Drag-and-drop upload zone, AI Pre-Publish Validation panel, Import history table

Technical details:

  • Added res- prefixed CSS classes to avoid conflicts with existing styles
  • Sub-navigation via horizontal tab bar below topbar
  • All charts use Chart.js (already loaded)
  • Updated showView() function to init residuals charts on first visit
  • Nav item updated: id="nav-residuals"showView('residuals', this)
  • Deployed via Wrangler to Cloudflare Pages
  • Deployment URL: https://5c83c93a.twill-partner-dashboard.pages.dev
  • Screenshots captured and sent to Mike in thread

Mike said “Sounds good, keep me updated” — awaiting his review of the live build.

Files modified

  • /data/.openclaw/workspace/partner-dashboard-mockup/index.html — main dashboard file (added ~1,200 lines of HTML + CSS + JS)
  • /data/.openclaw/workspace/product/residuals/RESIDUALS_PRODUCT_SPEC.md — full product spec
  • /data/.openclaw/workspace/partner-dashboard-mockup/residuals-section.html — working file (can be cleaned up)

Payouts Tab Added (3:57–4:00 AM ET)

Mike flagged that the Residuals section was missing Payouts — “the whole purpose of the residuals system.” Added a full Payouts tab (8th sub-tab) showing who gets paid, how much, and analysis:

  • Summary KPIs: Total Payout 12,450, Avg Payout Rate 60%
  • Payout table with 8 agents showing: net income, payout rate, payout amount, merchant count, MoM delta
  • Payout Trend Chart (6-month)
  • Schedule A section stub
  • Batch Actions (Run Payroll, Export ACH, Export 1099)
  • Deployed: https://e8465648.twill-partner-dashboard.pages.dev

Dashboard V2 Design Refinement (4:17–4:48 AM ET)

Mike asked to be reminded tomorrow to review in detail. Cron set for 2 PM PST Mar 17. Then pivoted to v2 visual refinement:

Attempt 1 — Light Mode (rejected)

Built a Notion/Mercury-inspired warm light mode (#F7F7F5 background, muted gold #C9A800). Mike rejected: “went too far in the other direction, not enough contrast, get artsy, use more from Notion especially”

Attempt 2 — Refined Sample (rejected)

Built a standalone Linear-inspired dark sample with Geologica/Inter/JetBrains Mono. Mike rejected: “don’t change the functional elements” — he wants the FULL existing dashboard with all pages and features preserved, only the visual layer changed. Not a redesigned single page.

Attempt 3 — Full Dashboard CSS Refinement (current)

Correct approach: copied the complete 9,672-line index.html from v1 into v2 project, applied CSS-only changes via Python script:

  • Warm dark palette: #0C0C10 base, #16161C surfaces (Linear-inspired)
  • Borders: rgba(255,255,255,0.06) — barely visible
  • Geologica for interface layer, Inter for data, JetBrains Mono for numbers
  • KPI values 26px, tabular-nums mandatory
  • More breathing room: 22px card padding, 16px table rows, 32px content padding
  • Muted semantics (greens/reds/ambers toned down)
  • Accent gold #C9A800 (from #FFDE00), primary buttons with glow
  • Sidebar 240px (from 220px), border-radius 10px (from 8px)

V2 project: twill-dashboard-v2 on Cloudflare Pages V2 URL: https://twill-dashboard-v2.pages.dev Latest deploy: https://f8948fe3.twill-dashboard-v2.pages.dev V2 files: /data/.openclaw/workspace/partner-dashboard-v2/index.html

Key lesson: Mike wants the full functional demo preserved — every page, every feature, every chart. Design changes = CSS-only pass on top. Don’t build standalone samples that drop functionality.

Mike’s Overnight Design Review Session (5:30–6:00 AM ET)

De-boxing & Layout Changes

  • Mike provided 5 reference screenshots showing what he wants: KPIs as ONE surface (not 6 boxes), charts integrated (not trapped in containers), bottom section as one shared surface
  • Applied: removed all card borders/shadows, transparent backgrounds, spacing-based hierarchy only
  • Design audit score went from 5.5/10 to 8.5/10 after de-boxing

Font Selection (LOCKED ~5:46 AM ET)

  • Mike rejected Geologica for product UI — “don’t like the font”
  • Built live comparison page (font-compare.html) with 5 options: Inter, DM Sans, Plus Jakarta Sans, Public Sans, Outfit
  • Mike chose C — Plus Jakarta Sans for interface layer
  • Final font system:
    • Plus Jakarta Sans → interface (nav, headings, labels, buttons)
    • Inter → data (tables, body text)
    • JetBrains Mono → numbers (tabular-nums mandatory)
    • Geologica → marketing/brand ONLY, not in product

Section Simplification

  • Combined Tickets + Alerts into single “Activity” feed (reducing from 3 columns to 2)
  • Charts row restructured from 3-column to 2-column layout
  • Tiles row from 3 to 2 columns

Readability Crisis & Fix (~6:00 AM ET)

  • Mike: “everything is hard to read in this version”
  • Root cause: removing card borders + using soft Notion-style text colors (#37352F) + small fonts = mushy, hard-to-read UI
  • Applied readability pass: text primary to #111111, secondary to 4B4B4B, base font 14px, KPI values 32px, card titles 16px/600-weight
  • Added subtle hairline borders back under section headers for visual tracking

Design Review Agents

  • Spawned 2 specialist sub-agents: UI/UX critic + typography specialist
  • UI/UX review completed with detailed per-page critique (saved to review/DESIGN_REVIEW.md)
  • Typography review agent timed out / didn’t produce output
  • Key findings applied:
    • Earthy color palette: greens 5B7A5E, reds 9B6B5B, ambers A67C5B, blues 6B839B
    • Badge colors muted across the board
    • Table row padding increased, gridlines softened
    • Avatar colors switched to earthy tones
    • Unread dots warm brown instead of blue

Mike’s Final Direction (~5:56 AM ET)

  • “Keep working on it with a critical eye, review and refine”
  • “Create agents to review and give you feedback — design specialists, hard to please”
  • “Present to me at 9 AM PST tomorrow” (actually same day — Mar 17)
  • “We are nowhere near where we need to be”

9 AM PST Presentation (12:55 PM ET)

  • Deployed final overnight version: https://2a449931.twill-dashboard-v2.pages.dev
  • Sent summary with 4 screenshots to Mike in DM thread
  • Acknowledged known remaining issues: residuals sub-pages, dense tables, analytics chart inconsistency, AI SUGGESTED noise
  • Awaiting Mike’s reaction

Current V2 Deploy URLs

  • Latest: https://2a449931.twill-dashboard-v2.pages.dev
  • Main: https://twill-dashboard-v2.pages.dev
  • Font comparison: https://ed99b30e.twill-dashboard-v2.pages.dev/font-compare.html

V2 CSS Variables (UPDATED)

  • --text-primary:#111111 (was 37352F)
  • --text-secondary:#4B4B4B (was #787774)
  • --text-muted:#737373 (was A09E9A)
  • --green:#5B7A5E (was 2D7A4F)
  • --red:#9B6B5B (was B4432A)
  • --amber:#A67C5B (was 9A6700)
  • --blue:#6B839B (was 2E6B9E)
  • --purple:#8C7A5E (was 6B5FA5)

Attempt 4 — De-boxed, unified surfaces (APPROVED DIRECTION ~5:30 AM ET)

Mike’s detailed design brief clarified: remove card-everywhere feeling, use spacing not borders, KPIs as one surface, charts integrated, bottom section merged. Applied:

  • KPIs: no card wrapper, just numbers on page with bottom rule
  • Charts: transparent card backgrounds, no containers
  • Tiles row (Tickets/Messaging/Alerts): no card wrappers, spacing-only separation
  • Cards use barely-there shadow (0 1px 2px rgba(0,0,0,0.03))
  • Sidebar matches page background (supportive, not dominant)
  • Topbar transparent
  • Mike’s reaction: “now we’re getting better”

Font Selection (~5:37 AM ET)

Mike: “I don’t think I like the font” — Geologica is a brand/marketing font, not optimal for data-dense product UI. Built a live comparison page (font-compare.html) with 5 options:

  • A: Inter (Linear/Figma standard)
  • B: DM Sans (in Twill brand guide)
  • C: Plus Jakarta Sans (warm, modern, fintech favorite)
  • D: Public Sans (institutional, B2B trust)
  • E: Outfit (contemporary geometric)

Mike chose C — Plus Jakarta Sans. “Oh yes the font change is so much better. Save that.”

Final font system (LOCKED):

  • Plus Jakarta Sans → interface layer (nav, headings, labels, buttons, badges)
  • Inter → data layer (tables, body text, inputs)
  • JetBrains Mono → numeric layer (all currency, percentages, metrics — tabular-nums mandatory)
  • Geologica → marketing/brand only, NOT in product

Next steps (from Mike ~5:49 AM ET):

  • Tighten spacing around elements
  • Play with organization of sections on dashboard — combine elements where they fit
  • Simpler the better
  • Reminder set for tomorrow (cron ID 2ce57987) at 2 PM PST to review in detail

V2 Current State:

  • File: /data/.openclaw/workspace/partner-dashboard-v2/index.html
  • Deploy: https://twill-dashboard-v2.pages.dev
  • Cloudflare project: twill-dashboard-v2
  • Design system: warm light (#F7F5F0 base), Notion-warm text (#37352F/#787774), earthy semantics, no-box layout, spacing-based hierarchy

TSYS File Research for Residual System (6:00 PM ET)

Nader asked to research TSYS files mentioned in Fireflies transcript (Twill intro call with Aaron Slominski and Pablo from GovPros — transcript ID 01KKWQQ5EXR0ZDSDH3C3H6Z7RA).

Files Mentioned in the Call

  1. D256 (Draft 256) — Fixed-width 256-byte transaction clearing records (inbound to TSYS)
  2. ADF (Acquirer Detail File) — Settlement output from TSYS with interchange qualifications and fees (most important for residuals)
  3. DDF (Daily Deposit File) — Daily merchant funding detail (what was deposited to merchant bank)
  4. ACH 310 — Standard NACHA format ACH file for actual bank transfers/merchant funding
  5. PPM (Pricing Portfolio Manager) — TSYS online pricing system (not a file, portal-based)

Key Insight from Call

Pablo: “it’s a combination of 3-4 reports that you have to marry up with each other from the processor, then marry that with your internal hierarchy partner” — residuals require ingesting ADF + DDF + ACH, marrying with partner splits and PPM pricing.

Research Findings

  • D256/ADF/DDF are proprietary TSYS formats, shared only under NDA — no public sample data files exist
  • Best public source for D256/ADF field layouts: GitHub repo neighbrum/adf_d256_parse (Python parsers with actual byte positions from TSYS spec)
  • TSYS CBOS docs at mreports.com have DDF and PPM field documentation
  • ACH/NACHA samples are publicly available (Hancock Whitney, ach-pro.com, Foundant, etc.)
  • Nader corrected: he wanted real samples from the internet, NOT fabricated/annotated files

Context

Goal is to build a system that ingests TSYS data and produces clean residual reports. Aaron/Pablo said TSYS provides file specs but zero support on parsing. Formats change ~3x/year with rate updates. Every ISO constructs residuals differently.

Files Created (then superseded by online research)

  • /data/.openclaw/workspace/data/tsys-file-samples/ — annotated sample files + overview doc (Nader preferred online sources instead)

V2 Dashboard — Residuals Merchants & Processors Tab Rebuild (~1-6:30 PM ET)

Mike reviewed the Residuals section and requested major changes to two tabs:

Merchants Tab (all implemented)

  1. Search/filter/pagination: Added toolbar with text search, processor dropdown (All/TSYS/Fiserv/Paysafe/WorldPay), health filter, and pagination footer (15/25/50/100 per page) — designed for 20k+ merchant scale
  2. Processor select dropdown: Filters entire table by processor
  3. Download Full Report button: For the 50-60 column export (not shown in UI)
  4. View Detail modal: Each row has a “View” button → opens full-width modal with:
    • Header: merchant name, MID, processor, agent, tenure, health/audit badges
    • 6 KPI tiles (MTD Volume, Net Income, Eff Rate, BPS Margin, CB Ratio, Agent Split)
    • 20-column scrollable table with 6 months of data
    • Download CSV per merchant
  5. Fee Audit flag column: Shows “Mismatch” badge for merchants with fee audit issues
  6. Health icons restored: KPI strip has 🟢🟡🔴⚫⚠️ icons with MoM context

Processors Tab (all implemented)

  1. Half-page chart + tiles layout: Income trend chart on left, 4 summary tiles (Gross Income, Expenses, Avg Agent Payout, CB Rate) on right
  2. Processor selector: Dropdown at top to isolate specific processor data
  3. Expanded comparison table: Added Expenses, Agent Payout, Margin, CB Rate, Billing Accuracy columns
  4. New comparison grids: Fee Breakdown by Processor, Agent Net Payout by Processor, Merchant Type Distribution, Chargeback Comparison

Other Fixes (same session)

  • Blank space at top of panels: Reduced .res-panel .content padding from 28px 36px to 12px 16px — affects all residual sub-panels including Payouts
  • Sticky table headers: All res-table thead th now have position:sticky; top:0 so rows scroll but headers stay pinned
  • Merchant table max-height: Added .res-table-scroll class with max-height:480px; overflow-y:auto

Earlier V2 Fixes (same day, earlier session ~1-2 PM ET)

  • Charts-row card transparency override (lines 1228-1231) removed — charts now have same card treatment as tiles
  • Donut chart height expanded to fill card (removed fixed height:160px)
  • Page title normalized to 16px (was 20px)
  • 30d/90d toggle restyled with navy active state (was unreadable yellow)
  • Card header system normalized across all cards

Deploy URLs

  • Latest (all fixes): https://6978c625.twill-dashboard-v2.pages.dev
  • Charts card fix: https://00e9066f.twill-dashboard-v2.pages.dev
  • Donut chart fix: https://71807635.twill-dashboard-v2.pages.dev
  • Card headers: https://40a87b26.twill-dashboard-v2.pages.dev

Slack Thread

  • All updates posted to D0AEU99JQKC thread 1773694881.925189
  • Mike’s feedback loop active — item-by-item review continuing

Evening Session — Ticket System & Chat UX (5 PM–8:30 PM ET)

Mike shifted focus to the inline ticketing system within merchant chat views. Multiple rounds of feedback and fixes.

Merchant Detail Modal — Horizontal Scrollbar

  • Mike reported no scrollbar visible on the merchant detail modal (100+ columns)
  • macOS hides scrollbars by default — added forced scrollbar CSS (-webkit-scrollbar styles + overflow-x:scroll)
  • Deploy: https://294f92a1.twill-dashboard-v2.pages.dev

Ticket System — Core Issues Identified & Fixed

Bug 1: connectToTicket only targeted ch-inp-main

  • The function hardcoded getElementById('ch-inp-main') — only worked in merchant-detail view
  • Rewrote to search the active view context: finds the .ch-inp in whichever merchant screen is active (merchant-detail, deal-room, merchant-active)
  • Uses fallback chain: wrapper.closest('aside') → active view → ID-based fallback

Bug 2: Scroll alignment on ticket create

  • Ticket tile was cut off after creation — gap between tile bottom and input area
  • Changed to thread.scrollTop = thread.scrollHeight for new tickets (scroll to max)
  • For existing ticket clicks: calculates exact offset to align tile bottom with thread bottom
  • Uses scrollIntoView({ block:'end', behavior:'smooth' }) as secondary approach

Bug 3: Chat input not highlighting when linked to ticket

  • Duplicate/conflicting CSS rules for .ch-inp.tkt-active (old at lines 1178-1180, new at 1228-1234)
  • Cleaned up to single enhanced rule: gold border (2px solid var(--yellow)), gold bg tint, box-shadow glow, gold placeholder text, gold send button
  • Applied !important to ensure override

Bug 4: No “Done” button inside the chat input

  • Mike wanted a visible “Done” button INSIDE the input tools row (not just in the indicator bar above)
  • Added ✓ Done — Release Ticket button to all 3 chat views: merchant-detail, deal-room, merchant-active
  • Gold filled button, only visible when tkt-active, clicking detaches ticket
  • CSS: .tkt-done-btn hidden by default, .ch-inp.tkt-active .tkt-done-btn { display:flex }

New Features Added

  1. Ticket indicator bar — gold gradient bar above chat input showing ”🎫 Replying to TKT-xxx” with ✕ Done
  2. Open ticket pills — strip above indicator showing all open tickets as clickable pills (gold=mine, blue=others, pulse animation for tickets with replies)
  3. Full border highlight — entire ch-inp gets gold border + shadow + bg tint when linked
  4. Done button in tools row — ”✓ Done — Release Ticket” in all 3 chat input areas

View Architecture (learned)

  • view-merchant-detail uses chatThread (hardcoded messages) + ch-inp-main + chatInput
  • view-deal-room uses drActivityThread (dynamically populated by populateDealRoom()) + drChatInput
  • view-merchant-active uses maActivityThread (dynamically populated) + maChatInput
  • navigateToMerchant() routes: DEAL_ROOM_STATUSES → deal-room, ACTIVE_STATUSES → merchant-active, else → merchant-detail
  • initChatTicketing() runs on view switch (100ms delay) and targets all 3 thread selectors

Key Lesson

  • Mike gets frustrated when changes are claimed but not verified. Always run headless browser test AND check screenshot before reporting to Mike.
  • Cache busting: always provide direct hash URL (e.g., https://6c60e5dc.twill-dashboard-v2.pages.dev) since CDN cache can serve stale pages

Deploy URLs (this session)

  • Scrollbar fix: https://294f92a1.twill-dashboard-v2.pages.dev
  • Ticket linking fix: https://e5ea62fa.twill-dashboard-v2.pages.dev
  • Scroll alignment: https://7711eaa3.twill-dashboard-v2.pages.dev
  • Indicator bar + pills: https://c816818f.twill-dashboard-v2.pages.dev
  • Scroll restored: https://f2fdb29d.twill-dashboard-v2.pages.dev
  • Done button in all views: https://6c60e5dc.twill-dashboard-v2.pages.dev

Open Items (as of 8:35 PM ET)

  • Mike reviewing latest deploy with Done button — awaiting feedback
  • res-agents panel still missing (Agents sub-tab of Residuals has no HTML)
  • Deal-room and merchant-active ticket pill/indicator bar need testing when dynamically populated
  • Remaining design review items TBD