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:
2026-10-20 13:41:45 +01:00
co-authored by Claude Opus 5.5
parent 3b355d68bc
commit c1a94fc9a5
36 changed files with 840 additions and 147 deletions
+46 -53
View File
@@ -1,53 +1,46 @@
import Section from "@moduletrace/twui/layout/Section";
import Container from "@moduletrace/twui/layout/Container";
import H2 from "@moduletrace/twui/layout/H2";
import Stack from "@moduletrace/twui/layout/Stack";
import type { TWUILucideIconName } from "@moduletrace/twui/elements/lucide-icon";
import LucideIcon from "@moduletrace/twui/elements/lucide-icon";
import Span from "@moduletrace/twui/layout/Span";
import type { ReactNode } from "react";
type Props = {
tagline: string;
icon_name?: TWUILucideIconName;
sub_title?: string;
post_component?: ReactNode;
};
export default function TaglineSection({
tagline,
icon_name,
sub_title,
post_component,
}: Props) {
/**
* Render component
*/
return (
<Section className="bg-secondary relative">
<Container className="xl:py-10">
<Stack className="w-full items-center gap-6">
{icon_name && (
<LucideIcon
name={icon_name}
size={50}
className="text-accent"
/>
)}
<H2 className="text-center max-w-4xl xl:text-6xl! text-white">
{tagline}
</H2>
{sub_title ? (
<Span
className="text-white/80 max-w-4xl text-center"
size="larger"
>
{sub_title}
</Span>
) : null}
{post_component}
</Stack>
</Container>
</Section>
);
}
import Section from "@moduletrace/twui/layout/Section";
import Container from "@moduletrace/twui/layout/Container";
import H2 from "@moduletrace/twui/layout/H2";
import Stack from "@moduletrace/twui/layout/Stack";
import type { LucideIcon } from "lucide-react";
import Span from "@moduletrace/twui/layout/Span";
import type { ReactNode } from "react";
type Props = {
tagline: string;
icon?: LucideIcon;
sub_title?: string;
post_component?: ReactNode;
};
export default function TaglineSection({
tagline,
icon: Icon,
sub_title,
post_component,
}: Props) {
/**
* Render component
*/
return (
<Section className="bg-secondary relative">
<Container className="xl:py-10">
<Stack className="w-full items-center gap-6">
{Icon && <Icon size={50} className="text-accent" />}
<H2 className="text-center max-w-4xl xl:text-6xl! text-white">
{tagline}
</H2>
{sub_title ? (
<Span
className="text-white/80 max-w-4xl text-center"
size="larger"
>
{sub_title}
</Span>
) : null}
{post_component}
</Stack>
</Container>
</Section>
);
}