20 Commits
Author SHA1 Message Date
Chris Troutner 962b2eb627 Lower tip dust limit to 600 sats and keep the like/tip modal editable after errors
Allow tips as low as 600 sats (tip output dust) while keeping the wallet
balance gate at 3000 sats to cover transaction fees. Keep the tip input and
Like button enabled after a validation error so the user can edit and retry.

By specifier.
2026-08-26 07:10:06 -07:00
Chris Troutner e7e758d370 Fix like/tip modal spendable balance against the live wallet
The Like/Tip modal crashed with "utxos.reduce is not a function" because
MemoLike.getSpendableSats assumed wallet.utxos was an array, while
minimal-slp-wallet exposes it as a UtxoStore object whose spendable BCH
outputs live under utxoStore.bchUtxos. Accept both shapes, and refresh the
wallet UTXOs before the modal's gating balance check.

By specifier.
2026-08-26 07:02:53 -07:00
Chris Troutner 61d50dfa88 Add architectural review for like-tip-memo
- Add three boundary unit tests to memo-like (tip == max, spendable ==
  dust, tip == spendable) closing mutation survivors.
- Refresh mutate4javascript and acceptance-mutation manifests from normal
  tool runs.
- Add written architectural review report for like-tip-memo.

By architect.
2026-08-26 06:40:27 -07:00
Chris Troutner 6b7a7e2b86 Reduce CRAP in like/tip slice and add property/coverage tests
- Extract helpers in memo-like to bring all CRAP scores to 6 or below.
- Consolidate duplicated rejection assertions in memo-like and like-tip-page tests.
- Add hex unit tests to close a coverage gap.
- Add property tests for hex round-trip, like validation, and spendable sum.

By refactorer.
2026-08-26 06:23:23 -07:00
Chris Troutner dd0535d133 Implement Like / Tip a Memo
Adds the Memo like action (0x6d04) with optional author tip, a like/tip
page controller, heart icon + modal UI, and acceptance handlers for
specs/like-tip-memo.feature.

By coder.
2026-08-26 06:14:01 -07:00
Chris Troutner de24180c4d Extract optimistic reply shaping into testable module
Move the optimistic reply object construction out of the ReplyThreadForm
React component into a testable service module with unit tests, keeping
the component a thin UI adapter. Behavior is preserved; all unit,
property, and acceptance tests pass.

By refactorer.
2026-08-26 04:40:45 -07:00
Chris Troutner 93e96e745b Add architectural review for reply-memo
Review the reply-memo feature (specifier spec, coder implementation,
refactorer test extraction). Kill two mutation survivors by adding tests
for the hexToBytes length check and the reply page successPath wiring.
Refresh mutation and acceptance mutation manifests from verification runs.

By architect.
2026-08-25 21:23:19 -07:00
Chris Troutner b4508e8909 Reduce DRY duplication in reply-memo tests
Refactor the coder's new memo-reply and reply-thread-page tests to use
the shared test helpers (fake wallet, MemoAction tests, page-controller
tests, page submit tests, page build wiring). Extend the memo-action and
page-build helpers to support the reply slice's extra parent-txid
argument and byte-based multi-byte tests. Behavior is preserved; all
unit, property, and acceptance tests pass.

By refactorer.
2026-08-25 21:15:07 -07:00
Chris Troutner 102997b620 Merge commit 'd33fda88ba' into swarmforge-refactorer 2026-08-25 21:10:20 -07:00
Chris Troutner d33fda88ba Implement Reply to a Memo behavior slice and acceptance handlers
- Add src/services/memo-reply.js for 0x6d03 reply broadcast with parent txid payload.
- Add src/services/reply-thread-page.js as the page controller for the reply form.
- Add unit tests for both modules.
- Extend acceptance/lib/handlers.js with reply thread steps.
- Skip navigation in PageController when successPath is unset.

By coder.
2026-08-25 21:09:37 -07:00
Chris Troutner 0159119921 Reduce DRY duplication in unit and property tests
Extract shared test helpers for the Memo post and Set Name behavior
slices: fake wallet/profiles, MemoAction tests, page-controller tests,
page build wiring, and shared property-test invariants. Behavior is
preserved; all unit, property, and acceptance tests pass.

By refactorer.
2026-08-25 20:30:24 -07:00
Chris Troutner 230618d2a0 Fix Set Name Buffer reference for browser
Replace Node-only Buffer.byteLength with a TextEncoder-based UTF-8 byte
length helper so the Set Name page and byte counter work in the browser.

By specifier.
2026-08-25 20:17:10 -07:00
Chris Troutner bd2eac54cf Implement Set Name feature (0x6d01)
- Add MemoSetName service with 77-byte UTF-8 validation and broadcast.
- Add SetNamePage controller with byte counter and navigation to /account.
- Add AccountPage controller showing stored name and Set Name button.
- Add Profiles session store to share the new name across pages.
- Add React views /memo/set-name and /account, plus nav link.
- Update acceptance handlers for set-name scenarios and fix fake wallet
  sendOpReturn signature to match public minimal-slp-wallet API.
- Update existing post memo tests to match the corrected wallet API.

By coder.
2026-08-25 19:50:27 -07:00
Chris Troutner 9dd9bf9274 Cover empty-message broadcast fallback and persist mutation state
Add a unit test for the broadcast-error message fallback to kill the last
new-post mutant, and commit the differential and acceptance mutation
manifests written by the approved tools during the architect verification
pass for the new-post-errors feature.

By architect.
2026-08-25 17:40:39 -07:00
Chris Troutner 164bdb3cba Surface broadcast errors on the new post page
Implements New Post Page scenario 6 (specs/memo-new.feature): when a memo
broadcast fails, the app surfaces the real wallet error and the user stays
on /posts/new instead of navigating to the feed.

- src/services/new-post.js: distinguish local validation errors from
  broadcast failures; expose the real error message via broadcastError.
- src/components/app-body/new-post/index.js: render the broadcast error.
- acceptance/lib/handlers.js: support wallet-fail, attempts-to-broadcast,
  error-containing, and remain-on-path steps.
- Unit tests for broadcast-failure surfacing.

By coder.
2026-08-25 17:33:28 -07:00
Chris Troutner 84f5fe7931 Fix standard lint in posting-state test
Rename a Promise constructor param to satisfy standard's promise/param-names.

By coder.
2026-08-25 17:13:16 -07:00
Chris Troutner 009fba71fd Add posting-state coverage and persist mutation state
Cover the new-post posting flag (initial idle, in-flight true, settled
false) to kill the four surviving mutants, and commit the differential and
acceptance mutation manifests written by the approved tools during the
architect verification pass for the new-post-page feature.

By architect.
2026-08-25 17:09:14 -07:00
Chris Troutner 05f393c03f Implement New Post Page
Adds a New Post page for composing and broadcasting Memo posts:
- src/services/new-post.js: testable controller (input, character counter
  counting down from the memo limit, validation/length errors, navigation to
  the recent feed after a successful post).
- src/components/app-body/new-post: React view with a message textarea, post
  button, and remaining-character counter.
- Route /posts/new and a navigation menu link.
- Extend acceptance step handlers to cover both specs/post-memo.feature and
  specs/memo-new.feature wording; add unit tests for the controller.
- Drop redundant 'use strict' in compiled modules to fix the CI build warning.

By coder.
2026-08-25 17:00:27 -07:00
Chris Troutner 8e2693ad08 Refactor memo-post for lower complexity
- Extract _throwIfInvalid and _reflectPost helpers from post()
- Consolidate duplicate validation tests into one parameterized test

By refactorer.
2026-08-25 16:17:23 -07:00
Chris Troutner 514298bf96 Implement Post a Memo behavior with acceptance pipeline
Implements the post-memo behavior slice per specs/post-memo.feature:
- src/services/memo-post.js: compose, validate (empty/length), and broadcast
  a Memo post OP_RETURN (0x6d02) via the minimal-slp-wallet adapter surface.
- Stands up the Babashka APS acceptance pipeline (entrypoint generator,
  runtime, regex step handlers, convenience runner).
- Adds focused unit tests for the memo behavior.

By coder.
2026-08-25 16:13:05 -07:00