Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 53 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,53 @@ Topdo 是一个“**常驻、低打扰、键盘优先**”的任务悬浮窗:

---

## 2.0 宠物模式(阶段一)

- 新增两种窗口形态:`面板态` / `猫咪态`
- 默认形态切换快捷键:`⌥T`(可在设置页自定义)
- 猫咪等级随今日完成进度变化:Sleeping / Awake / Happy / Crowned
- 支持角标显示未完成数量、可选动画开关、位置记忆

> 说明:阶段一先上线猫咪态,不含顶部吸附灵动岛能力。

### 猫咪状态切换规则

- 今天完成第 `1` 个任务:`awake`
- 今天完成第 `3` 个任务:`happy`
- 当天全部任务都已完成:`crowned`
- 当天未完成任何任务:`sleeping`
- 判定口径:仅统计 `completed_at` 落在今天、且当前状态仍为“已完成”的任务
- 同一天内小猫保持当天已达成的最高状态,不会因为新增任务或回退任务立刻降级
- 次日首次打开应用后,今日进度会自动重置
- 瞬态动画:
- 新增任务:`new_task`(0.5 秒)
- 首次达到当天全部完成:`celebrate`(2 秒)

### 今日进度激励

- 飞书模式下,完成任务后小猫会立即更新状态,不必等待下一轮同步
- 小猫更偏向“正向反馈”,强调今天完成了多少,而不是总库存完成率
- 对于任务少的用户,完成 1 个任务也能立刻看到从 `sleeping` 到 `awake` 的变化

### 宠物素材规范(阶段一)

- 文件名固定:`sleeping.svg`、`awake.svg`、`happy.svg`、`crowned.svg`
- 资源策略:仅加载 SVG(不再回退 PNG),避免白底素材误渲染
- 推荐规格:透明背景、像素风主体居中
- 若素材缺失或加载失败,应用会自动降级为透明占位渲染,避免出现白色方块

---

## 唤起快捷键冲突处理

如果 `⌘⇧T` 与浏览器或输入法冲突,可在设置页「全局唤起快捷键」中修改。

- 推荐组合:`Cmd+Alt+T`、`Cmd+Shift+Y`
- 规则:必须包含至少一个修饰键(Cmd/Alt/Ctrl/Shift)
- 避免与应用内保留快捷键冲突:`⌘N`、`⌘K`、`⌘1~⌘4`、`⌘⇧R`、`⌘⇧L`

---

## 飞书同步配置

在设置页填写以下字段:
Expand All @@ -108,6 +155,8 @@ Topdo 是一个“**常驻、低打扰、键盘优先**”的任务悬浮窗:
- 应用与目标多维表格在同一租户
- 应用版本已发布可用

如果报错较长,设置页已支持“复制错误详情”,可直接贴给开发者排查。

---

## 开发者指南
Expand All @@ -133,6 +182,9 @@ pnpm install
pnpm tauri dev
```

> macOS 透明窗口依赖 `src-tauri/tauri.conf.json` 中的 `app.macOSPrivateApi: true`。
> 这会启用 macOS private API,因此不适合 App Store 分发。

### 常用命令

```bash
Expand All @@ -153,7 +205,7 @@ pnpm release:mac
产物路径:

- `.app`:`src-tauri/target/universal-apple-darwin/release/bundle/macos/Topdo.app`
- `.dmg`:`src-tauri/target/universal-apple-darwin/release/bundle/dmg/Topdo_1.0.0_universal.dmg`
- `.dmg`:`src-tauri/target/universal-apple-darwin/release/bundle/dmg/Topdo_1.0.1_universal.dmg`

---

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "task-float",
"private": true,
"version": "0.1.0",
"version": "1.0.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -13,6 +13,7 @@
"dependencies": {
"@tauri-apps/api": "^2.0.0",
"@tauri-apps/plugin-autostart": "^2.5.1",
"@tauri-apps/plugin-shell": "^2.0.0",
"pinia": "^2.1.7",
"vue": "^3.4.31"
},
Expand Down
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions scripts/build_universal_dmg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT_DIR"

PRODUCT="Topdo"
VERSION="1.0.0"
VERSION="1.0.1"
APP_NAME="$PRODUCT.app"
NOTICE_FILE="$ROOT_DIR/docs/01_安装说明.txt"

echo "[1/3] 确保 Rust 双目标已安装..."
rustup target add x86_64-apple-darwin >/dev/null

echo "[2/3] 构建 Universal app + dmg..."
pnpm tauri build --target universal-apple-darwin --bundles app,dmg
echo "[2/3] 构建 Universal app..."
pnpm tauri build --target universal-apple-darwin --bundles app

BUNDLE_BASE="$ROOT_DIR/src-tauri/target/universal-apple-darwin/release/bundle"
DMG_DIR="$BUNDLE_BASE/dmg"
Expand All @@ -23,15 +23,12 @@ VOL_ICON="$DMG_DIR/icon.icns"
APP_PATH="$MACOS_DIR/$APP_NAME"
OUTPUT_DMG="$DMG_DIR/${PRODUCT}_${VERSION}_universal.dmg"
TEMP_DMG="$DMG_DIR/${PRODUCT}_${VERSION}_universal_with_notice.dmg"
SRC_FOLDER="$MACOS_DIR"

if [ ! -d "$APP_PATH" ]; then
echo "[错误] 未找到 app: $APP_PATH"
exit 1
fi
if [ ! -f "$OUTPUT_DMG" ]; then
echo "[错误] 未找到 dmg: $OUTPUT_DMG"
exit 1
fi
if [ ! -f "$BUNDLE_DMG_SH" ]; then
echo "[错误] 未找到 bundle_dmg.sh: $BUNDLE_DMG_SH"
exit 1
Expand All @@ -43,6 +40,7 @@ fi

echo "[3/3] 重新打包 DMG(注入安装说明)..."
rm -f "$TEMP_DMG"
rm -f "$OUTPUT_DMG"
"$BUNDLE_DMG_SH" \
--volname "$PRODUCT" \
--icon "$APP_NAME" 180 220 \
Expand All @@ -52,7 +50,7 @@ rm -f "$TEMP_DMG"
--add-file "01_安装说明.txt" "$NOTICE_FILE" 330 320 \
--volicon "$VOL_ICON" \
"$TEMP_DMG" \
"$APP_PATH"
"$SRC_FOLDER"
mv -f "$TEMP_DMG" "$OUTPUT_DMG"

echo "[完成] 发布包已生成"
Expand Down
Loading