Repository navigation
Fix the silent frontend regression, wire peer-lost, and lock the contract with tests - #5
Open
XxHugheadxX wants to merge 4 commits into
Open
XxHugheadxX wants to merge 4 commits into
XxHugheadxX wants to merge 4 commits into
Conversation
af42c9d reduced MerchantDetailModal to { merchant, onClose } while DiscoverScreen kept passing onConnect, onSave and connecting. React does not warn about extra props, so the two actions silently disappeared. saveToWallet() is the only writer of wallet.loyaltyCards and its only caller was that dropped prop, so the wallet could never leave zero. The store handlers were untouched -- this only reconnects them, in the current 8-bit styling. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The store wired peer-found and status but never peer-lost, so a beacon that went out of range stayed in the visible list -- the gap called out in FRONTEND_INTEGRATION.md. The CLI TUI already handled it correctly. Also adds teardown(), which stops the beacon and the scan. network.stop() was added to the contract for this and had no caller, leaving the swarm open for the life of the app. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
FRONTEND_INTEGRATION.md freezes nine names that two consumers depend on. A rename already shipped once without either consumer noticing, and nothing failed. These six tests fail loudly instead. backend/mock.js takes an optional timings object so the suite does not wait out a timeline paced for a human watching --fake. Defaults are unchanged and verified: status 1s, peer-found 4s, peer-lost 19s, visitor every 5s. stop() now also clears the pending connect timer. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
AGENTS.md and the team plan both mandate pnpm: pear stage walks node_modules and depends on .npmrc node-linker=hoisted, so an npm install here is the documented cause of "works in dev, missing in the binary". frontend/package-lock.json (260 KB) was exactly the artifact the plan warned about. Removed, and package-lock.json / yarn.lock are now ignored so the next stray install cannot commit one. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This branch has not been deployed
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.
Phase 0 of the restructure plan: close the open wounds before building anything new. Four independent commits, each reviewable on its own.
Why
An audit of
mainturned up two live regressions and one piece of debt the team's own rules already forbade.af42c9dreducedMerchantDetailModalto{ merchant, onClose }whileDiscoverScreenkept passingonConnect,onSaveandconnecting. React does not warn about extra props, so Connect P2P and Save promo silently disappeared.saveToWallet()is the only writer ofwallet.loyaltyCardsand its only caller was that dropped prop, so the wallet could never leave zero. The store handlers were never removed — only the props that reach them.Separately,
app.store.jswiredpeer-foundandstatusbut neverpeer-lost, so a beacon that walked out of range stayed in the visible list. This is the gap already written down inFRONTEND_INTEGRATION.md; the CLI TUI handled it correctly all along.What changed
e1e916c7d0d8ddpeer-losthandler andteardown(), which stops the beacon and the scan.network.stop()was added to the contract for this and had no caller, leaving the swarm open for the life of the app.eb2237bbackend/mock.jsgains an optionaltimingsobject so the suite does not wait out a timeline paced for a human watching--fake.ce155affrontend/package-lock.json(260 KB) and blocks npm/yarn lockfiles.Verification
DataManager).require-awaitonasync stop()/update().--fakeverified end to end: the TUI receivesstatus, renders the beacon with its promo and hours, andpeer-lostclears it.stop()now also clears the pending connect timer, which previously leaked.Deliberately not in this PR
pear.stage.ignoreis untouched. It was on the Phase 0 list, but 45 of its entries hang offpear-runtime— they are build tooling (bare-build-*,bare-pack,bare-cov) excluded on purpose in491bee2. Validating a change needspear stage --dry-runagainst the real link. Rewriting it blind would risk the bundle and OTA, which is the part that currently works.The Spanish identifiers in
app.store.js:461('local-propio',propio: true) are left alone. They date toefafde2and belong to whoever ownsfrontend/src— flagging, not fixing, per the folder-ownership rule.AGENTS.mdrequires English in code, so this is worth a follow-up by that owner.Review note
This is the first PR under the rule the restructure plan proposes: no self-merges. PR #1 shipped 98 files with zero reviewers, which is how the regression above reached
mainunnoticed. Please have someone who ownsfrontend/srclook ate1e916cand7d0d8dd.🤖 Generated with Claude Code
https://claude.ai/code/session_01V9zUvsS38fU1M1hT9yFK6j