feat(factories+connect): Discard button (#150 wallet) + My Join Attempts view (#152 wallet) - #49
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Wallet halves for two plugin RPCs that just landed in
superscalar-cln:factory-forget—superscalar-clnPR R7.8: append-only user action audit log #76 (task R5.28: JSDoc on CLN route shell (CLNHome + Overview + BTCWallet + CLNWallet) #150 plugin half)client-list-outgoing-joins—superscalar-clnPR R3.4: glossary modal for SuperScalar/bLIP-56 terms #77 (task R5.30: JSDoc on mutating-action surfaces (BTCDeposit + BTCWithdraw + CLNSend + CLNReceive) #152 plugin half)#150 wallet — Discard button on FactoryList
FactoryListItemnow has a Discard button next to Hide, only shown when the factory qualifies for the plugin'sfactory-forgetsafety gate:FAILEDorABORTED(orceremony === FAILEDas a fallback for the brief window before the LSP-side terminalize propagates to the client), ANDfunding_txidhas no non-zero hex chars (mirrors the plugin's zero-on-chain-footprint check), ANDn_channels === 0.Wired to
FactoriesService.forgetFactory+ a refetch of the factory list on success. Per-item busy state viadiscardingIds: Set<string>so rapid clicks don't double-fire.Also adds
FactoryLifecycle.FAILEDto 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
MyJoinAttemptsCardcomponent, rendered on the Connect page belowConnectList. Calls the newclient-list-outgoing-joinsRPC and renders a status-badged table of everyfactory-join-requestthis client has fired:instance_idtruncatedlsp_node_idtruncatedcontribution_satssent_at_blockstatus(sent/queued/accepted/signed/rejected/cancelled/timeout/already_member), optionalreasonbelowBadge 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— newFactoriesService.forgetFactory(instanceId)andFactoriesService.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
apps/frontend/src/types/factories.type.tsFactoryLifecycle.FAILEDenum valueapps/frontend/src/services/http.service.tsforgetFactory+listOutgoingJoinsapps/frontend/src/components/factories/FactoryList/FactoryList.tsxcanDiscard, Discard button,handleDiscard, FAILED inbucketOfapps/frontend/src/components/connect/MyJoinAttemptsCard/MyJoinAttemptsCard.tsxapps/frontend/src/components/connect/ConnectHome/ConnectHome.tsxMyJoinAttemptsCard