Skip to content

fix(frontend): show what an order actually is, and alert its owner - #14

Merged
LSUDOKO merged 2 commits into
mainfrom
feat/order-recall-and-alerts
Aug 13, 2026
Merged

fix(frontend): show what an order actually is, and alert its owner#14
LSUDOKO merged 2 commits into
mainfrom
feat/order-recall-and-alerts

Conversation

@LSUDOKO

@LSUDOKO LSUDOKO commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Three things that together made the app look empty even though every feature was built.

remember() was never called

The recall module was imported and read by the order card, but nothing ever wrote to it. Every card — including one sealed seconds earlier — rendered "Sealed from another browser, so this device cannot show the condition."

The ciphertext is encrypted to the enclave, not to the user, so without that local copy nobody, the owner included, can ever read the condition back. Six order kinds existed and none were visible.

describe() knew only one kind

It rendered every order as "Sell when price falls to $X" regardless of what it was. A trailing stop has no trigger price, a shield has no price at all, a TWAP has a schedule — so the description was a confident lie about where the money exits, which is worse than saying nothing.

Each kind now gets its own sentence. Orders sealed before the mode was recorded still read correctly as price orders.

Order cards also gained a kind badge, shown only on the owner's own device — to anyone else the order stays opaque, which is the point.

Telegram reached only the operator

A browser notification arrives only if the tab is open, which is exactly the wrong moment. Owners now subscribe their wallet in an Alerts panel; the keeper — the only part awake when a trigger fires — messages them.

recipientsFor separates the operator firehose from per-owner routing at the point of decision, tested against the case that matters: one owner's fill can never land in another owner's chat.

Also

The escrow token was labelled FXRP in three places while the default escrow is wrapped native, so the balance shown disagreed with the balance held. All three now follow the live symbol.

Tests

96 Solidity · 80 Go · 33 keeper · 30 frontend — all pass, build exit 0.

🤖 Generated with Claude Code

Two bugs and a gap that together made the app look empty.

`remember()` was never called
-----------------------------
The recall module was imported and wired into the order card, but nothing ever
wrote to it. So every card — including the user's own, sealed seconds earlier —
rendered "Sealed from another browser, so this device cannot show the
condition." The ciphertext is encrypted to the enclave rather than to the user,
so without that local copy nobody, the owner included, can ever read the
condition back. Six order kinds existed and none of them were visible.

`describe()` knew only one kind
-------------------------------
It rendered every order as "Sell when price falls to $X" regardless of what it
actually was. A trailing stop has no trigger price, a shield has no price at
all, and a TWAP has a schedule instead — so the description was not merely
unhelpful, it was a confident lie about where the money exits. Each kind now
gets its own sentence, and an order sealed before the mode was recorded still
reads correctly as a price order rather than crashing.

Order cards also gained a kind badge, shown only on the owner's own device
because only that device knows the kind. To anyone else the order stays opaque,
which is the point.

Telegram alerts reached only the operator
-----------------------------------------
A browser notification arrives only if the tab is open, which is exactly the
wrong moment: an order fires while its owner is asleep. The keeper is the only
part of the system awake then, so it is what sends these.

Owners now subscribe their own wallet in an Alerts panel, and `recipientsFor`
keeps the operator firehose and per-owner routing apart at the point of
decision — tested against the case that matters, that one owner's fill can
never land in another owner's chat. Alerts carry the order id, the action and
the transaction; never the condition, which never leaves the enclave.

Also: the escrow token was labelled FXRP in three places while the default
escrow is wrapped native, so the balance a user saw disagreed with the balance
they held. All three now follow the live symbol.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@LSUDOKO, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 79 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 054341ad-766d-4c05-b13d-e530009f7a8a

📥 Commits

Reviewing files that changed from the base of the PR and between a4d1496 and fb296b4.

📒 Files selected for processing (14)
  • .gitignore
  • README.md
  • contracts/script/Deploy.s.sol
  • frontend/.env.example
  • frontend/app/api/alerts/route.ts
  • frontend/app/app/page.tsx
  • frontend/app/components/Alerts.tsx
  • frontend/app/globals.css
  • frontend/lib/recall.test.ts
  • frontend/lib/recall.ts
  • keeper/README.md
  • keeper/src/index.js
  • keeper/src/lib.js
  • keeper/test/lib.test.js

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

next.config.mjs writes frontend/AGENTS.md and frontend/CLAUDE.md on every
build, so they are build output rather than authored guidance and were being
committed by accident. The repo's real agent guide is the root AGENTS.md.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@LSUDOKO
LSUDOKO merged commit 801872f into main Aug 13, 2026
6 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.11.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant