Skip to content

Commit b76424f

Browse files
author
catlog22
committed
fix(frontend): show empty state placeholders for quality rules and learnings in view mode
- Modify conditional rendering logic to always display section headers in view mode - Add empty state placeholders when quality_rules/learnings arrays are empty - Add localization keys for empty state messages in English and Chinese - Improves UX by making these features visible even when no entries exist Related files: - ccw/frontend/src/pages/ProjectOverviewPage.tsx - ccw/frontend/src/locales/en/project-overview.json - ccw/frontend/src/locales/zh/project-overview.json
1 parent 76967a7 commit b76424f

3 files changed

Lines changed: 561 additions & 114 deletions

File tree

ccw/frontend/src/locales/en/project-overview.json

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,54 @@
4545
"constraints": "Constraints",
4646
"qualityRules": "Quality Rules",
4747
"learnings": "Session Learnings",
48-
"scope": "Scope"
48+
"scope": "Scope",
49+
"noQualityRules": "No quality rules defined yet. Switch to edit mode to add rules.",
50+
"noLearnings": "No learning summaries yet. Switch to edit mode to add learnings.",
51+
"edit": "Edit",
52+
"save": "Save",
53+
"cancel": "Cancel",
54+
"saving": "Saving...",
55+
"saveSuccess": "Guidelines saved successfully",
56+
"saveError": "Failed to save guidelines",
57+
"conventionCategories": {
58+
"codingStyle": "Coding Style",
59+
"namingPatterns": "Naming Patterns",
60+
"fileStructure": "File Structure",
61+
"documentation": "Documentation"
62+
},
63+
"constraintCategories": {
64+
"architecture": "Architecture",
65+
"techStack": "Tech Stack",
66+
"performance": "Performance",
67+
"security": "Security"
68+
},
69+
"qualityRuleFields": {
70+
"rule": "Rule",
71+
"scope": "Scope",
72+
"enforcedBy": "Enforced By",
73+
"addRule": "Add Quality Rule",
74+
"removeRule": "Remove"
75+
},
76+
"learningFields": {
77+
"insight": "Insight",
78+
"category": "Category",
79+
"sessionId": "Session ID",
80+
"context": "Context",
81+
"date": "Date",
82+
"addLearning": "Add Learning",
83+
"removeLearning": "Remove"
84+
},
85+
"placeholders": {
86+
"addItem": "Press Enter to add item",
87+
"rule": "Enter quality rule",
88+
"scope": "Enter scope",
89+
"enforcedBy": "Enter enforcement method",
90+
"insight": "Enter insight",
91+
"category": "Enter category",
92+
"sessionId": "Enter session ID",
93+
"context": "Enter context",
94+
"selectDate": "Select date"
95+
}
4996
},
5097
"stats": {
5198
"title": "Statistics",

ccw/frontend/src/locales/zh/project-overview.json

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,54 @@
4545
"constraints": "约束",
4646
"qualityRules": "质量规则",
4747
"learnings": "学习总结",
48-
"scope": "范围"
48+
"scope": "范围",
49+
"noQualityRules": "暂无质量规则。切换到编辑模式添加规则。",
50+
"noLearnings": "暂无学习总结。切换到编辑模式添加总结。",
51+
"edit": "编辑",
52+
"save": "保存",
53+
"cancel": "取消",
54+
"saving": "正在保存...",
55+
"saveSuccess": "规范已保存成功",
56+
"saveError": "保存规范失败",
57+
"conventionCategories": {
58+
"codingStyle": "编码风格",
59+
"namingPatterns": "命名规范",
60+
"fileStructure": "文件结构",
61+
"documentation": "文档规范"
62+
},
63+
"constraintCategories": {
64+
"architecture": "架构",
65+
"techStack": "技术栈",
66+
"performance": "性能",
67+
"security": "安全性"
68+
},
69+
"qualityRuleFields": {
70+
"rule": "规则",
71+
"scope": "范围",
72+
"enforcedBy": "执行方式",
73+
"addRule": "添加质量规则",
74+
"removeRule": "删除"
75+
},
76+
"learningFields": {
77+
"insight": "见解",
78+
"category": "分类",
79+
"sessionId": "会话ID",
80+
"context": "上下文",
81+
"date": "日期",
82+
"addLearning": "添加学习总结",
83+
"removeLearning": "删除"
84+
},
85+
"placeholders": {
86+
"addItem": "按Enter添加条目",
87+
"rule": "输入质量规则",
88+
"scope": "输入范围",
89+
"enforcedBy": "输入执行方式",
90+
"insight": "输入见解",
91+
"category": "输入分类",
92+
"sessionId": "输入会话ID",
93+
"context": "输入上下文",
94+
"selectDate": "选择日期"
95+
}
4996
},
5097
"stats": {
5198
"title": "统计",

0 commit comments

Comments
 (0)