已开启
fix(views): correct sender style attribute and add Copilot types #473
fix(views): correct sender style attribute and add Copilot types #473
已开启
wenhao-zhao创建于 27 天前
wenhao-zhao
wenhao-zhao
27 天前

当前PR是否有AI参与:

[x] 否

[ ] 是
__1. AI Agent 平台:
__2. AI 模型:
__3. Prompt上下文 :

参考:openEuler社区《生成式AI工具使用与开源贡献政策》

PR功能描述 / 为什么需要这个合入**:

   1. 修复 src/views/chat/Sender.vue 中 <style> 标签属性错误,将 style="scss" 修正为 lang="scss" ,使 SCSS 预处理器能正确解析作用域样式
   2. 修复 src/views/dialogue/Copilot.vue 中使用了未引入的 marked 工具函数
   3. 修复 src/views/dialogue/Copilot.vue  为createAppForm赋值操作部分未通过IDE 与 TypeScript检查

该PR关联的issue

(格式为fixes #<issue号>, 或者resolves #<issue号>): fixes #

希望检视人员了解:

likedislike
合并受阻
wenhao-zhaowenhao-zhao
27 天前 创建了 pull request,commit 20f65565
atomgit-bot
atomgit-bot
27 天前 评论:

变更摘要

本 PR 主要修复聊天与对话视图中的几处问题:在 src/views/chat/Sender.vue 中修正 <style> 标签的属性写法,将错误的 style="scss" 改为 lang="scss",使 SCSS 预处理器能正确解析作用域样式;在 src/views/dialogue/Copilot.vue 中补充引入此前被使用但未导入的 marked 工具函数,并为 createAppForm 赋值操作新增 CreateAppForm 类型声明与 Visibility 导入,使其通过 IDE 与 TypeScript 检查。

主要改动

  • 修复样式标签属性: 在 src/views/chat/Sender.vue 中将 <style style="scss" scoped> 修正为 <style lang="scss" scoped>,确保 SCSS 样式能被正确解析。
  • 补充 marked 工具函数导入: 在 src/views/dialogue/Copilot.vue 中新增 import marked from 'src/utils/marked',修复使用未引入的 marked 函数的问题。
  • 新增 CreateAppForm 类型声明: 在 src/views/dialogue/Copilot.vue 中定义 CreateAppForm 接口(包含 iconnamedescriptiondialogRoundspermissionlinksrecommendedQuestions 等字段),并将 createAppFormref 声明为 ref<CreateAppForm>,同时引入 Visibility 类型用于 permission.visibility 字段。
likedislike
不准确?
atomgit-bot
atomgit-bot
27 天前 评论:

代码审查

审查总结

已审查文件确认

  • src/views/chat/Sender.vue — 已审查。<style style="scss" scoped><style lang="scss" scoped> 是正确修复,无问题。
  • src/views/dialogue/Copilot.vue — 已审查。发现 1 个真实问题(见下)。

发现统计

  • P0:1 个
    • src/views/dialogue/Copilot.vue:14import { Visibility } from 'srcapis/appCenter/type.js'; 路径笔误(应为 src/apis/appCenter/type.js),该路径不存在,导致模块解析失败、TypeScript 类型检查与 Vite 构建报错,直接破坏构建。
  • P1/P2/P3:0 个

(说明:审查过程中同一问题被记录了两次记录,实为同一根因的单个问题。)

整体风险评估

本次 PR 的两个意图(Sender.vue 的 style 属性修复、Copilot.vue 引入缺失的 marked 与类型标注)方向正确,但 Copilot.vue 新增的 Visibility 导入路径存在确定性笔误(srcapissrc/apis),会直接导致构建/类型检查失败,属于阻断合入的 P0 问题,必须先修正后再合入。

类型 数量
🔴 阻塞 2
🟡 建议 0

⛔ 需要修改

likedislike
不准确?
openeuler-ci-botopeneuler-ci-bot成员
27 天前 将lyhu,huzhengce,liumiao27,fromhsc,gogoxiaoxiao,wqianli,leon-wang2021,kaitiandu设为审查人
openeuler-ci-botopeneuler-ci-bot成员
27 天前 添加了label:sig/sig-intelligence
openeuler-ci-bot
openeuler-ci-bot成员
27 天前 评论:

Welcome To openEuler Community

Hey @wenhao-zhao , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.

Contact Guide

If you have any questions, please contact the SIG: sig-intelligence ,
and any of the maintainers: @fromhsc, @gogoxiaoxiao, @huzhengce, @kaitiandu, @leon-wang2021, @liumiao27, @lyhu, @wqianli ,
and any of the committers: @Shine_Ws, @hongyu-shi, @liu-feng-D, @lostway1, @xiaocy1997, @zhouweitong3, @zxstty .

likedislike
openeuler-ci-botopeneuler-ci-bot成员
27 天前 添加了label:openeuler-cla/yes
atomgit-bot
atomgit-bot27 天前进行代码检视3
src/views/dialogue/Copilot.vue
已过期
@@ -10,3 +11,4 @@
1011 
1112import { api } from 'src/apis';
1213 
14+import { Visibility } from 'srcapis/appCenter/type.js';
atomgit-bot
atomgit-bot27 天前评论:

🔴 Critical

变更行: Copilot.vue 第 14 行新增 import { Visibility } from 'srcapis/appCenter/type.js';,但 srcapis/appCenter/type.js 不是一个可解析的模块路径。

证据链:

  • 该项目采用 .js 后缀指向 .ts 文件的导入约定(如 DialoguePanel.vue 中 import marked from 'src/utils/marked.js' 实际解析到 marked.ts),因此正确写法应为 src/apis/appCenter/type.js

失败模式: 该 import 会触发模块解析失败,vue-tsc/CI 类型检查报 "Cannot find module 'srcapis/appCenter/type.js'",Vite 构建同样无法解析该依赖,导致本次 PR 声称要修复的 TS 检查目标反而无法通过、页面/构建中断。

建议:把导入路径修正为 src/apis/appCenter/type.js(该文件确实导出 Visibility 枚举)。若项目开启 verbatimModuleSyntax,可同步改为 import type { Visibility } from 'src/apis/appCenter/type.js';

改动建议
14
- import { Visibility } from 'srcapis/appCenter/type.js';
14
+ import { Visibility } from 'src/apis/appCenter/type.js';
应用建议
likedislike
不准确?
System
系统消息系统
25 天前 评论:

changed this line on a5a5dbc3 view diff detail

wenhao-zhao
wenhao-zhao
24 天前 评论:

done

atomgit-bot
atomgit-bot27 天前进行代码检视3
src/views/dialogue/Copilot.vue
已过期
@@ -10,3 +11,4 @@
1011 
1112import { api } from 'src/apis';
1213 
14+import { Visibility } from 'srcapis/appCenter/type.js';
atomgit-bot
atomgit-bot27 天前评论:

🔴 Critical

变更行: Copilot.vue 第 14 行新增 import { Visibility } from 'srcapis/appCenter/type.js';

证据链:

  • 全仓库 grep srcapis 仅命中此一处,src/ 目录下不存在 srcapis 目录(实际目录为 src/apis/)。
  • srcapis 显然是 src/apis 漏写斜杠的笔误,.js 后缀指向 .ts 文件是项目既有约定(如 src/utils/marked.jsmarked.ts)。

失败模式: 该 import 无法被模块解析器/TypeScript 找到(Cannot find module 'srcapis/appCenter/type.js'),会导致 vue-tsc 类型检查失败、Vite 构建时 "Failed to resolve import" 报错,直接破坏构建,与本 PR "使 createAppForm 赋值通过 TypeScript 检查" 的目标相悖。

建议:将导入路径从 srcapis/appCenter/type.js 改为 src/apis/appCenter/type.js(该文件确实导出了 Visibility 枚举),最好同时改为 import type { Visibility } from 'src/apis/appCenter/type.js'; 以符合仅作类型使用的语义。

改动建议
14
- import { Visibility } from 'srcapis/appCenter/type.js';
14
+ import type { Visibility } from 'src/apis/appCenter/type.js';
应用建议
likedislike
不准确?
System
系统消息系统
25 天前 评论:

changed this line on a5a5dbc3 view diff detail

wenhao-zhao
wenhao-zhao
24 天前 评论:

done

wenhao-zhaowenhao-zhao
25 天前 预合并成功(commit_id: 2dd12d9a0b8e76cf73449e9bf46e006fc7c321cb)
wenhao-zhaowenhao-zhao
25 天前 强制推送  1 个提交:a5a5dbc3-fix(views): correct sender style attribute and add Copilot types
wenhao-zhaowenhao-zhao
25 天前 预合并成功(commit_id: 2a16ca45b0d6068bf3f07c1480a337fe145d878c)
openeuler-ci-botopeneuler-ci-bot成员
25 天前 删除了label:openeuler-cla/yes
openeuler-ci-botopeneuler-ci-bot成员
25 天前 添加了label:openeuler-cla/yes
openeuler-ci-bot
openeuler-ci-bot成员
25 天前 评论:

CLA Signature Pass

wenhao-zhao, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike