Skip to content

Allow for this chat: the picker, who it reaches, time left and End access; offer cards say what became of each - #2500

Merged
TheAnimatrix merged 5 commits into
masterfrom
issue-2490-chat-grant-ui
Nov 30, 2026
Merged

TheAnimatrix merged 5 commits into
masterfrom
issue-2490-chat-grant-ui

Conversation

@TheAnimatrix

@TheAnimatrix TheAnimatrix commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

#2497 adds "Allow for this chat" and offer outcomes on the backend, but no window can open a grant, see one, or end one. The offer cards also still say only "Send it" or "Waiting for you", whatever became of the offer.

Change

  • The link button. In a chat with a bot of another computer, the composer gets a link button: "Let Loki message bots here". It opens a pick of this computer's bots that take offered messages. The only such bot is picked already, and you can pick up to 8. Then press "Allow for this chat". The daemon decides; a refusal shows in its words ("Open the chat first, then allow it."). While the chat is allowed, the button stays lit and reopens the pick, so you can change the bots.

  • The line above the composer. While the grant is open, it reads "Loki can message Alpha and Beta here", then "9 min left" and End access. The time left moves calmly, once every 30 seconds. Another window shows the same line with "Allowed in another window" and no End access, and has no button.

  • When it ends. If the grant ends for a reason this window didn't give, the line says why once ("Nothing was sent for 10 minutes", "The connection dropped", and so on) until dismissed. Ending it yourself shows nothing. A Mac from before grants shows no button.

  • Offer cards. In the offering bot's chat (and on any device the offer isn't for), the card now says what the computer it is for reported:

    • Waiting for you on ANIMATRIX
    • Sent to Alpha on ANIMATRIX
    • Waiting on ANIMATRIX, which took its limit this hour
    • Expired before it was sent
    • Waiting on ANIMATRIX, which won't say when it's sent (an older PC)
    • No word from ANIMATRIX (still waiting a day later)

    The chat row above the card now only says "I'd like to send a message to a bot on ANIMATRIX."; the card says where it stands. On the PC, a card shows "This offer expired." with no Send. It reads its state again when the Mac's copy changes, so an offer sent under the grant turns into "Sent to Alpha" on its own.

  • Events. A grant change (bots.changed with grant) re-reads only that chat's grant, not the whole bot list. The daemon now also sends it when a message from the granting window starts the idle time again, so the minutes left move with each message.

  • Edges. The window keeps reading the grant while the Mac is offline, so an end then ("The connection dropped") is said once it is back. An open pick drops a bot made private meanwhile. An open Send card reads its offer again when the grant changes, so an offer whose grant ended says it expired even while the Mac can't say so.

  • Docs. docs/bots.md → "Allow for this chat" and the card states.

How to review

  1. src/renderer/components/bots/BotChatGrant.tsx: the hook, the line and the picker.
  2. BotOfferCard.tsx: waitingLine and the expired step.
  3. BotChatView.tsx: where they sit (the composer's actions and its notice line).

Verification

  • node scripts/verify.mjs PASS @ c273b91: 16 test files (621 tests, with the grant unit test and the two-daemon test) and both typechecks.
  • tests/renderer/botChatGrant.test.ts covers:
    • the pick and Allow (with what is sent);
    • the line with its time left;
    • End access;
    • another window's status line with no button;
    • an end this window didn't give, and Dismiss;
    • a Mac from before grants;
    • a refusal.
    • an end while the Mac is offline, told once it is back;
    • a bot made private while the pick is open.
  • tests/renderer/botOfferCard.test.ts adds the six states on the offering bot's chat, the expired card on the PC, a card that turns into Sent when the Mac's copy says so, and one that says it expired when the grant ends.
  • tests/net/bridge/routed/chatGrants.test.ts: a message from the granting window tells windows the new end.
  • Screenshots of each state (renderer with the app's CSS and store, Mousse Dark) are in the first comment.
  • Not checked: the installed app with two real computers.

Refs #2490

@TheAnimatrix

Copy link
Copy Markdown
Collaborator Author

States, rendered hidden with the app's CSS and store in Mousse Dark:

  1. The pick and "Allow for this chat"
  2. Allowed: who it reaches, time left, End access
  3. Another window: status only
  4. Ended (a reason this window didn't give)
  5. Offer card states in the offering bot's chat
  6. The offer card on the PC

grant-picker

grant-active

grant-other-window

grant-ended

offer-states-mac

offer-states-pc

…ile the Mac is offline is still told; the pick drops a bot made private; an open Send card says its offer expired when the grant ends
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant