@@ -1565,40 +1565,49 @@ describe("feishuPlugin actions", () => {
15651565 ] ) ;
15661566 } ) ;
15671567
1568- it ( "renders presentation select labels into the card fallback" , async ( ) => {
1569- sendCardFeishuMock . mockResolvedValueOnce ( { messageId : "om_card" , chatId : "oc_group_1" } ) ;
1568+ it . each ( [ "send" , "thread-reply" ] as const ) (
1569+ "preserves select commands in the %s card fallback without exposing callback values" ,
1570+ async ( action ) => {
1571+ sendCardFeishuMock . mockResolvedValueOnce ( { messageId : "om_card" , chatId : "oc_group_1" } ) ;
15701572
1571- await feishuPlugin . actions ?. handleAction ?.( {
1572- action : "send" ,
1573- params : {
1574- to : "chat:oc_group_1" ,
1575- presentation : {
1576- blocks : [
1577- {
1578- type : "select" ,
1579- placeholder : "Pick one" ,
1580- options : [ { label : "Option A" , value : "a" } ] ,
1581- } ,
1582- ] ,
1573+ await feishuPlugin . actions ?. handleAction ?.( {
1574+ action,
1575+ params : {
1576+ to : "chat:oc_group_1" ,
1577+ ...( action === "thread-reply" ? { messageId : "om_root" } : { } ) ,
1578+ presentation : {
1579+ blocks : [
1580+ {
1581+ type : "select" ,
1582+ placeholder : "Pick <one> & continue" ,
1583+ options : [
1584+ { label : "Status <one>" , action : { type : "command" , command : "/status" } } ,
1585+ { label : "Callback" , action : { type : "callback" , value : "/opaque-callback" } } ,
1586+ { label : "Legacy" , value : "/opaque-legacy" } ,
1587+ ] ,
1588+ } ,
1589+ ] ,
1590+ } ,
15831591 } ,
1584- } ,
1585- cfg,
1586- accountId : undefined ,
1587- toolContext : { } ,
1588- } as never ) ;
1592+ cfg,
1593+ accountId : undefined ,
1594+ toolContext : { } ,
1595+ } as never ) ;
15891596
1590- const sendCardArgs = requireRecord (
1591- mockCallArg ( sendCardFeishuMock , 0 , 0 , "sendCardFeishu" ) ,
1592- "send card args" ,
1593- ) ;
1594- const card = requireRecord ( sendCardArgs . card , "card" ) ;
1595- expect ( requireRecord ( card . body , "card body" ) . elements ) . toEqual ( [
1596- {
1597- tag : "markdown" ,
1598- content : "Pick one:\n- Option A" ,
1599- } ,
1600- ] ) ;
1601- } ) ;
1597+ const sendCardArgs = requireRecord (
1598+ mockCallArg ( sendCardFeishuMock , 0 , 0 , "sendCardFeishu" ) ,
1599+ "send card args" ,
1600+ ) ;
1601+ const card = requireRecord ( sendCardArgs . card , "card" ) ;
1602+ expect ( requireRecord ( card . body , "card body" ) . elements ) . toEqual ( [
1603+ {
1604+ tag : "markdown" ,
1605+ content :
1606+ "Pick <one> & continue:\n- Status <one>: `/status`\n- Callback\n- Legacy" ,
1607+ } ,
1608+ ] ) ;
1609+ } ,
1610+ ) ;
16021611
16031612 it . each (
16041613 [
0 commit comments