What's Changed
🐛 Bug Fixes
- #28 UI freeze with high-output scripts — Running scripts that emit heavy log streams (npm run dev + Spring Boot dual-streaming) no longer pegs the main thread and freezes the UI. Replaced the per-chunk O(N) string concatenation in
LiveOutputManagerwith an O(1) line buffer; pipe I/O is now coalesced at 50ms before crossing to the main thread; the log viewer renders viaNSTextView(TextKit fragmented layout) instead of SwiftUIText, which choked on the 512KB ceiling. Sample shows main-thread time in the live-output pipeline went from 97% → 0%. - "0秒后" stuck in task rows — Task list, Quick Launcher, and log rows no longer freeze on "0秒后" / "in 0 seconds" after a task completes. The relative-time formatter quantizes
|diff| < 1sto "0秒后" in zh-Hans, and SwiftUI didn't auto-refresh the row. AddedTimelineViewand a "just now" / "刚刚" short-circuit; rows now tick every minute. - Log truncation now keeps the suffix instead of prefix — When stdout/stderr exceeds 512KB, the last 256KB is kept (with the stack trace and exit reason) rather than the first 256KB. For build/start scripts this is the part you actually need.
✨ New Features
tasktick createCLI command — Create tasks from a script file via the command line:Supportstasktick create "stress test" --script /path/to/script.sh --manual tasktick create "daily backup" --script ~/scripts/backup.sh --repeat daily --at 08:00
--shell,--cwd,--timeout,--manual,--repeat,--at,--no-enable,--json. The GUI owns the SwiftData write — CLI generates the UUID and posts acli.createnotification, then polls the read-only store to confirm.
🔧 Internal
- New
IOBatcher(per-task pipe coalescer) andLogTextView(NSTextView wrapper for virtualized rendering). - 12 new unit tests covering
LineBufferedge cases (CR / CRLF, amortized trim, pending overflow). All 23 tests pass.
更新内容
🐛 Bug 修复
- #28 大量日志输出会卡死 UI — 跑日志输出量大的脚本(比如 npm run dev + Spring Boot 同时输出)不再把主线程占满、界面卡死。重写了
LiveOutputManager:用 O(1) 行缓冲替代之前每个 chunk 都做 O(N) 字符串拼接和截断;I/O 在 50ms 窗口内合批后再切到主线程;日志查看器从 SwiftUIText(500KB 字符串撑不住)换成了NSTextView(TextKit 分片布局)。采样显示主线程在 live output 链路上的占用 从 97% 降到 0%。 - 任务列表卡在"0秒后" — 任务列表、Quick Launcher、日志行不再卡死在 "0秒后" 上。系统的相对时间格式化器在中文 short 风格下,会把
|diff| < 1秒量化成 "0秒后",而 SwiftUI 任务完成后不会自动重画那一行。加了TimelineView+ "刚刚" 短路逻辑,每分钟自动 tick 一次。 - 日志截断改为保留末尾而不是开头 — stdout/stderr 超过 512KB 时保留最后 256KB(错误堆栈和退出原因都在那),而不是开头那 256KB。对于编译/启动脚本来说,结尾才是你真正需要的部分。
✨ 新功能
tasktick createCLI 命令 — 从命令行直接创建任务:支持tasktick create "stress test" --script /path/to/script.sh --manual tasktick create "daily backup" --script ~/scripts/backup.sh --repeat daily --at 08:00
--shell、--cwd、--timeout、--manual、--repeat、--at、--no-enable、--json。CLI 只生成 UUID 并发送cli.create通知,由 GUI 负责实际写入 SwiftData,避免多进程写库竞争。
🔧 内部改进
- 新增
IOBatcher(每任务一个的管道合批器)和LogTextView(NSTextView wrapper,虚拟化渲染)。 - 12 个新单测覆盖
LineBuffer边界情况(CR / CRLF、amortized trim、pending 溢出等),全部 23 个测试通过。
Full Changelog: v1.8.2...v1.8.3