feat: 添加用户手册功能
- 新增用户手册 Markdown 文档及配套截图 - 新增打开用户手册命令 - 在侧边栏和主面板中集成用户手册入口 - 优化用户手册打开方式,支持 Markdown 预览
This commit is contained in:
@ -181,6 +181,15 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
}
|
||||
);
|
||||
|
||||
// 注册命令:打开用户手册
|
||||
const openUserManualCommand = vscode.commands.registerCommand(
|
||||
"ic-coder.openUserManual",
|
||||
async () => {
|
||||
const manualPath = vscode.Uri.joinPath(context.extensionUri, "media", "USER_MANUAL.md");
|
||||
await vscode.commands.executeCommand("markdown.showPreview", manualPath);
|
||||
}
|
||||
);
|
||||
|
||||
// 注册命令:用户登录
|
||||
const loginCommand = vscode.commands.registerCommand(
|
||||
"ic-coder.login",
|
||||
@ -425,6 +434,7 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
openChatCommand,
|
||||
openVCDViewerCommand,
|
||||
openVCDViewerInBrowserCommand,
|
||||
openUserManualCommand,
|
||||
loginCommand,
|
||||
logoutCommand,
|
||||
changeInvitationCodeCommand,
|
||||
|
||||
@ -492,7 +492,7 @@ export async function showICHelperPanel(
|
||||
break;
|
||||
case "openUserManual":
|
||||
// 打开用户手册
|
||||
vscode.env.openExternal(vscode.Uri.parse("https://www.iccoder.com"));
|
||||
vscode.commands.executeCommand("ic-coder.openUserManual");
|
||||
break;
|
||||
case "openUserFeedback":
|
||||
// 打开用户反馈二维码弹窗
|
||||
|
||||
@ -125,6 +125,10 @@ export function showICHelperPanel(context: vscode.ExtensionContext) {
|
||||
case "showWarning":
|
||||
vscode.window.showWarningMessage(message.message);
|
||||
break;
|
||||
// 新增:打开用户手册
|
||||
case "openUserManual":
|
||||
vscode.commands.executeCommand("ic-coder.openUserManual");
|
||||
break;
|
||||
// 新增:处理用户回答
|
||||
case "submitAnswer":
|
||||
handleUserAnswer(
|
||||
@ -224,6 +228,9 @@ export class ICViewProvider implements vscode.WebviewViewProvider {
|
||||
} else if (message.command === "openICCoder") {
|
||||
// 打开 IC Coder 官网
|
||||
vscode.env.openExternal(vscode.Uri.parse('https://www.iccoder.com'));
|
||||
} else if (message.command === "openUserManual") {
|
||||
// 打开用户手册
|
||||
vscode.commands.executeCommand("ic-coder.openUserManual");
|
||||
} else if (message.command === "openExternalUrl") {
|
||||
// 打开外部链接
|
||||
if (message.url) {
|
||||
|
||||
@ -18,6 +18,11 @@ import {
|
||||
getMessageAreaScript,
|
||||
} from "./messageArea";
|
||||
import { getAgentCardStyles, getAgentCardScript } from "./agentCard";
|
||||
import {
|
||||
getMoreOptionsComponentContent,
|
||||
getMoreOptionsComponentStyles,
|
||||
getMoreOptionsComponentScript,
|
||||
} from "./moreOptionsComponent";
|
||||
import {
|
||||
getProgressBarContent,
|
||||
getProgressBarStyles,
|
||||
@ -110,6 +115,7 @@ export function getWebviewContent(
|
||||
}
|
||||
${getMessageAreaStyles()}
|
||||
${getAgentCardStyles()}
|
||||
${getMoreOptionsComponentStyles()}
|
||||
${getWaveformPreviewContent()}
|
||||
${getConversationHistoryBarStyles()}
|
||||
${getProgressBarStyles()}
|
||||
@ -921,6 +927,7 @@ export function getWebviewContent(
|
||||
|
||||
${getMessageAreaScript()}
|
||||
${getAgentCardScript()}
|
||||
${getMoreOptionsComponentScript()}
|
||||
${getWaveformPreviewScript()}
|
||||
${getConversationHistoryBarScript()}
|
||||
${getProgressBarScript()}
|
||||
|
||||
Reference in New Issue
Block a user