mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-18 03:23:23 +08:00
feat(feishu): watchlist entry in the menu card
This commit is contained in:
parent
10fd429852
commit
1790ec21ac
3 changed files with 42 additions and 35 deletions
68
lib/index.js
68
lib/index.js
File diff suppressed because one or more lines are too long
|
|
@ -1066,6 +1066,10 @@ export class FeishuHarnessBridge {
|
||||||
await this.#showWorkspaces({ chatId, key });
|
await this.#showWorkspaces({ chatId, key });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (action === 'watchlist') {
|
||||||
|
await this.#showWatchList(key, chatId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (action === 'new') {
|
if (action === 'new') {
|
||||||
await this.#state.clearSession(key);
|
await this.#state.clearSession(key);
|
||||||
await this.#send(chatId, '已开启全新 Harness 会话。');
|
await this.#send(chatId, '已开启全新 Harness 会话。');
|
||||||
|
|
@ -1118,7 +1122,7 @@ export class FeishuHarnessBridge {
|
||||||
|
|
||||||
async #handleMenuPick(menu, number, { chatId, key, event }) {
|
async #handleMenuPick(menu, number, { chatId, key, event }) {
|
||||||
if (menu.kind === 'menu') {
|
if (menu.kind === 'menu') {
|
||||||
const action = ['sessions', 'workspaces', 'new', 'status', 'help', 'repair'][number - 1];
|
const action = ['sessions', 'workspaces', 'new', 'status', 'help', 'repair', 'watchlist'][number - 1];
|
||||||
if (!action) {
|
if (!action) {
|
||||||
await this.#send(chatId, '菜单没有这个编号,回复 /m 重新打开。');
|
await this.#send(chatId, '菜单没有这个编号,回复 /m 重新打开。');
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@ export function menuCard() {
|
||||||
// have card.action.trigger yet, so rendering it as a callback button would
|
// have card.action.trigger yet, so rendering it as a callback button would
|
||||||
// send the user straight back to Feishu's broken callback setup popup.
|
// send the user straight back to Feishu's broken callback setup popup.
|
||||||
{ tag: 'div', text: markdown('**6 · 修复卡片按钮**(请直接回复数字 **6**)') },
|
{ tag: 'div', text: markdown('**6 · 修复卡片按钮**(请直接回复数字 **6**)') },
|
||||||
|
button('7 · 关注列表', 'watchlist'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -152,9 +153,11 @@ export function menuHelpText() {
|
||||||
'4 · /status 连接状态',
|
'4 · /status 连接状态',
|
||||||
'5 · /help 本帮助',
|
'5 · /help 本帮助',
|
||||||
'6 · /repair 修复卡片按钮(请回复数字 6)',
|
'6 · /repair 修复卡片按钮(请回复数字 6)',
|
||||||
|
'7 · /watchlist 关注列表',
|
||||||
'',
|
'',
|
||||||
'直接发送文字/图片即继续当前会话。',
|
'直接发送文字/图片即继续当前会话。',
|
||||||
'/session ID 或序号 绑定已有会话',
|
'/session ID 或序号 绑定已有会话',
|
||||||
|
'/watch ID 或序号 关注会话(完成后推送)',
|
||||||
'/compact 压缩上下文',
|
'/compact 压缩上下文',
|
||||||
'/workspace 绝对路径 切换工作区',
|
'/workspace 绝对路径 切换工作区',
|
||||||
].join('\n');
|
].join('\n');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue