[claude] Mobile: Job history tab showing completed jobs (#31) #107

Merged
claude merged 1 commits from claude/issue-31 into main 2026-03-24 02:26:14 +00:00
Collaborator

Fixes #31

What was done

Added a "⏱ HISTORY" bottom-sheet panel that persists and displays the user's completed jobs on mobile and desktop.

Changes

  • history.js (new) — localStorage-backed history store (timmy_history_v1, up to 50 entries). Renders job rows with: truncated prompt (2-line clamp), cost in sats / "free" / "rejected", relative timestamp ("2 min ago"), chevron indicator. Tap any row to expand the full result with a smooth CSS max-height transition. Pull-to-refresh (drag down at top) and a REFRESH button.
  • index.html — Added the History panel HTML (bottom sheet, slides up from below the input bar) and all CSS. Added ⏱ HISTORY button to the top-button bar.
  • payment.js — Calls addHistoryEntry() when a Lightning job reaches complete or rejected state, including cost from costLedger.
  • session.js — Calls addHistoryEntry() after each session request completes, computing cost from the balance delta.
  • main.js — Imports and calls initHistoryPanel() on first init.

Notes

  • Data source is localStorage (the backend has no GET /api/jobs list endpoint). Jobs are recorded as they complete in this browser session and persist across page reloads.
  • Empty state: "No completed jobs yet. Submit a job to see your history here."
  • Build verified with vite build — no errors.
Fixes #31 ## What was done Added a "⏱ HISTORY" bottom-sheet panel that persists and displays the user's completed jobs on mobile and desktop. ### Changes - **`history.js`** (new) — localStorage-backed history store (`timmy_history_v1`, up to 50 entries). Renders job rows with: truncated prompt (2-line clamp), cost in sats / "free" / "rejected", relative timestamp ("2 min ago"), chevron indicator. Tap any row to expand the full result with a smooth CSS `max-height` transition. Pull-to-refresh (drag down at top) and a REFRESH button. - **`index.html`** — Added the History panel HTML (bottom sheet, slides up from below the input bar) and all CSS. Added `⏱ HISTORY` button to the top-button bar. - **`payment.js`** — Calls `addHistoryEntry()` when a Lightning job reaches `complete` or `rejected` state, including cost from `costLedger`. - **`session.js`** — Calls `addHistoryEntry()` after each session request completes, computing cost from the balance delta. - **`main.js`** — Imports and calls `initHistoryPanel()` on first init. ### Notes - Data source is localStorage (the backend has no `GET /api/jobs` list endpoint). Jobs are recorded as they complete in this browser session and persist across page reloads. - Empty state: "No completed jobs yet. Submit a job to see your history here." - Build verified with `vite build` — no errors.
claude added 1 commit 2026-03-24 02:25:36 +00:00
feat: add job history tab with localStorage persistence (#31)
Some checks failed
CI / Typecheck & Lint (pull_request) Failing after 0s
7b10d088ec
Add a bottom-sheet History panel that shows completed jobs in reverse
chronological order with expandable results.

- New history.js module: persists up to 50 jobs in localStorage
  (timmy_history_v1), renders rows with prompt/cost/relative-time,
  smooth expand/collapse animation, pull-to-refresh and refresh button
- index.html: History panel HTML + CSS (bottom sheet slides up from
  bottom edge), "⏱ HISTORY" button added to top-buttons bar
- payment.js: calls addHistoryEntry() when a Lightning job reaches
  complete or rejected state; tracks currentRequest across async flow
- session.js: calls addHistoryEntry() after each session request
  completes, computing cost from balance delta
- main.js: imports and calls initHistoryPanel() on first init

Fixes #31

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
claude merged commit b6569aeedc into main 2026-03-24 02:26:14 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: replit/timmy-tower#107