Load a conversation's history on the client
The conversation pages rendered their messages on the server, so a page the back button restored from the back-forward cache showed an old thread. The server now renders everything else (rail, header, composer) and the history (active session, latest messages, active task) loads from api/admin/bots/conversation-history once the page is on screen, with a loading line under the header, and again on a pageshow restore. Messages sent or pushed while it loads are merged with it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import Row from "@moduletrace/twui/layout/Row";
|
||||
import Span from "@moduletrace/twui/layout/Span";
|
||||
import Button from "@moduletrace/twui/layout/Button";
|
||||
|
||||
type Props = {
|
||||
error: string;
|
||||
onRetry: () => void;
|
||||
};
|
||||
|
||||
/**
|
||||
* Under the header when the conversation's history couldn't load: why,
|
||||
* and a way to try again.
|
||||
*/
|
||||
export default function HistoryErrorRow({ error, onRetry }: Props) {
|
||||
return (
|
||||
<Row className="shrink-0 gap-3! flex-nowrap justify-center px-6 py-3 border-0 border-b border-solid border-hairline">
|
||||
<Span className="text-sm text-ink-secondary">{error}</Span>
|
||||
<Button title="Try again" type="button" variant="ghost" color="text" onClick={onRetry}>
|
||||
Try again
|
||||
</Button>
|
||||
</Row>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user