Keep retrying the connection and say why; never lose a message that didn't send

As the web's connection supervisor and composer:
- The first connection retries too, so tui3 opens without a server and
  connects when it's up. One-off commands still fail fast.
- The header says why it couldn't connect and when it retries; r, a
  click on it, or the palette retries now.
- Enter while disconnected keeps the message and says so.
- A failed send, or a new thread that doesn't start, puts the message,
  its attachments and its mentions back in the composer.
- Opening a PR in the browser says why it failed and copies the link.
- Error notices stay 8s instead of 4s.
This commit is contained in:
Callum Alpass committed 2026-11-02 23:13:06 +11:00
1 parent 275a2bcde1
commit 2c5eedc869
9 files changed
+169 -42

No files matched your search

+8 -1
View File
@@ -113,6 +113,13 @@ export function useComposerMenu(deps: {
const context = (text: string): OrchestrationMessageContext | undefined => messageContext(text, mentions.current.get(composerKey) ?? new Map());
/** The message went: its mentions go with it. */
const forget = () => mentions.current.delete(composerKey);
/** A message that didn't send came back to its composer: so do its mentions. */
const remember = (key: string, restored: OrchestrationMessageContext | undefined) => {
if (!restored) return;
const records = mentions.current.get(key) ?? new Map<string, ComposerContextRecord>();
for (const record of restored.records) records.set(record.contextId, record);
mentions.current.set(key, records);
};
const bindings: Binding[] = menu
? keys(
@@ -128,5 +135,5 @@ export function useComposerMenu(deps: {
)
: [];
return { menu, selected, sync, pick: (at: number) => menu && choose(menu.items[at]), context, forget, bindings };
return { menu, selected, sync, pick: (at: number) => menu && choose(menu.items[at]), context, forget, remember, bindings };
}