@@ -1336,40 +1336,49 @@ describe("feishuPlugin actions", () => {
13361336 ] ) ;
13371337 } ) ;
13381338
1339- it ( "renders presentation select labels into the card fallback" , async ( ) => {
1340- sendCardFeishuMock . mockResolvedValueOnce ( { messageId : "om_card" , chatId : "oc_group_1" } ) ;
1339+ it . each ( [ "send" , "thread-reply" ] as const ) (
1340+ "preserves select commands in the %s card fallback without exposing callback values" ,
1341+ async ( action ) => {
1342+ sendCardFeishuMock . mockResolvedValueOnce ( { messageId : "om_card" , chatId : "oc_group_1" } ) ;
13411343
1342- await feishuPlugin . actions ?. handleAction ?.( {
1343- action : "send" ,
1344- params : {
1345- to : "chat:oc_group_1" ,
1346- presentation : {
1347- blocks : [
1348- {
1349- type : "select" ,
1350- placeholder : "Pick one" ,
1351- options : [ { label : "Option A" , value : "a" } ] ,
1352- } ,
1353- ] ,
1344+ await feishuPlugin . actions ?. handleAction ?.( {
1345+ action,
1346+ params : {
1347+ to : "chat:oc_group_1" ,
1348+ ...( action === "thread-reply" ? { messageId : "om_root" } : { } ) ,
1349+ presentation : {
1350+ blocks : [
1351+ {
1352+ type : "select" ,
1353+ placeholder : "Pick <one> & continue" ,
1354+ options : [
1355+ { label : "Status <one>" , action : { type : "command" , command : "/status" } } ,
1356+ { label : "Callback" , action : { type : "callback" , value : "/opaque-callback" } } ,
1357+ { label : "Legacy" , value : "/opaque-legacy" } ,
1358+ ] ,
1359+ } ,
1360+ ] ,
1361+ } ,
13541362 } ,
1355- } ,
1356- cfg,
1357- accountId : undefined ,
1358- toolContext : { } ,
1359- } as never ) ;
1363+ cfg,
1364+ accountId : undefined ,
1365+ toolContext : { } ,
1366+ } as never ) ;
13601367
1361- const sendCardArgs = requireRecord (
1362- mockCallArg ( sendCardFeishuMock , 0 , 0 , "sendCardFeishu" ) ,
1363- "send card args" ,
1364- ) ;
1365- const card = requireRecord ( sendCardArgs . card , "card" ) ;
1366- expect ( requireRecord ( card . body , "card body" ) . elements ) . toEqual ( [
1367- {
1368- tag : "markdown" ,
1369- content : "Pick one:\n- Option A" ,
1370- } ,
1371- ] ) ;
1372- } ) ;
1368+ const sendCardArgs = requireRecord (
1369+ mockCallArg ( sendCardFeishuMock , 0 , 0 , "sendCardFeishu" ) ,
1370+ "send card args" ,
1371+ ) ;
1372+ const card = requireRecord ( sendCardArgs . card , "card" ) ;
1373+ expect ( requireRecord ( card . body , "card body" ) . elements ) . toEqual ( [
1374+ {
1375+ tag : "markdown" ,
1376+ content :
1377+ "Pick <one> & continue:\n- Status <one>: `/status`\n- Callback\n- Legacy" ,
1378+ } ,
1379+ ] ) ;
1380+ } ,
1381+ ) ;
13731382
13741383 it . each (
13751384 [
0 commit comments