Skip to content

feat(factories+connect): Discard button (#150 wallet) + My Join Attempts view (#152 wallet) - #49

Merged
8144225309 merged 1 commit into
mainfrom
feat/discard-and-join-attempts-150-152
May 29, 2026
Merged

feat(factories+connect): Discard button (#150 wallet) + My Join Attempts view (#152 wallet)#49
8144225309 merged 1 commit into
mainfrom
feat/discard-and-join-attempts-150-152

Conversation

@8144225309

Copy link
Copy Markdown
Owner

Background

Wallet halves for two plugin RPCs that just landed in superscalar-cln:

#150 wallet — Discard button on FactoryList

FactoryListItem now has a Discard button next to Hide, only shown when the factory qualifies for the plugin's factory-forget safety gate:

  • lifecycle is FAILED or ABORTED (or ceremony === FAILED as a fallback for the brief window before the LSP-side terminalize propagates to the client), AND
  • funding_txid has no non-zero hex chars (mirrors the plugin's zero-on-chain-footprint check), AND
  • n_channels === 0.

Wired to FactoriesService.forgetFactory + a refetch of the factory list on success. Per-item busy state via discardingIds: Set<string> so rapid clicks don't double-fire.

Also adds FactoryLifecycle.FAILED to the TS enum so PR #74's auto-terminalized factories render correctly (string mapping + bucketOf'incomplete').

#152 wallet — "My join attempts" view on Connect page

New MyJoinAttemptsCard component, rendered on the Connect page below ConnectList. Calls the new client-list-outgoing-joins RPC and renders a status-badged table of every factory-join-request this client has fired:

Column Source
Factory instance_id truncated
LSP lsp_node_id truncated
Requested (sat) contribution_sats
Sent at sent_at_block
Status status (sent / queued / accepted / signed / rejected / cancelled / timeout / already_member), optional reason below

Badge colors: warning (sent/queued/accepted), success (signed), danger (rejected/cancelled/timeout), info (already_member).

Empty state + manual Refresh button. Suppresses the noisy "method not found" pre-plugin-upgrade with a clear hint pointing at PR #77.

Plumbing

http.service.ts — new FactoriesService.forgetFactory(instanceId) and FactoriesService.listOutgoingJoins() wrappers, both typed to the plugin RPC response shape.

Backward compatibility

No behavior change for users on plugins that pre-date PRs #76 / #77 — the Discard button just stays hidden (canDiscard returns false), and MyJoinAttemptsCard shows the "Plugin does not expose ... yet" hint instead of a noisy crash.

Files changed

File Why
apps/frontend/src/types/factories.type.ts FactoryLifecycle.FAILED enum value
apps/frontend/src/services/http.service.ts forgetFactory + listOutgoingJoins
apps/frontend/src/components/factories/FactoryList/FactoryList.tsx canDiscard, Discard button, handleDiscard, FAILED in bucketOf
apps/frontend/src/components/connect/MyJoinAttemptsCard/MyJoinAttemptsCard.tsx new (#152 view)
apps/frontend/src/components/connect/ConnectHome/ConnectHome.tsx mounts MyJoinAttemptsCard

…pts view (#152 wallet)

Combined wallet half for two plugin RPCs that just landed:
  - factory-forget (superscalar-cln PR #76 / task #150 plugin half)
  - client-list-outgoing-joins (superscalar-cln PR #77 / task #152 plugin half)

#150 wallet half - Discard button on FactoryList
- Adds a Discard button next to Hide on each FactoryListItem, only shown
  when the factory qualifies for the plugin's factory-forget RPC:
    * lifecycle is FAILED or ABORTED (or ceremony=FAILED as a fallback
      for the brief window before the plugin auto-transitions the
      client side), AND
    * funding_txid has no non-zero hex chars (the plugin's zero-onchain-
      footprint gate), AND
    * n_channels === 0.
- Wires it to FactoriesService.forgetFactory + a refetch of the factory
  list on success. Per-item busy state via discardingIds Set so rapid
  clicks don't double-fire.
- Adds FactoryLifecycle.FAILED to the TS enum so PR #74's auto-
  terminalized factories render correctly (string mapping +
  bucketOf -> 'incomplete').

#152 wallet half - "My join attempts" view on Connect page
- New MyJoinAttemptsCard component below ConnectList. Calls the new
  client-list-outgoing-joins RPC, renders a status-badged table of
  every factory-join-request the client has fired (instance_id +
  lsp_node_id truncated, requested sats, sent block, status, optional
  reason).
- Status badge color: warning (sent/queued/accepted), success (signed),
  danger (rejected/cancelled/timeout), info (already_member).
- Empty state + manual Refresh button. Suppresses the noisy "method
  not found" before plugin upgrade ships with a clear hint pointing at
  PR #77.

Plumbing:
- http.service.ts: new FactoriesService.forgetFactory(instanceId) and
  FactoriesService.listOutgoingJoins() wrappers.

No behavior change for users on plugins that pre-date PRs #76 / #77;
the Discard button just stays hidden, and MyJoinAttemptsCard shows
the "Plugin does not expose ... yet" hint instead of a noisy crash.
@8144225309
8144225309 merged commit 14e0cc9 into main May 29, 2026
3 checks passed
@8144225309
8144225309 deleted the feat/discard-and-join-attempts-150-152 branch May 29, 2026 03:24
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.

1 participant