@@ -6,8 +6,6 @@ export const REMOVE_QUEUED_MESSAGE_ACCESSIBILITY_LABEL = "Remove queued message"
66export interface ThreadQueueRowControls {
77 readonly canDismiss : boolean ;
88 readonly canEdit : boolean ;
9- readonly canMoveDown : boolean ;
10- readonly canMoveUp : boolean ;
119 readonly canSend : boolean ;
1210 readonly dismissAccessibilityLabel : string ;
1311 readonly displayText : string ;
@@ -18,14 +16,11 @@ export function resolveThreadQueueRowControls(input: {
1816 readonly busy : boolean ;
1917 readonly canPromoteToSteer : boolean ;
2018 readonly canSendNow : boolean ;
21- readonly canReorder : boolean ;
2219 /** Something else holds the composer, such as an open question. */
2320 readonly editBlocked ?: boolean ;
24- readonly index : number ;
2521 readonly isEditing ?: boolean ;
2622 /** A guest's message keeps the guest's words; the owner can cancel it, not rewrite it. */
2723 readonly isGuestMessage ?: boolean ;
28- readonly queuedCount : number ;
2924 readonly text : string ;
3025} ) : ThreadQueueRowControls {
3126 const mutationEnabled = ! input . busy ;
@@ -37,8 +32,6 @@ export function resolveThreadQueueRowControls(input: {
3732 // away whatever has been typed since.
3833 canEdit :
3934 mutationEnabled && ! isEditing && input . isGuestMessage !== true && input . editBlocked !== true ,
40- canMoveDown : mutationEnabled && input . canReorder && input . index < input . queuedCount - 1 ,
41- canMoveUp : mutationEnabled && input . canReorder && input . index > 0 ,
4235 canSend : mutationEnabled && ( input . canPromoteToSteer || input . canSendNow ) && ! isEditing ,
4336 dismissAccessibilityLabel : REMOVE_QUEUED_MESSAGE_ACCESSIBILITY_LABEL ,
4437 // Editing and sending keep the original text so quoted citations stay linked.
@@ -66,27 +59,3 @@ export function buildCancelQueuedRunCommand(input: {
6659 } ,
6760 } ;
6861}
69-
70- export function resolveQueueDragBeforeRunId (
71- rows : ReadonlyArray < { id : RunId ; y ?: number ; height ?: number } > ,
72- runId : RunId ,
73- translationY : number ,
74- ) : RunId | null | undefined {
75- const sourceIndex = rows . findIndex ( ( row ) => row . id === runId ) ;
76- const source = rows [ sourceIndex ] ;
77- if ( ! source || rows . some ( ( row ) => row . y === undefined || row . height === undefined ) ) return ;
78- const center = source . y ! + source . height ! / 2 + translationY ;
79- const remaining = rows . filter ( ( row ) => row . id !== runId ) ;
80- return remaining . find ( ( row ) => center < row . y ! + row . height ! / 2 ) ?. id ?? null ;
81- }
82-
83- export function resolveQueueDropBeforeRunId (
84- rows : ReadonlyArray < { id : RunId ; y ?: number ; height ?: number } > ,
85- runId : RunId ,
86- translationY : number ,
87- ) : RunId | null | undefined {
88- const before = resolveQueueDragBeforeRunId ( rows , runId , translationY ) ;
89- if ( before === undefined ) return ;
90- const sourceIndex = rows . findIndex ( ( row ) => row . id === runId ) ;
91- return before === ( rows [ sourceIndex + 1 ] ?. id ?? null ) ? undefined : before ;
92- }
0 commit comments