Files
claude-pet/package.json
T
JianMiauandClaude Fable 5 6da4775867 移除 hover 浮出的選單鈕,版本升到 2.0.0
摘要:
拿掉游標靠近時人物縮小讓位、上方浮出圓形選單鈕的整套 hover 版面,選單只留右鍵與系統匣。

根本原因:
上一版照 Codex 的 petControlsAppearance 做了 proximity 版面,但那顆控制鈕的作用就是開選單,
而本程式的右鍵與系統匣已經有同樣的選單,多一顆按鈕沒有增加任何功能,
反而讓游標經過時人物會縮小位移。

影響:
滑鼠靠近時人物無謂地縮小、下移,並蓋出一顆重複功能的按鈕。

修法:
- renderer:移除 HOVER_SCALE / HOVER_OFFSET_Y / PROXIMITY_ENTER / PROXIMITY_EXIT 常數,
  以及 updateProximity / setNear / overControls / distanceToRect 與 near 狀態、
  applyScale 裡的控制鈕定位、menu-btn 的事件繫結;mousemove 的點穿判定回到人物與氣泡兩者。
- index.html 移除 #controls;style.css 移除 body.near 的縮放位移與 #controls 樣式。
- package.json 版本 0.1.0 → 2.0.0。
- README 的日常使用、行為對照表、與 Codex 的對照三處同步更新,
  對照表標明此項未採用及原因。

保留不變:
右鍵與系統匣選單、idle 放慢 6 倍、狀態優先序與到期、look 列縮放補正、
first-awake 問候、拖曳 4 px 方向閾值、reduced motion。

驗證:
- 三個 js 檔語法檢查通過,全專案 grep 確認 controls / menu-btn / HOVER_ / PROXIMITY_ /
  body.near / setNear 等皆無殘留。
- 實機啟動:/health 正常,events.log 顯示 look rows rescaled 8 cells 仍正常觸發;
  把游標移到人物上截圖,人物維持原尺寸原位置、無按鈕浮出(測後游標已復位)。
- 以 ELECTRON_RUN_AS_NODE 讀打包後 app.asar:版本 2.0.0、html 無 menu-btn、
  css 無 body.near、js 無 proximity 邏輯,且右鍵選單、idle 放慢、look 補正、
  狀態優先序都還在;exe 版本資訊為 2.0.0。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-21 15:18:30 +08:00

88 lines
2.1 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"name": "claude-pet",
"version": "2.0.0",
"description": "Codex Pets 相容的 Claude Code 桌面寵物(spriteVersionNumber 29 個動作列 + 16 方向追視)",
"main": "main.js",
"private": true,
"scripts": {
"start": "electron .",
"hooks:install": "node scripts/install-hooks.js",
"hooks:uninstall": "node scripts/uninstall-hooks.js",
"autostart:install": "node scripts/autostart.js install",
"autostart:uninstall": "node scripts/autostart.js uninstall",
"autostart:status": "node scripts/autostart.js status",
"dist": "electron-builder --win",
"pack": "electron-builder --win --dir",
"dist:portable": "electron-builder --win portable"
},
"devDependencies": {
"electron": "^43.4.1",
"electron-builder": "^26.0.12"
},
"author": "JianMiau",
"build": {
"appId": "com.jianmiau.claude-pet",
"productName": "Claude Pet",
"copyright": "JianMiau",
"directories": {
"output": "dist",
"buildResources": "build"
},
"files": [
"main.js",
"preload.js",
"renderer/**/*",
"lib/**/*",
"hook/**/*",
"package.json"
],
"asarUnpack": [
"hook/**/*"
],
"win": {
"target": [
{
"target": "nsis",
"arch": [
"x64"
]
},
{
"target": "portable",
"arch": [
"x64"
]
},
{
"target": "zip",
"arch": [
"x64"
]
}
],
"icon": "build/icon.ico"
},
"nsis": {
"oneClick": false,
"perMachine": false,
"allowToChangeInstallationDirectory": true,
"createDesktopShortcut": true,
"createStartMenuShortcut": true,
"shortcutName": "Claude Pet",
"deleteAppDataOnUninstall": false,
"artifactName": "${productName}-${version}-setup.${ext}"
},
"portable": {
"artifactName": "${productName}-${version}-portable.${ext}",
"unpackDirName": "ClaudePet",
"requestExecutionLevel": "user"
},
"extraFiles": [
{
"from": "pets",
"to": "pets"
}
]
}
}