@@ -87,9 +87,9 @@ const OPEN_KEY = "sp-chat-open";
8787
8888/**
8989 * What the canvas hands the chat panel when the button is pressed (canvasAttach.tsx): a picture
90- * to attach to the message, or the reason none was. A board comes over as a picture too, for its
91- * tile only: the agent is handed the board's file, which its name says, and the panel shows that
92- * name under the tile. And the start
90+ * to attach to the message, or the reason none was. A board, a video or a note comes over as a
91+ * picture too, for its tile only: the agent is handed the file its name says, and the panel shows
92+ * that name under the tile. And the start
9393 * of a message, from the strip's "+" (CanvasStrip.tsx), because a canvas is only ever the
9494 * agent's work, and a folder with no boards in it is not one. And a whole message, sent as it is,
9595 * from the new-project dialog (AppShell.tsx), which starts the agent defining the product.
@@ -105,8 +105,9 @@ const OPEN_KEY = "sp-chat-open";
105105export const CANVAS_ATTACH = "sp:canvas-attach" ;
106106
107107export type CanvasAttachDetail =
108- /** `page` for a mockup, whose drawing is only the tile's: the agent is handed its file. */
109- | { kind : "board" ; name : string ; src : string ; page ?: true }
108+ /** `reference` for anything but a picture, whose drawing is only the tile's: the agent is
109+ * pointed at its file instead. */
110+ | { kind : "board" ; name : string ; src : string ; reference ?: true }
110111 | { kind : "image" ; file : File }
111112 | { kind : "error" ; message : string }
112113 | { kind : "draft" ; text : string }
@@ -251,9 +252,9 @@ interface Attached {
251252 url : string ;
252253 /** A board still being drawn, with no `url` yet, or one whose drawing failed. */
253254 state ?: "pending" | "failed" ;
254- /** A mockup , and the project it was attached from, which the panel may since have left: the
255- * agent gets its file there rather than this picture of it (agents.ts). */
256- page ?: { project ?: string ; community ?: string } ;
255+ /** Anything but a picture , and the project it was attached from, which the panel may since
256+ * have left: the agent gets its file there rather than this picture of it (agents.ts). */
257+ reference ?: { project ?: string ; community ?: string } ;
257258}
258259
259260/**
@@ -718,7 +719,7 @@ export function ChatPanel(props: {
718719 type : r . file . type ,
719720 size : r . file . size ,
720721 url : r . url ,
721- page : t . page ,
722+ reference : t . reference ,
722723 }
723724 : t ;
724725 } ) ;
@@ -764,7 +765,7 @@ export function ChatPanel(props: {
764765 * drawing asked of the server, to land in that tile. Asked for again it keeps the tile it has —
765766 * one already there or on its way is only named again, and one that failed is drawn again.
766767 */
767- const addBoard = ( name : string , src : string , page ?: true ) => {
768+ const addBoard = ( name : string , src : string , reference ?: true ) => {
768769 let tile = tray . current . find ( ( t ) => t . name === name ) ;
769770 if ( ! tile && tray . current . length >= MAX_IMAGES )
770771 return setSendError (
@@ -785,7 +786,7 @@ export function ChatPanel(props: {
785786 size : 0 ,
786787 url : "" ,
787788 state : "pending" ,
788- page : page && { project, community } ,
789+ reference : reference && { project, community } ,
789790 } ;
790791 const next = tile ;
791792 tray . current = [ ...tray . current . filter ( ( t ) => t . n !== next . n ) , next ] . sort (
@@ -827,7 +828,7 @@ export function ChatPanel(props: {
827828 // that is still being read.
828829 if ( detail . kind === "board" ) {
829830 adds . current = adds . current . then ( ( ) =>
830- addBoard ( detail . name , detail . src , detail . page ) ,
831+ addBoard ( detail . name , detail . src , detail . reference ) ,
831832 ) ;
832833 return ;
833834 }
@@ -945,12 +946,12 @@ export function ChatPanel(props: {
945946 agent,
946947 model,
947948 effort,
948- images : attached . map ( ( { n, name, type, url, page } ) => ( {
949+ images : attached . map ( ( { n, name, type, url, reference } ) => ( {
949950 n,
950951 name,
951952 type,
952953 data : url . slice ( url . indexOf ( "," ) + 1 ) ,
953- page ,
954+ reference ,
954955 } ) ) ,
955956 } ) ,
956957 } ) ;
0 commit comments