Repository navigation
feat(dapp): help button with an assistant, tickets, and an admin Tickets page - #196
Merged
Merged
Conversation
…nd files tickets A help button sits at the bottom right of every chain page. An assistant on Claude answers first, reading the person's recent off-ramp orders (read only, no bank details), and either answers, offers to send it to the team, or files a ticket when the person asks for a human or money looks stuck. Tickets carry the conversation and the orders as the server looked them up. The team reads and replies from a new Tickets page in the admin, beside the orders as they stand now. Replies show in the widget with a count on the button, and by email when the person signed in with one. New tickets and replies email ALERT_EMAIL when it is set. Assistant calls get their own rate-limit family: 10 a minute, 100 a day.
✅ Deploy Preview for useintentadapp ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for useintent ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
The help button is now an icon with the reply count on its corner. The first time someone opens a chain page with a wallet connected, a short note beside it says they can ask for help, raise a ticket or leave a suggestion there. It waits for any other notice on screen to close, and shows once per browser.
The header carries the Intent mark, a name and a status line, with a menu for a new conversation and the person's tickets. An empty chat shows one line and three ways to start; the composer is a single box with the send button inside it.
After the chain's beta notice is closed, the page dims and the help button stays bright beside a note that help, tickets and suggestions are here. A click outside, Escape, "Got it" or "Open help" ends it, and it shows once per browser.
The notice now matches the chat's cards: the chain's mark in a tile beside the title, the three risks as rows with a short lead to scan and the detail under it, and one button that is also the promise it asks for, "I'll start small". On a phone it rises as a bottom sheet. The uppercase release pill and the grey advice box are gone.
…ter it The browser specs pressed "I understand", which is now "I'll start small". Specs that start with the notice already seen have the help note seen too, so it never sits over what they test; the beta notice spec walks the whole first visit, notice then help note, and checks neither comes back after a reload.
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.
What this adds
For people using the app
For the team
ALERT_EMAILwhen it is set.How it works
lib/support/assistant.tsclaude-opus-5-5at low effort, with server-side refusal fallbacks.none,offer_ticketorfile_ticket), and a draft ticket.lib/support/context.tslooks up the person's orders on the server, from bothweave_ordersandnaira_orders. Every value goes throughpromptSafe. A ticket never takes orders from the page.lib/support/tickets.tsholds two tables,support_ticketsandsupport_messages. They are created on first use; migration018keeps them in sync.requesterOfuses: the email, orwallet:<address>. A person can only read and reply to their own tickets.supportrate-limit family: 10 a minute and 100 a day per caller, since every assistant message is a paid call.Tests
useEffectthat returned a promise in Edge, which is fixed.Before or after merge
ANTHROPIC_API_KEYmust be set on prod for the assistant to answer. Without it the widget says so and offers Send this to the team.ALERT_EMAILon prod decides whether the team gets an email per ticket. It is not changed here.