chore(config): 配置 Kiro AI 助手并规范化 Git 提交消息

- 新增 .kiro/settings/kiro.json 配置文件,设置 AI 助手语言为中文
- 新增 .kiro/steering/chinese-commit-messages.md 文档,规范化项目 Git 提交消息格式
- 更新 .vscode/settings.json,添加 Kiro AI 助手和 Git 相关配置
- 优化 QuestionConfigCard.vue 中时间选项的排序逻辑
- 重新启用 cover/index.vue 中的 watch 监听器并优化代码格式
- 优化 teams/index.vue 的代码结构和可读性
This commit is contained in:
2026-03-19 09:35:34 +08:00
parent 9a80fd9fa1
commit d1f6044a6c
6 changed files with 143 additions and 23 deletions

7
.kiro/settings/kiro.json Normal file
View File

@ -0,0 +1,7 @@
{
"kiro.ai.language": "zh-CN",
"kiro.ai.commitMessage.language": "chinese",
"kiro.git.commitMessageLanguage": "zh-CN",
"kiro.assistant.locale": "zh-CN",
"kiro.assistant.language": "chinese"
}

View File

@ -0,0 +1,100 @@
---
inclusion: auto
---
# Git 提交消息规范
本项目严格遵循 [Conventional Commits](https://www.conventionalcommits.org/) 规范。
## 提交消息格式
```
<type>(<scope>): <subject>
<body>
<footer>
```
### 必需部分
#### Type (类型)
提交的类型必须是以下之一:
- **feat**: 新功能 (feature)
- **fix**: 修复 bug
- **docs**: 仅文档更改
- **style**: 不影响代码含义的更改(空格、格式化、缺少分号等)
- **refactor**: 既不修复 bug 也不添加功能的代码更改
- **perf**: 提高性能的代码更改
- **test**: 添加缺失的测试或更正现有测试
- **build**: 影响构建系统或外部依赖的更改示例范围webpack, npm, vite
- **ci**: 对 CI 配置文件和脚本的更改示例范围GitHub Actions, GitLab CI
- **chore**: 其他不修改 src 或测试文件的更改
- **revert**: 回退之前的提交
#### Subject (主题)
- 使用简洁的语言描述本次提交的更改
- 不超过 50 个字符
- 首字母小写
- 结尾不加句号
### 可选部分
#### Scope (范围)
用于说明提交影响的范围,例如:
- **component**: 组件相关
- **api**: API 相关
- **router**: 路由相关
- **store**: 状态管理相关
- **utils**: 工具函数相关
- **styles**: 样式相关
- **deps**: 依赖项相关
#### Body (正文)
- 详细描述本次提交的动机和更改内容
- 可以分多行
- 应该说明"是什么"和"为什么",而不是"怎么做"
#### Footer (页脚)
- 用于关闭 Issue 或描述破坏性变更
- Breaking Changes 必须在页脚中以 `BREAKING CHANGE:` 开头
- 关闭 Issue 使用 `Closes #issue号`
## 示例
### 简单的功能添加
```
feat(article): 添加文章搜索功能
```
### 修复 bug
```
fix(login): 修复登录状态未持久化的问题
```
### 包含详细描述
```
feat(editor): 支持 markdown 实时预览
添加了一个新的编辑器组件,支持 markdown 的实时预览功能。
用户在编辑时可以同时看到渲染后的效果,提升编辑体验。
Closes #123
```
### 破坏性变更
```
feat(api): 重构用户认证 api
BREAKING CHANGE: 用户认证接口从 /api/auth 迁移到 /api/v2/auth
旧接口将在下一个版本中移除。客户端需要更新 API 端点。
```
## 重要规则
1. **严格遵循格式**: `<type>(<scope>): <subject>`
2. **type 必须小写**: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
3. **subject 首字母小写**: 不要大写开头
4. **subject 不加句号**: 结尾不要加标点符号
5. **不超过 50 字符**: subject 部分要简洁
6. **破坏性变更**: 必须在 body 中以 `BREAKING CHANGE:` 开头说明

14
.vscode/settings.json vendored
View File

@ -42,5 +42,17 @@
"Echarts",
"Typeit"
],
"kiroAgent.configureMCP": "Disabled" // `
// Kiro AI 助手配置
"kiroAgent.configureMCP": "Disabled",
"kiro.ai.language": "zh-CN",
"kiro.ai.commitMessage.language": "chinese",
"kiro.git.commitMessageLanguage": "zh-CN",
"kiro.assistant.locale": "zh-CN",
// Git 配置
"git.inputValidationLength": 72,
// GitHub Copilot 语言设置(如果安装了)
"github.copilot.chat.localeOverride": "zh-CN"
}

View File

@ -41,8 +41,10 @@ const modelValue = ref<{
const { options: roundTypeOptions } = useDict('round_type')
const { options: scoreTypeOptions } = useDict('score_type')
const { options: timeOptions } = useDict('time_out')
// const { options: uiTypeOptions } = useDict('ui_type', 'string')
const { options: timeOptionsRaw } = useDict('time_out')
const timeOptions = computed(() =>
[...timeOptionsRaw.value].sort((a, b) => Number(a.value) - Number(b.value)),
)
const { options: uiTypeOptions } = useDict('question_category_name', 'string')
const hookProps = reactive({

View File

@ -1,5 +1,5 @@
<script setup lang="ts">
import { computed, onMounted, ref } from 'vue'
import { computed, onMounted, ref, watch } from 'vue'
import { useRoute } from 'vue-router'
import CompetitionLayout from '@/components/custom/user/CompetitionLayout.vue'
import { PublishStatus } from '@/enum/business'
@ -30,12 +30,12 @@ const activityName = computed(() => activityInfo.value?.ActivityTitle || '星·
const flippedCards = ref<Set<number>>(new Set())
// 计算是否所有卡片都已翻转 (当前显示4张卡片)
// eslint-disable-next-line unused-imports/no-unused-vars
const isAllFlipped = computed(() => flippedCards.value.size === questions.value.length)
// 控制下一步按钮的显示(带延迟)
const showNextButton = ref(true)
// eslint-disable-next-line prefer-const, unused-imports/no-unused-vars
let timer: ReturnType<typeof setTimeout> | null = null
// 获取路由参数
@ -77,21 +77,21 @@ async function getQuestions() {
}
}
// 测试先注释掉
// watch(isAllFlipped, (val) => {
// if (timer) {
// clearTimeout(timer)
// timer = null
// }
watch(isAllFlipped, (val) => {
if (timer) {
clearTimeout(timer)
timer = null
}
// if (val) {
// timer = setTimeout(() => {
// showNextButton.value = true
// }, 1500)
// }
// else {
// showNextButton.value = false
// }
// })
if (val) {
timer = setTimeout(() => {
showNextButton.value = true
}, 1500)
}
else {
showNextButton.value = false
}
})
function handleBack() {
routerBack()
@ -196,8 +196,7 @@ onMounted(async () => {
<template>
<CompetitionLayout
:show-back="true" :show-next="showNextButton" next-btn-text="下一步" :title="activityName"
:title-bg-type="2" back-btn-text="返回" @back="handleBack"
@next="handleNext"
:title-bg-type="2" back-btn-text="返回" @back="handleBack" @next="handleNext"
>
<div class="h-screen w-full overflow-y-auto font-sans">
<div class="relative z-10 min-h-full w-full">

View File

@ -87,7 +87,7 @@ onMounted(() => {
</script>
<template>
<CompetitionLayout :show-back="true" back-btn-text="返回" :show-next="true" next-btn-text="下一步" :show-title="false" @next="handleNext" @back="handleBack">
<CompetitionLayout :show-back="true" back-btn-text="返回" :show-next="false" next-btn-text="下一步" :show-title="false" @next="handleNext" @back="handleBack">
<!-- Scroll Content -->
<div class="scroll-container">
<!-- 卷轴背景动画容器 -->