Skip to content

Commit 4cf1823

Browse files
bingggclaude
andcommitted
✨ 重大功能增强和代码重构
## 🚀 主要功能改进 ### 1. 📦 模块化重构 - 创建 GistManager 模块:统一管理 Gist 分享和导入 - 创建 ChatRenderer 模块:统一处理消息渲染 - 增强 MarkdownRenderer:改进代码块显示和复制功能 - 减少 app.js 文件长度,提升代码可维护性 ### 2. 🔧 工具卡片优化 - 修复工具卡片 JSON 显示中 HTML 标签混杂问题 - 改用现代事件绑定替代 onclick 属性 - 优化复制功能,支持复杂内容和特殊字符 - 改进展开/折叠交互体验 ### 3. 📝 Markdown 代码块增强 - 添加语言标识显示 - 优化复制按钮样式,与整体设计保持一致 - 修复代码块头部空白问题 - 改进语法高亮和复制反馈 ### 4. 💾 Gist 数据优化 - 实现智能去重:跳过重复消息 - 压缩字段名称:节省 20-40% 存储空间 - 优化工具参数:截断长内容保留重要部分 - 过滤无意义消息:提升内容质量 ### 5. 🔄 继续对话功能修复 - 修复按钮点击无响应问题 - 智能创建输入容器 - 改进状态检查和用户反馈 - 优化不同场景下的交互体验 ## 🎯 技术改进 - HTML 字符安全转义 - 异步复制功能增强 - 防御性编程实践 - 模块间解耦设计 - 性能优化和内存管理 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b64ad4b commit 4cf1823

7 files changed

Lines changed: 1519 additions & 434 deletions

File tree

CLAUDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
1. 首先理解我的需求
2+
2. 规划的时候考虑基于测试驱动开发(TDD)的策略
3+
3. 实现代码,测试,重构,直到满足需求
4+
4. 你将独立完成工作,必要的时候向我求助

assets/css/styles.css

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,8 +1171,9 @@ body {
11711171
.tool-toggle {
11721172
margin-left: auto;
11731173
color: #71717a;
1174-
font-size: 10px;
1174+
font-size: 12px;
11751175
transition: transform 0.2s;
1176+
user-select: none;
11761177
}
11771178

11781179
.tool-call-icon {
@@ -1189,14 +1190,15 @@ body {
11891190
}
11901191

11911192
.tool-call-content {
1192-
padding: 12px;
1193+
padding: 0;
1194+
max-height: 0;
11931195
transition: max-height 0.3s ease, padding 0.3s ease;
11941196
overflow: hidden;
11951197
}
11961198

1197-
.tool-call-content.collapsed {
1198-
max-height: 0;
1199-
padding: 0 12px;
1199+
.tool-call-content:not(.collapsed) {
1200+
padding: 12px;
1201+
max-height: 500px;
12001202
}
12011203

12021204
.tool-call-input {
@@ -1207,12 +1209,39 @@ body {
12071209
font-family: inherit;
12081210
font-size: 11px;
12091211
overflow-x: auto;
1210-
margin-top: 6px;
12111212
border: 1px solid #262626;
12121213
white-space: pre-wrap;
12131214
line-height: 1.4;
12141215
}
12151216

1217+
.tool-input-header {
1218+
margin-bottom: 8px;
1219+
display: flex;
1220+
align-items: center;
1221+
justify-content: space-between;
1222+
}
1223+
1224+
.tool-input-header strong {
1225+
color: #e4e4e7;
1226+
font-size: 11px;
1227+
}
1228+
1229+
.tool-input-header .copy-btn {
1230+
background: #262626;
1231+
border: 1px solid #404040;
1232+
color: #a1a1aa;
1233+
padding: 2px 6px;
1234+
border-radius: 3px;
1235+
font-size: 10px;
1236+
cursor: pointer;
1237+
transition: all 0.2s;
1238+
}
1239+
1240+
.tool-input-header .copy-btn:hover {
1241+
background: #404040;
1242+
color: #ffffff;
1243+
}
1244+
12161245
.timestamp {
12171246
font-size: 10px;
12181247
color: #71717a;

0 commit comments

Comments
 (0)