Skip to content

feat: move lightning payment filtering to client with full state display#237

Merged
macterra merged 4 commits intomainfrom
236-lightning-payment-filtering
Mar 18, 2026
Merged

feat: move lightning payment filtering to client with full state display#237
macterra merged 4 commits intomainfrom
236-lightning-payment-filtering

Conversation

@macterra
Copy link
Copy Markdown
Collaborator

@macterra macterra commented Mar 18, 2026

Summary

  • Removes server-side status === 'success' filter in lnbits.ts — all payments passed through with full state
  • Extends LightningPaymentRecord with status: 'success' | 'pending' | 'failed' and expiry?: string
  • Client derives display status: settled, pending, failed, or expired (pending payments with a past expiry, incoming or outgoing)
  • Updates payments table in all four client apps: Date, Amount (sats), Fee, Status, Memo — fixed column widths via tableLayout: fixed and colgroup

Test plan

  • Settled payments show as settled
  • Pending payments with future expiry show as pending
  • Pending payments with past expiry show as expired
  • Failed payments show as failed
  • Memo column grows with page width; other columns stay fixed
  • All four clients (react-wallet, browser-extension, gatekeeper-client, keymaster-client) render consistently

Closes #236

🤖 Generated with Claude Code

macterra and others added 3 commits March 18, 2026 18:09
Removes server-side filtering of payments to only 'success' status.
All payments are now passed through with status (success/pending/failed)
and expiry fields, and the client derives display state: settled, pending,
failed, or expired (pending payments whose expiry timestamp has passed).

Updates payments table in all four client apps with new column layout:
Date, Amount (sats), Fee, Status, Memo — fixed widths via tableLayout.

Closes #236

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds four checkboxes (settled, pending, failed, expired) next to the
Refresh button to filter displayed payments by status in all four
client apps.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@macterra macterra requested a review from Copilot March 18, 2026 22:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Moves Lightning payment state handling to the clients by returning all LNbits payments (not just status === 'success') and adding richer status/expiry fields so UIs can display settled / pending / failed / expired consistently across apps.

Changes:

  • Removed server-side success-only filtering and exposed LNbits status (and expiry) with each payment record.
  • Extended the shared LightningPaymentRecord type and updated client UIs to compute a display status and add status filter checkboxes.
  • Refactored the payments tables across four clients to a consistent fixed-layout column design (Date / Amount / Fee / Status / Memo).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
services/drawbridge/server/src/lnbits.ts Returns all LNbits payments and maps status/expiry through the API response.
packages/gatekeeper/src/types.ts Extends LightningPaymentRecord with status and expiry fields (and clarifies amount sign).
apps/react-wallet/src/components/LightningTab.tsx Adds status filters and a fixed-layout payments table with derived display status.
apps/browser-extension/src/components/LightningTab.tsx Mirrors react-wallet Lightning payments UI updates for consistent display/status filtering.
apps/gatekeeper-client/src/KeymasterUI.jsx Updates payments tab table layout and client-side derived status + filters.
apps/keymaster-client/src/KeymasterUI.jsx Updates payments tab table layout and client-side derived status + filters.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread services/drawbridge/server/src/lnbits.ts Outdated
Comment thread services/drawbridge/server/src/lnbits.ts
Comment thread packages/gatekeeper/src/types.ts
Comment thread apps/react-wallet/src/components/LightningTab.tsx
Comment thread apps/browser-extension/src/components/LightningTab.tsx
Comment thread apps/keymaster-client/src/KeymasterUI.jsx
Comment thread apps/gatekeeper-client/src/KeymasterUI.jsx
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@macterra macterra merged commit 0eee4c0 into main Mar 18, 2026
13 checks passed
@macterra macterra deleted the 236-lightning-payment-filtering branch March 18, 2026 22:57
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.

Move lightning payment filtering to client with settled/pending/expired/failed states

2 participants