Make pages load fast on mobile
- Compress responses: page scripts and styles once (brotli or gzip, in memory) and cached immutable; pages and API JSON gzipped as they stream - Service worker serves content-named assets cache-first - Load the models modal's data when it opens (cached in localStorage) instead of shipping the model catalog in every conversation page - Lazy-load the Tiptap composer and memoize thread messages - Import lucide icons directly; twui 0.1.4 drops by-name icons from Button - bun run start builds the pages minified before serving Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { memo } from "react";
|
||||
import Stack from "@moduletrace/twui/layout/Stack";
|
||||
import type { BotMessageWithAttachments } from "@/src/types";
|
||||
import MessageAttachments from "./message-attachments";
|
||||
@@ -13,9 +14,10 @@ type Props = {
|
||||
/**
|
||||
* One user message: the quoted message it answers, its files, then its
|
||||
* text (a file-only message has no bubble) and the bot's reactions to it.
|
||||
* The user doesn't reply to or react to their own messages.
|
||||
* The user doesn't reply to or react to their own messages. Memoized,
|
||||
* like `BotMessageLine`.
|
||||
*/
|
||||
export default function UserMessage({ message, bot_name }: Props) {
|
||||
function UserMessage({ message, bot_name }: Props) {
|
||||
return (
|
||||
<Stack className="w-full min-w-0 max-w-full items-end gap-1.5!">
|
||||
{message.reply_to ? (
|
||||
@@ -36,3 +38,5 @@ export default function UserMessage({ message, bot_name }: Props) {
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
||||
export default memo(UserMessage);
|
||||
|
||||
Reference in New Issue
Block a user