Skip to content

Commit 3349bdf

Browse files
committed
feat: Enhance Worker Script Upload and Editor UI
- Refactor uploadWorkerScriptWithBindings to improve script handling and preserve original bindings. - Implement conversion of Service Worker format to ES Module format. - Add new drawable resources for various icons (arrow back, down, up, close, cloud upload, content copy, history, save, search, select all, undo). - Create a new layout for the script editor with a toolbar and action buttons. - Update navigation graph to include a new fragment for the script editor. - Introduce a new XML resource for file paths to handle external file access. - Modify themes.xml to define a custom text appearance for toolbar titles. - Adjust main activity layout for improved UI elements and interactions. - Clean up fragment_home layout by removing commented-out code. - Enhance card_dashboard layout to be clickable and focusable.
1 parent ea629ba commit 3349bdf

39 files changed

Lines changed: 2631 additions & 414 deletions

RELEASE_NOTES_v6.8.md

Lines changed: 0 additions & 123 deletions
This file was deleted.

RELEASE_NOTES_v6.9.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
## 🎯 核心更新
2+
3+
### 📝 脚本编辑器重大改进
4+
5+
#### 🔍 全新搜索功能
6+
- **Material Design 3 搜索界面**:替换原有的 CodeMirror 内置对话框,采用现代化卡片式设计
7+
- **实时搜索**:输入时自动搜索并高亮所有匹配项
8+
- **智能高亮**
9+
- 所有匹配项:黄色背景 + 黄色底边框
10+
- 当前选中项:橙色背景 + 橙色底边框
11+
- **便捷导航**
12+
- 上一个/下一个按钮快速跳转匹配项
13+
- 自动滚动并居中显示当前匹配
14+
- 清除按钮一键清空搜索
15+
- **优化体验**:浮动搜索栏设计,不遮挡编辑内容
16+
17+
#### 🔄 版本控制优化
18+
- **撤销功能**:新增撤销按钮,可一键恢复到最后一次手动保存或从 Cloudflare 同步的版本
19+
- **移除自动保存**:简化编辑流程,采用完全手动保存模式,避免版本历史混乱
20+
- **返回确认**:编辑器中使用返回键或手势导航时,如有未保存更改会弹出确认对话框
21+
22+
#### 🎨 UI/UX 改进
23+
- **图标化工具栏**:撤销、全选、历史按钮改为 Material Design 3 纯图标设计
24+
- **优化间距**:减少工具栏按钮间距,界面更紧凑美观
25+
- **无障碍支持**:所有图标按钮添加 contentDescription
26+
27+
## 🛠️ 技术细节
28+
29+
### 新增资源
30+
- `ic_undo.xml` - 撤销图标
31+
- `ic_select_all.xml` - 全选图标
32+
- `ic_arrow_up.xml` - 向上导航图标
33+
- `ic_arrow_down.xml` - 向下导航图标
34+
- `ic_close.xml` - 关闭图标
35+
36+
### 代码优化
37+
- 自定义搜索算法:基于 CodeMirror SearchCursor API
38+
- 搜索高亮标记:使用 markText API 实现多色高亮
39+
- 返回键拦截:OnBackPressedCallback 处理系统导航
40+
- 生命周期管理:使用 viewLifecycleOwner 防止内存泄漏
41+
42+
## 📦 完整功能列表
43+
44+
### 编辑器功能
45+
- ✅ CodeMirror 5.65.16 语法高亮
46+
- ✅ JSHint 2.13.6 实时语法检查
47+
- ✅ 无限版本历史记录
48+
- ✅ Material Design 3 搜索界面
49+
- ✅ 一键撤销到上次保存
50+
- ✅ 全屏编辑体验
51+
- ✅ 代码折叠
52+
- ✅ 括号匹配
53+
- ✅ 自动补全括号
54+
- ✅ 当前行高亮
55+
56+
### 搜索功能
57+
- ✅ 实时搜索
58+
- ✅ 多匹配项高亮
59+
- ✅ 快速导航(上一个/下一个)
60+
- ✅ 自动滚动居中
61+
- ✅ 特殊字符转义
62+
- ✅ 清除高亮
63+
64+
### 版本管理
65+
- ✅ 手动保存版本
66+
- ✅ Cloudflare 同步版本
67+
- ✅ 版本历史浏览
68+
- ✅ 版本恢复
69+
- ✅ 版本删除
70+
- ✅ 撤销到上次保存
71+

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ android {
3030
applicationId = "com.muort.upworker"
3131
minSdk = 26
3232
targetSdk = 36
33-
versionCode = 2026010301
34-
versionName = "6.8"
33+
versionCode = 2026010308
34+
versionName = "6.9"
3535

3636
vectorDrawables {
3737
useSupportLibrary = true

0 commit comments

Comments
 (0)