+
+
+ {text.slice(0, 400)}
+
+
+
+
{pasteSummary(item)}
+
+
+
+ PASTED
+
+
+ {/* hover reveals it, but so must focus: `hidden` would take the only
+ way to drop a chip out of reach of the keyboard */}
+
+
+ );
+}
diff --git a/src/lib/composer-attachments.ts b/src/lib/composer-attachments.ts
new file mode 100644
index 000000000..30e20d969
--- /dev/null
+++ b/src/lib/composer-attachments.ts
@@ -0,0 +1,74 @@
+// Text pasted into the composer that is too long to live in the input.
+// It rides along as a chip and folds back into the message on send —
+// nothing here reaches the server, so every driver still sees a prompt.
+export type Attachment = {
+ kind: "paste";
+ id: string;
+ text: string;
+ size: number;
+ lines: number;
+};
+
+export function isAttachment(value: unknown): value is Attachment {
+ if (!value || typeof value !== "object") return false;
+ const attachment = value as Partial