feat: 目標/計畫/一律放行改成臉那一行右邊的圖示,不再各佔一行
輸入框上方原本每個模式一條列,最多三行,擋住對話高度。 - 電腦:三個圖示排在臉那一行右邊(新對話沒有臉時自己一小行);滑過去看 原本那一行字和說明,點一下打開同樣的說明和「清除目標/取消計畫/關閉一律放行」; 照計畫做時圖示旁邊寫「2/5」。 - 手機:目標和計畫是輸入框上方一排小圖示,點一下展開那一行和取消按鈕。 - 功能地圖(plan、goal、safety)和 FEATURES.md 一起改;排版檢查的場景補成三個圖示同時出現。 - 獨立審查沒有 P0/P1;修了它提的 6 個 P2(圖示用固定 id、手機換聊天時收起、 兩個翻譯、目標的 30 秒重畫、過時註解、手機點擊範圍 44 px)。 已驗證: cargo test 全綠(613,含 featuremap::、layout_audit::);截圖模式(示範資料、深色、760x560) 看過計畫模式、照計畫做、滑過去的說明、點一下的選單;mobile/index.html 的 script 解析得過。 未驗證: 手機網頁沒有在手機或瀏覽器上實際操作;目標和一律放行的圖示沒有截圖(只有排版檢查); 功能地圖「驗證:」那幾行要真的模型跑 /plan、/goal,這次沒跑;大腦的螢幕(mirror)沒試。 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
parent
09d782bc32
commit
6a5fd2d53e
10
FEATURES.md
10
FEATURES.md
|
|
@ -1603,7 +1603,7 @@ computer_use_screenshot、click、mouse_move、mouse_button(按住/放開)
|
|||
- **用法**:「/goal 所有測試都通過,而且 clippy 沒有新的警告」設定並馬上開始做(已經有目標就換掉);「/goal」看目前的目標、做了多久、檢查了幾輪、最近一次檢查的理由;「/goal clear」清除(stop、off、reset、none、cancel、清除、取消、停止也可以)。在 / 清單最上面,標「指令和技能」。電腦、大腦的螢幕、手機打的都算,由大腦處理;訊息管道(Slack、Telegram…)和團隊成員打的不算指令,別人不能替你設目標。條件最多 4000 字;群組聊天還不能設目標。「清除聊天記錄」和「開始新對話」會連目標一起清掉;分享 Bot 的檔案不含目標。
|
||||
- **檢查的結果**:還沒達成 → AnyBot 自己送出一則標「目標」的「還沒達成:(理由)」開始下一輪,理由就是下一步該做什麼;達成 → 聊天裡一行「目標達成:…(N 輪 · 多久)」,目標清掉,這個聊天上撒一下彩帶(慶祝動畫,設定 › 一般可關);做不到 → 「目標做不到,已清除:…」;Bot 在等你回答或動手(登入、付款、做決定)→「目標暫停,等你回覆:…」,不會一直空轉。
|
||||
- **煞車**(比 Claude Code 嚴,因為 AnyBot 一輪可以做很多步、用的是你自己的金鑰):一個目標做 20 輪還沒達成就暫停問你;連續 3 輪都沒有用任何工具(只是在說話)就暫停;連續兩輪檢查說差的是同一件事(用字稍有不同也算)就暫停「同樣的問題連續兩次」,再做一輪多半還是卡在那裡(參考 grok-build);這一輪出錯、你按了停止(兩輪之間正在檢查時按也算)、檢查的模型沒回應、AnyBot 重新啟動過,也都是暫停。重新啟動後按中斷卡片上的「繼續」,目標也跟著接下去。暫停時目標還在,**傳一句話(例如「繼續」)就接著做**,用完 20 輪的再給 20 輪;不要了就 /goal clear。
|
||||
- **看得到的地方**:輸入框上方一行「目標進行中 · 12 分 · 3 輪」(檢查時是「正在檢查有沒有達成…」,暫停時是「目標暫停 · 原因」),滑過去看條件和最近一次的理由,右邊「清除目標」;窄視窗時字會縮成「…」,不會擠掉按鈕。AnyBot 自己的那幾行(達成、暫停、狀態)在聊天中間用小字顯示,不是 Bot 的話,**不會送給模型**,也不算檢查的證據。手機一樣,大腦的螢幕看到的是大腦同步過來的。
|
||||
- **看得到的地方**:輸入框上方那張臉的同一行右邊一個目標圖示(不另外佔一行,免得擋住對話;暫停時變灰),滑過去看「目標進行中 · 12 分 · 3 輪」(檢查時是「正在檢查有沒有達成…」,暫停時是「目標暫停 · 原因」)、條件和最近一次的理由,點一下打開同樣的說明和「清除目標」。目標、計畫、一律放行同時開著時三個圖示排成一排。AnyBot 自己的那幾行(達成、暫停、狀態)在聊天中間用小字顯示,不是 Bot 的話,**不會送給模型**,也不算檢查的證據。手機一樣,大腦的螢幕看到的是大腦同步過來的。
|
||||
- **通知**:目標進行中的每一輪不再各通知一次「完成了」;達成、做不到、暫停時才通知(你不在電腦前時,手機也會收到),例如「Master 達成目標了」「Master 在等你回覆」。
|
||||
- **模型讀到的**:你的「/goal …」後面多一行,說明這是目標、每輪會有另一個模型檢查,所以要用實際的結果證明(指令輸出、測試結果、檔案內容、畫面),需要你做什麼就直接問;「還沒達成」那則後面也提醒它接著做。檢查用的模型讀的是從設定目標那則訊息起的對話(太長就讀最新的約 24000 字;每個工具結果留開頭和結尾,測試的總結通常在最後),並知道已經第幾輪、做了多久,所以條件裡寫「最多 10 輪」也算數。對話裡的證據不夠時,檢查的模型可以自己查證,最多 3 次、只能看:在 Bot 做事的那台電腦上讀檔(read_file)、看資料夾(list_dir),或讀公開網頁(web_fetch);讀檔只限 Bot 不用問就能讀的(工作資料夾裡、不是私密檔案),其他的回「這個不能看」;要求用其他工具(執行指令、寫檔…)會被拒絕,不會真的做。它被要求每一輪用同一個標準:只看目標本身寫的條件,不因為 Bot 做得比上一輪多就提高要求,也不加目標沒寫的條件。
|
||||
- **權限不變**:要你核准的步驟照樣停下來等;要放著讓它自己做完,Bot 要開「直接操作」或「自動審核」(Claude Code 也要配 auto mode)。
|
||||
|
|
@ -1614,16 +1614,16 @@ computer_use_screenshot、click、mouse_move、mouse_button(按住/放開)
|
|||
- **打開時做的事**:打開「直接操作」(也就是「在這台電腦上執行」、所有 Bot 的電腦工具),之後所有要等「允許」的卡片都替你按允許,連直接操作還會問的也不問:「一律詢問」規則、付款/傳送/刪除這類點擊、寄信、傳訊息、沙盒外的 AppleScript、打電話、簡訊、在 X 發文、用保險庫的卡片;自動審核也略過(反正都會允許,不用再等一個模型判斷)。打開那一刻你自己的 Bot 正在等的卡片也一起放行。
|
||||
- **還是會擋的**:安全規則一律拒絕的(sudo、rm -rf /、格式化、金鑰和密碼檔、AnyBot 自己的資料、雲端中繼資料位址)——那是拒絕,不是詢問;別人傳來的訊息(訊息管道、團隊成員)那一輪照樣等你親手按;問題卡、「需要處理」和 /plan 的計畫卡要的是你的回答或你的手,照樣等你。
|
||||
- **只有你能開**:聊天裡你自己打(電腦、大腦的螢幕、手機用擁有者身分),或 設定 › 權限 ›「一律放行」。Bot、例行任務、訊息管道都打不開;團隊管理員和成員打的會變成「【名字】/always-approve」交給 Bot,不是指令。管理員(MDM)鎖了直接操作或「在這台電腦上執行」就打不開。
|
||||
- **看得到它開著**:每個聊天的輸入框上方一條「一律放行 · Bot 做事不再問你」,右邊「關閉」。重開 AnyBot 還開著。
|
||||
- **關掉**:「/always-approve off」(或條上的「關閉」、設定的開關):要核准的又會問;直接操作如果是它順手打開的就一起關,本來就開著的留著。「/always-approve status」看現在怎樣。
|
||||
- **看得到它開著**:每個聊天的輸入框上方、臉的同一行右邊一個紅色閃電圖示(新對話沒有臉時自己一小行),滑過去看「一律放行 · Bot 做事不再問你」和還會擋什麼,點一下有「關閉一律放行」。重開 AnyBot 還開著。
|
||||
- **關掉**:「/always-approve off」(或點圖示的「關閉一律放行」、設定的開關):要核准的又會問;直接操作如果是它順手打開的就一起關,本來就開著的留著。「/always-approve status」看現在怎樣。
|
||||
- **/plan 計畫**(照 Claude Code 的 plan mode、Cursor 的 Plan Mode、Codex 的 update_plan 做):先規劃、你核准後才動手。適合會動到很多東西、做錯很麻煩的事(搬家、改設定、一連串對外送出)。
|
||||
- **用法**:「/plan 要做的事」開始(Bot 正在做事時不行,先等它做完或按停止);「/plan」看計畫和進度;「/plan clear」取消(stop、取消…也可以)。電腦、大腦的螢幕、手機打的都算,由大腦處理;團隊的管理員也能用,成員和訊息管道打的不算指令。群組聊天還不能用;最多 4000 字。
|
||||
- **計畫模式(還沒核准)**:Bot 只能看——讀檔、列資料夾、搜尋、讀網頁(web_fetch、瀏覽器打開/讀取/捲動)、截圖、查記憶和技能、查功能地圖。執行指令、改檔案、點擊、打字、送出、改設定在執行那一層就被擋下,回給 Bot「計畫還沒核准」(不是只靠提示詞,跟 Claude Code、Codex、Gemini CLI 一樣)。它先自己查清楚現況,查得到的不問;有你才能決定的取捨,用問題卡一次問完(最多 3 題、建議的放第一個),你略過就用建議的並寫成假設。
|
||||
- **計畫卡**:Bot 用 submit_plan 交出計畫,聊天裡是一張「計畫」卡:一兩句摘要、照順序的步驟(通常 3 到 7 步,每步是一個看得到的結果,最後一步是驗證)、「怎麼確認做對了」、「注意」(假設、風險、花錢、對外送出、不能復原的)。只寫它建議的那一個做法。研究顯示錯的計畫比沒有計畫更糟,所以要求它根據查到的事實、寧可短而對。
|
||||
- **核准**:輸入框上方的問題卡「照這個計畫做嗎?」:「開始照計畫做」、「先不要」,或直接打字寫要改哪裡(它改完再交一張新卡,舊卡變「已修改,見下面新版」)。在卡片外傳訊息也算要修改;只有按「開始照計畫做」才算核准,不會等太久自己核准。按「先不要」或略過,計畫就取消,什麼都沒做。
|
||||
- **照計畫做**:核准後同一輪接著做(不用再傳訊息),所有工具打開,第 1 步自動標成進行中;它每做完一步用 update_plan 更新一次(整份清單、同時只有一步進行中;不用每個小動作都更新——Manus 發現打勾佔了三分之一的動作)。計畫和實際不符就改清單並在訊息裡說為什麼,大改先問。卡上的步驟跟著打勾(✓ 做完、▸ 進行中、– 略過),輸入框上方一行「照計畫做 · 2/5 · 現在這一步」,滑過去看整份清單,右邊「取消計畫」。全部做完那一輪結束時留一行「計畫完成:5 步都做完了。」,計畫清掉。
|
||||
- **照計畫做**:核准後同一輪接著做(不用再傳訊息),所有工具打開,第 1 步自動標成進行中;它每做完一步用 update_plan 更新一次(整份清單、同時只有一步進行中;不用每個小動作都更新——Manus 發現打勾佔了三分之一的動作)。計畫和實際不符就改清單並在訊息裡說為什麼,大改先問。卡上的步驟跟著打勾(✓ 做完、▸ 進行中、– 略過),輸入框上方臉的同一行右邊一個計畫圖示,旁邊寫「2/5」,滑過去看「照計畫做 · 2/5 · 現在這一步」和整份清單,點一下有「取消計畫」。全部做完那一輪結束時留一行「計畫完成:5 步都做完了。」,計畫清掉。
|
||||
- **只管你自己的訊息**:例行任務、訊息管道和團隊成員的訊息照平常做,不受計畫模式限制。照計畫做的期間每一輪都帶著這份計畫(像 Claude Code 把核准的計畫交回給模型),所以聊別的事前先取消。清除聊天記錄、開始新對話會連計畫一起清掉;分享 Bot 的檔案不含計畫。重開 AnyBot 計畫還在;還沒核准時重開,傳一句話它就接著規劃。
|
||||
- 手機一樣:計畫卡、問題卡、計畫列和「取消計畫」都有。
|
||||
- 手機一樣:計畫卡、問題卡都有;目標和計畫在輸入框上方是一排小圖示(計畫旁邊寫「2/5」),點一下展開那一行和「清除目標」/「取消計畫」。
|
||||
- **外觀(Bot 是主角)**:介面本身安靜(黑、白、灰),顏色和動作都留給 Bot。
|
||||
- **字型**:介面用思源黑體(Noto Sans TC),讀的文字——Bot 的回答、頁面內文和標題——用思源宋體(Noto Serif TC),像 Claude 的回答一樣是書的字;兩種都有 Regular 和 Bold,包在 App 裡,每台電腦看起來一樣。程式碼用系統的等寬字。沒有字型選項。
|
||||
- **你的訊息是淡灰泡泡**(預設「安靜」;設定 › 一般 › 聊天的顏色可以改成「跟著 Bot」:你的訊息泡泡、送出鈕、側邊欄選中的那格用 Bot 的顏色,或「只用黑色」)。Bot 的回覆不用泡泡,像文件一樣排在頁面上,只有錯誤訊息有泡泡。
|
||||
|
|
|
|||
|
|
@ -14,13 +14,13 @@
|
|||
## 使用者怎麼到
|
||||
|
||||
- 在輸入框打「/goal 條件」送出。
|
||||
- 有目標時,輸入框上方有一條目標列:滑過去看條件和最近一次檢查的理由,旁邊有「清除目標」。
|
||||
- 有目標時,輸入框上方那張臉的同一行右邊有一個目標圖示(不另外佔一行;暫停時變灰):滑過去看「目標進行中 · 12 分 · 3 輪」、條件和最近一次檢查的理由;點一下打開同樣的說明和「清除目標」。手機是輸入框上方一排小圖示,點一下展開那一行和「清除目標」。
|
||||
- 目標存在 Bot 身上,重開 AnyBot 還在,但會先暫停(「AnyBot 重新啟動過」),等使用者一句話才繼續。
|
||||
|
||||
## 怎麼操作
|
||||
|
||||
- Bot:沒有專用工具,照常做事就好。不要用說的宣稱完成,評審只認工具留下的結果;送出類的工作,系統會自己數送出幾次、記下送到哪裡。需要使用者回答就直接問,目標會停下來等。
|
||||
- 驗證:設一個做得到的目標(例如「在工作資料夾建立 hello.txt,內容是 hi」),要看到它自己做完、評審判達成、目標列消失;設一個做不到的,要看到「目標做不到,已清除」;Bot 說做完但工具紀錄沒有,評審不能判達成;評審查證時不會改到任何檔案。自動測試:`cargo test goal::`、`cargo test evidence::`、`cargo test the_judge_looks_for_itself`。
|
||||
- 驗證:設一個做得到的目標(例如「在工作資料夾建立 hello.txt,內容是 hi」),要看到它自己做完、評審判達成、目標圖示消失;設一個做不到的,要看到「目標做不到,已清除」;Bot 說做完但工具紀錄沒有,評審不能判達成;評審查證時不會改到任何檔案。自動測試:`cargo test goal::`、`cargo test evidence::`、`cargo test the_judge_looks_for_itself`。
|
||||
|
||||
## 陷阱
|
||||
|
||||
|
|
|
|||
|
|
@ -14,18 +14,18 @@
|
|||
## 使用者怎麼到
|
||||
|
||||
- 在輸入框打「/」選 /plan,或直接打「/plan 要做的事」送出(手機一樣)。Bot 正在做事時不能開始,要等它做完或先按停止。
|
||||
- 有計畫時,輸入框上方有一條計畫列:「計畫模式 · 只查資料、寫計畫,你核准後才動手」或「照計畫做 · 2/5 · 現在這一步」;滑過去看要做的事和整份清單,旁邊有「取消計畫」。
|
||||
- 有計畫時,輸入框上方那張臉的同一行右邊有一個計畫圖示(不另外佔一行;照計畫做時旁邊寫「2/5」):滑過去看「計畫模式 · 只查資料、寫計畫,你核准後才動手」或「照計畫做 · 2/5 · 現在這一步」、要做的事和整份清單;點一下打開同樣的說明和「取消計畫」。目標、一律放行開著時,圖示排在同一排。手機是輸入框上方一排小圖示,點一下展開那一行和「取消計畫」。
|
||||
- 計畫存在 Bot 身上,重開 AnyBot 還在;還沒核准時重開,等你傳一句話它就接著規劃、重交一張卡。
|
||||
|
||||
## 怎麼操作
|
||||
|
||||
- Bot:計畫模式裡多一個 `submit_plan`(summary、steps[title、detail]、check、notes),只開放會看的工具和 `ask_person`;核准後多一個 `update_plan`(steps:title 和 status:pending、in_progress、done、skipped)。不要在訊息裡把計畫再寫一次,卡片會顯示。
|
||||
- 驗證:對 Bot 打「/plan 在工作資料夾建立 hello.txt,內容是 hi」:計畫列出現、它不建檔、交出一張計畫卡和「照這個計畫做嗎?」;在卡上打「檔名改成 hi.txt」要收到新版卡、舊卡變「已修改」;按「開始照計畫做」後它建檔、卡上步驟打勾、做完留「計畫完成」那一行、計畫列消失。再試一次按「先不要」:計畫列消失、什麼都沒做。計畫模式時叫它執行指令,要被擋下並說計畫還沒核准。自動測試:`cargo test plan::`、`cargo test agent::tests::plan`。
|
||||
- 驗證:對 Bot 打「/plan 在工作資料夾建立 hello.txt,內容是 hi」:計畫圖示出現(滑過去寫「計畫模式」)、它不建檔、交出一張計畫卡和「照這個計畫做嗎?」;在卡上打「檔名改成 hi.txt」要收到新版卡、舊卡變「已修改」;按「開始照計畫做」後它建檔、卡上步驟打勾、做完留「計畫完成」那一行、計畫圖示消失。再試一次按「先不要」:計畫圖示消失、什麼都沒做。再試一次點圖示 ›「取消計畫」:聊天留「已取消計畫」、圖示消失。計畫模式時叫它執行指令,要被擋下並說計畫還沒核准。自動測試:`cargo test plan::`、`cargo test agent::tests::plan`。
|
||||
|
||||
## 陷阱
|
||||
|
||||
- 計畫模式只管使用者自己的訊息:例行任務、訊息管道和團隊成員傳來的訊息照平常做,不受計畫影響;群組聊天不能用 /plan。
|
||||
- Bot 漏了 `update_plan`,計畫列會停在舊的步驟,計畫也不會自己結束:叫它更新進度,或「/plan clear」。
|
||||
- Bot 漏了 `update_plan`,計畫圖示的進度會停在舊的步驟,計畫也不會自己結束:叫它更新進度,或「/plan clear」。
|
||||
- 照計畫做的期間,每一輪都會帶著這份計畫;聊別的事前先取消,免得它一直想回到計畫。
|
||||
- 清除聊天記錄或開始新對話,計畫跟著清掉。
|
||||
- 在同一步裡跟計畫一起要求的動作(例如交計畫的同時要執行指令)不會執行:那時還沒核准。
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ Bot 要動到你的電腦、對外送出或做收不回來的事時,先問你
|
|||
- 一律允許記在那個 Bot 身上(例如「修改檔案」、「npm install」、某個連接器),Bot 設定 ›「電腦操作」的「已設定「一律允許」」看得到,按 × 移除。
|
||||
- 拒絕後停下:同一輪裡 Bot 再提一模一樣的操作(同一個工具、同樣的參數),直接替你拒絕、不再問,直到你再傳一則訊息(工作中插話也算)。按停止、關視窗不算拒絕。
|
||||
- 直接操作:打開時一次做完——打開「在這台電腦上執行」、自動審核、所有 Bot 的電腦工具;「一律詢問」規則是空的就填三條預設(刪除檔案或資料夾/付款、購買或轉帳/用我的帳號發文、留言,或傳訊息給別人);進行中的工作下一步起不再問;別的 Bot 在等的「可以用電腦嗎」自動允許。
|
||||
- 一律放行(/always-approve,也可以打 /yolo):你自己打的指令,一把全開——打開直接操作,之後所有 Bot 要等「允許」的都自動允許,連直接操作還會問的(「一律詢問」規則、付款/傳送/刪除的點擊、寄信、傳訊息、AppleScript、打電話、簡訊、在 X 發文、保險庫卡片)也不問,自動審核也略過。仍然擋:安全規則一律拒絕的(下面那串);別人傳來的訊息(訊息管道、團隊成員)那一輪照樣等你按;問題卡、「需要處理」和 /plan 的計畫卡照樣等你。打開時已經在等的卡片(你自己的)一起放行。開著時每個聊天的輸入框上方有一條「一律放行 · Bot 做事不再問你」和「關閉」。「/always-approve off」關掉:要核准的又會問;直接操作是它順手打開的就一起關,本來就開著的留著。「/always-approve status」看現在是不是。管理員鎖了直接操作或「在這台電腦上執行」就打不開。
|
||||
- 一律放行(/always-approve,也可以打 /yolo):你自己打的指令,一把全開——打開直接操作,之後所有 Bot 要等「允許」的都自動允許,連直接操作還會問的(「一律詢問」規則、付款/傳送/刪除的點擊、寄信、傳訊息、AppleScript、打電話、簡訊、在 X 發文、保險庫卡片)也不問,自動審核也略過。仍然擋:安全規則一律拒絕的(下面那串);別人傳來的訊息(訊息管道、團隊成員)那一輪照樣等你按;問題卡、「需要處理」和 /plan 的計畫卡照樣等你。打開時已經在等的卡片(你自己的)一起放行。開著時每個聊天的輸入框上方、臉的同一行右邊有一個紅色閃電圖示(不另外佔一行;新對話沒有臉時自己一小行):滑過去看「一律放行 · Bot 做事不再問你」和還會擋什麼,點一下有「關閉一律放行」。「/always-approve off」關掉:要核准的又會問;直接操作是它順手打開的就一起關,本來就開著的留著。「/always-approve status」看現在是不是。管理員鎖了直接操作或「在這台電腦上執行」就打不開。
|
||||
- 直接操作仍會問或擋:安全規則擋的;符合「一律詢問」規則的;畫面上目標寫著付款、傳送、刪除這類字的點擊;用「郵件」「訊息」寄送(「訊息」開了「無需詢問直接傳送」除外);沙盒外的 AppleScript(選「一律允許」前);打電話、傳簡訊、在 X 發文;用保險庫的卡片。問題卡和「需要處理」也照樣等你。
|
||||
- 自動審核:兩組用一般的話寫的規則「無需詢問直接允許」「一律詢問」,由這個 Bot 的模型判斷,兩邊都符合時「一律詢問」優先。符合允許就直接做;符合詢問就問你,而且沒有「一律允許」;都不符合照常問;審核沒回應就先問你。
|
||||
- 固定樣式的規則:規則也可以寫成 `shell(git *)`(指令;允許要 `a && b` 每一段都符合,詢問只要一段)、`file(~/Projects/**)`(檔案或資料夾,** 任何層、* 一層)、`connector(gitlab__*)`(連接器的工具)、`web(domain:example.com)`(那個網站和它底下的網址)、`tool(browser_click)`(工具的名字)。樣式先判斷、每次一樣、不呼叫模型:符合「一律詢問」的樣式一定問(模型說允許也沒用);符合允許的樣式就允許,但用一般的話寫的「一律詢問」還是會先讓模型看一次;有藏起來的指令($()、反引號)的,樣式不會允許。
|
||||
|
|
|
|||
|
|
@ -280,6 +280,14 @@ details.dt>.dt-in{padding-left:var(--sp-4);margin-top:var(--sp-2)}
|
|||
.btn.no{color:var(--danger)}
|
||||
.btn.sm{height:34px;padding:0 12px;font-size:var(--fs-small);border-radius:999px}
|
||||
.btn:disabled{opacity:.45}
|
||||
/* 目標 and 計畫 while they are on: one row of small chips (no line each); a tap opens that one's line below. */
|
||||
.modes{max-width:560px;margin:0 auto 6px;display:flex;gap:6px}
|
||||
.modes:empty{display:none}
|
||||
.mode{position:relative;display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 9px;border-radius:999px;background:var(--hover);font-size:var(--fs-small);color:var(--text2)}
|
||||
/* (28 px to look at, 44 px to tap.) */
|
||||
.mode::after{content:"";position:absolute;inset:-8px -2px}
|
||||
.mode.on .ic{color:var(--accent)}
|
||||
.mode.open{box-shadow:inset 0 0 0 1px var(--text3)}
|
||||
.goalbar{max-width:560px;margin:0 auto 6px;display:flex;align-items:center;gap:8px;font-size:var(--fs-small);color:var(--text2);background:var(--hover);border-radius:var(--r-m);padding:5px 6px 5px 11px}
|
||||
.goalbar .t{flex:1;min-width:0;display:flex;align-items:center;gap:6px}
|
||||
.goalbar .t span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
||||
|
|
@ -607,6 +615,7 @@ button,.row,.ib,.island,.opt,.chip,.tab,label.sw,[role="button"]{-webkit-user-se
|
|||
<button class="down" id="b-down" title="到最新的訊息"></button>
|
||||
<div class="dock">
|
||||
<div id="ask"></div>
|
||||
<div class="modes" id="modes"></div>
|
||||
<div id="goalbar"></div>
|
||||
<div id="planbar"></div>
|
||||
<div id="queued"></div>
|
||||
|
|
@ -1289,7 +1298,7 @@ function chatHead() {
|
|||
}
|
||||
$("island").onclick = () => go("details", {bot: S.open});
|
||||
function openChat(id) {
|
||||
if (S.open !== id) { S.msgs = []; S.pending = []; S.quote = null; S.unfold = {}; S.openSteps = {}; S.chatSig = ""; S.prevShown = 0; S.prevFirst = ""; $("msgs").innerHTML = ""; }
|
||||
if (S.open !== id) { S.msgs = []; S.pending = []; S.quote = null; S.unfold = {}; S.openSteps = {}; S.chatSig = ""; S.prevShown = 0; S.prevFirst = ""; MODE_OPEN = ""; $("msgs").innerHTML = ""; }
|
||||
S.open = id;
|
||||
// Your bubbles as 聊天的顏色 on the computer says (ob.bubble): "quiet" a light grey with the
|
||||
// page's ink (the default), "bot" the bot's colour, "black". (An older AnyBot sends no field: its colour.)
|
||||
|
|
@ -1628,17 +1637,26 @@ function renderQuestion(a, force) {
|
|||
if (back) back.onclick = () => { ASKF.step = i - 1; renderQuestion(a, true); };
|
||||
box.querySelector('[data-go="skip"]').onclick = () => send({answer: "reject"});
|
||||
}
|
||||
// Which mode's line is open above the input ("goal", "plan" or none).
|
||||
var MODE_OPEN = ""; // (var: openChat, above, clears it.)
|
||||
function renderDockRest(b) {
|
||||
// 目標: how it stands, and 清除 (sent as 「/goal clear」, the brain's own command).
|
||||
const g = b.goal;
|
||||
$("goalbar").innerHTML = g ? `<div class="goalbar ${g.active ? "on" : ""}"><div class="t" title="${esc("目標:" + g.condition + (g.reason ? "\n最近一次檢查:" + g.reason : ""))}">${ic("target", 14)}<span>${esc(g.line)}</span></div>${owner() ? `<button id="goal-x">清除目標</button>` : ""}</div>` : "";
|
||||
if (g && owner()) $("goal-x").onclick = async () => {
|
||||
// 目標 and 計畫: a chip each in one row (what it is on hover; the plan's 2/5 beside its icon).
|
||||
// A tap opens that one's line: how it stands, and 清除目標/取消計畫 (sent as 「/goal clear」,
|
||||
// 「/plan clear」, the brain's own commands).
|
||||
const g = b.goal, pl = b.plan;
|
||||
if (MODE_OPEN && !(MODE_OPEN === "goal" ? g : pl)) MODE_OPEN = "";
|
||||
const gTip = g ? g.line + "\n\n目標:" + g.condition + (g.reason ? "\n最近一次檢查:" + g.reason : "") : "";
|
||||
const pTip = pl ? pl.line + "\n\n要做的事:" + pl.task + (pl.steps ? "\n\n" + pl.steps : "") : "";
|
||||
const count = pl ? (/\d+/\d+/.exec(pl.line) || [""])[0] : "";
|
||||
const chip = (m, on, icon, tip, label, n) => `<button class="mode ${on ? "on" : ""} ${MODE_OPEN === m ? "open" : ""}" data-m="${m}" title="${esc(tip)}" aria-label="${label}" aria-expanded="${MODE_OPEN === m}">${ic(icon, 14)}${n ? `<span>${esc(n)}</span>` : ""}</button>`;
|
||||
$("modes").innerHTML = (g ? chip("goal", g.active, "target", gTip, "目標", "") : "") + (pl ? chip("plan", true, "list-checks", pTip, "計畫", count) : "");
|
||||
$("modes").querySelectorAll(".mode").forEach((x) => x.onclick = () => { MODE_OPEN = MODE_OPEN === x.dataset.m ? "" : x.dataset.m; renderDockRest(b); });
|
||||
$("goalbar").innerHTML = g && MODE_OPEN === "goal" ? `<div class="goalbar ${g.active ? "on" : ""}"><div class="t" title="${esc(gTip)}">${ic("target", 14)}<span>${esc(g.line)}</span></div>${owner() ? `<button id="goal-x">清除目標</button>` : ""}</div>` : "";
|
||||
if ($("goal-x")) $("goal-x").onclick = async () => {
|
||||
try { await api(base() + `api/bots/${S.open}/send`, {json: {text: "/goal clear", attachments: []}}); toast("已清除目標"); loadChat(); } catch (e) { toast(e.message); }
|
||||
};
|
||||
// 計畫: where it is (the steps on hover), and 取消計畫 (sent as 「/plan clear」).
|
||||
const pl = b.plan;
|
||||
$("planbar").innerHTML = pl ? `<div class="goalbar on"><div class="t" title="${esc("要做的事:" + pl.task + (pl.steps ? "\n\n" + pl.steps : ""))}">${ic("list-checks", 14)}<span>${esc(pl.line)}</span></div>${owner() ? `<button id="plan-x">取消計畫</button>` : ""}</div>` : "";
|
||||
if (pl && owner()) $("plan-x").onclick = async () => {
|
||||
$("planbar").innerHTML = pl && MODE_OPEN === "plan" ? `<div class="goalbar on"><div class="t" title="${esc(pTip)}">${ic("list-checks", 14)}<span>${esc(pl.line)}</span></div>${owner() ? `<button id="plan-x">取消計畫</button>` : ""}</div>` : "";
|
||||
if ($("plan-x")) $("plan-x").onclick = async () => {
|
||||
try { await api(base() + `api/bots/${S.open}/send`, {json: {text: "/plan clear", attachments: []}}); toast("已取消計畫"); loadChat(); } catch (e) { toast(e.message); }
|
||||
};
|
||||
const q = b.queued || [];
|
||||
|
|
|
|||
128
src/app.rs
128
src/app.rs
|
|
@ -2653,35 +2653,96 @@ impl App {
|
|||
self.save_now = true;
|
||||
}
|
||||
|
||||
/// The line above the input while 一律放行 is on (every chat: it is everyone's), with 關閉.
|
||||
fn always_bar(&mut self, ui: &mut egui::Ui, ctx: &egui::Context, bot_id: u64) {
|
||||
if !self.always_on() {
|
||||
return;
|
||||
/// The modes that are on — 目標, 計畫, 一律放行 (every chat: it is everyone's) — as icons at
|
||||
/// the right of `row` (the face's row above the input), so they take no line of their own:
|
||||
/// hovering one says how it stands, a click opens the same words with the button that ends
|
||||
/// it. Returns the width they took.
|
||||
fn mode_icons(&mut self, ui: &mut egui::Ui, ctx: &egui::Context, bot: &Bot, row: egui::Rect) -> f32 {
|
||||
use crate::icons::Icon;
|
||||
#[derive(Clone, Copy)]
|
||||
enum Mode {
|
||||
Goal,
|
||||
Plan,
|
||||
Always,
|
||||
}
|
||||
struct Shown {
|
||||
mode: Mode,
|
||||
icon: Icon,
|
||||
col: Color32,
|
||||
/// Beside the icon: the plan's 「2/5」.
|
||||
count: String,
|
||||
line: String,
|
||||
more: String,
|
||||
end: &'static str,
|
||||
}
|
||||
let p = self.pal;
|
||||
let mut off = false;
|
||||
ui.horizontal(|ui| {
|
||||
ui.add_space(14.0);
|
||||
ui.with_layout(Layout::right_to_left(Align::Center), |ui| {
|
||||
ui.add_space(10.0);
|
||||
off = small_button(ui, "關閉", p).clicked();
|
||||
ui.with_layout(Layout::left_to_right(Align::Center), |ui| {
|
||||
ui.spacing_mut().item_spacing.x = 6.0;
|
||||
let (r, _) = ui.allocate_exact_size(vec2(13.0, 14.0), egui::Sense::hover());
|
||||
crate::icons::paint(ui.painter(), egui::Rect::from_center_size(r.center(), vec2(12.0, 12.0)), crate::icons::Icon::Zap, p.danger);
|
||||
ui.add(egui::Label::new(RichText::new(t(crate::always::BAR)).size(FONT_XS).color(p.text2)).truncate().selectable(false))
|
||||
.on_hover_text(t("用 /always-approve 打開的。安全規則一律拒絕的(sudo、rm -rf /、金鑰檔…)照樣擋;別人傳來的訊息照樣等你按;問題卡和「需要處理」照樣等你。"));
|
||||
});
|
||||
});
|
||||
});
|
||||
ui.add_space(2.0);
|
||||
if off {
|
||||
if self.mir.on {
|
||||
self.mirror_send(bot_id, "/always-approve off".into(), vec![], None);
|
||||
} else {
|
||||
self.always_command(ctx, bot_id, crate::always::Command::Off);
|
||||
let mut shown = vec![];
|
||||
if let Some(g) = bot.goal.as_ref() {
|
||||
let line = if g.active() && self.goal_checking.contains(&bot.id) { t("目標 · 正在檢查有沒有達成…") } else { t(&crate::goal::bar_text(g, crate::model::now_ms())) };
|
||||
let mut more = format!("{}{}", t("目標:"), g.condition);
|
||||
if !g.reason.is_empty() {
|
||||
more.push_str(&format!("\n\n{}{}", t("最近一次檢查:"), g.reason));
|
||||
}
|
||||
shown.push(Shown { mode: Mode::Goal, icon: Icon::Target, col: if g.active() { p.accent } else { p.text3 }, count: String::new(), line, more, end: "清除目標" });
|
||||
}
|
||||
if let Some(pl) = bot.plan.as_ref() {
|
||||
let doing = pl.stage == crate::plan::Stage::Doing;
|
||||
let mut more = format!("{}{}", t("要做的事:"), pl.task);
|
||||
if doing {
|
||||
more.push_str(&format!("\n\n{}", crate::plan::checklist(&pl.steps)));
|
||||
}
|
||||
let count = if doing { format!("{}/{}", pl.done(), pl.steps.len()) } else { String::new() };
|
||||
shown.push(Shown { mode: Mode::Plan, icon: Icon::Summary, col: p.accent, count, line: t(&crate::plan::bar_text(pl)), more, end: "取消計畫" });
|
||||
}
|
||||
if self.always_on() {
|
||||
let more = t("用 /always-approve 打開的。安全規則一律拒絕的(sudo、rm -rf /、金鑰檔…)照樣擋;別人傳來的訊息照樣等你按;問題卡和「需要處理」照樣等你。");
|
||||
shown.push(Shown { mode: Mode::Always, icon: Icon::Zap, col: p.danger, count: String::new(), line: t(crate::always::BAR), more, end: "關閉一律放行" });
|
||||
}
|
||||
if shown.is_empty() {
|
||||
return 0.0;
|
||||
}
|
||||
let mut end = None;
|
||||
let mut at = ui.new_child(egui::UiBuilder::new().max_rect(row.shrink2(vec2(10.0, 0.0))).layout(Layout::right_to_left(Align::Center)));
|
||||
at.spacing_mut().item_spacing.x = 2.0;
|
||||
// (Right to left: the last one first, and a count before its icon.)
|
||||
for m in shown.iter().rev() {
|
||||
if !m.count.is_empty() {
|
||||
at.add(egui::Label::new(RichText::new(&m.count).size(FONT_XS).color(p.text2)).selectable(false));
|
||||
}
|
||||
// (An id of its own: the popup stays open while cards come and go above.)
|
||||
let (rect, _) = at.allocate_exact_size(vec2(26.0, 26.0), egui::Sense::hover());
|
||||
let r = at.interact(rect, egui::Id::new(("mode", bot.id, m.end)), egui::Sense::click()).on_hover_cursor(egui::CursorIcon::PointingHand);
|
||||
if r.hovered() {
|
||||
at.painter().rect_filled(rect, 7.0, p.hover);
|
||||
}
|
||||
crate::icons::paint(at.painter(), egui::Rect::from_center_size(rect.center(), vec2(16.0, 16.0)), m.icon, m.col);
|
||||
egui::Popup::menu(&r).show(|ui| {
|
||||
ui.set_max_width(300.0);
|
||||
ui.add(egui::Label::new(RichText::new(&m.line).size(FONT_SM).strong().family(crate::bold()).color(p.text)).wrap().selectable(false));
|
||||
ui.add(egui::Label::new(RichText::new(&m.more).size(FONT_XS).color(p.text2)).wrap().selectable(false));
|
||||
ui.add_space(4.0);
|
||||
if menu_ui::item(ui, p, Icon::Close, m.end).clicked() {
|
||||
end = Some(m.mode);
|
||||
ui.close();
|
||||
}
|
||||
});
|
||||
r.on_hover_text(format!("{}\n\n{}\n\n{}{}", m.line, m.more, t("點一下:"), t(m.end)));
|
||||
}
|
||||
let used = at.min_rect().width() + 10.0;
|
||||
if bot.goal.as_ref().is_some_and(|g| g.active()) {
|
||||
// The goal's minutes count on.
|
||||
ctx.request_repaint_after(std::time::Duration::from_secs(30));
|
||||
}
|
||||
match end {
|
||||
Some(Mode::Goal) => self.goal_clear(ctx, bot.id),
|
||||
Some(Mode::Plan) => self.plan_clear(ctx, bot.id),
|
||||
Some(Mode::Always) if self.mir.on => {
|
||||
self.mirror_send(bot.id, "/always-approve off".into(), vec![], None);
|
||||
}
|
||||
Some(Mode::Always) => self.always_command(ctx, bot.id, crate::always::Command::Off),
|
||||
None => {}
|
||||
}
|
||||
used
|
||||
}
|
||||
|
||||
fn local_on(&self) -> bool {
|
||||
|
|
@ -4058,7 +4119,14 @@ impl App {
|
|||
/// The bot's face peeking over the input, and beside it what it is doing (see dock_face).
|
||||
/// Not in an empty chat, where the face is the big one in the middle.
|
||||
fn face_dock(&mut self, ui: &mut egui::Ui, bot: &Bot) {
|
||||
let ctx = ui.ctx().clone();
|
||||
if bot.messages.is_empty() {
|
||||
// No face here; modes that are on (一律放行 is on in every chat) still show, in a
|
||||
// slim row of their own.
|
||||
if bot.goal.is_some() || bot.plan.is_some() || self.always_on() {
|
||||
let (row, _) = ui.allocate_exact_size(vec2(ui.available_width(), 28.0), egui::Sense::hover());
|
||||
self.mode_icons(ui, &ctx, bot, row);
|
||||
}
|
||||
return;
|
||||
}
|
||||
let p = self.pal;
|
||||
|
|
@ -4068,6 +4136,8 @@ impl App {
|
|||
let (row, _) = ui.allocate_exact_size(vec2(ui.available_width(), 46.0), egui::Sense::hover());
|
||||
let face = egui::Rect::from_min_size(row.left_top() + vec2(16.0, 4.0), vec2(40.0, 40.0));
|
||||
self.dock_face(ui, bot, face);
|
||||
// 目標, 計畫, 一律放行: icons at the right of this row.
|
||||
let modes_w = self.mode_icons(ui, &ctx, bot, row);
|
||||
let now = ui.input(|i| i.time);
|
||||
let waiting = self.approvals.contains_key(&bot.id);
|
||||
let asked = self.approvals.get(&bot.id).is_some_and(|a| a.kind == ApprovalKind::Question);
|
||||
|
|
@ -4075,7 +4145,7 @@ impl App {
|
|||
if let Some(words) = words {
|
||||
let col = self.bot_color(bot);
|
||||
let col = if bot.color == "black" || self.state.accent != Accent::BotColor || waiting { p.text } else { col };
|
||||
let mut at = ui.new_child(egui::UiBuilder::new().max_rect(egui::Rect::from_min_max(egui::pos2(face.right() + 10.0, row.top()), row.right_bottom())).layout(Layout::left_to_right(Align::Center)));
|
||||
let mut at = ui.new_child(egui::UiBuilder::new().max_rect(egui::Rect::from_min_max(egui::pos2(face.right() + 10.0, row.top()), row.right_bottom() - vec2(modes_w, 0.0))).layout(Layout::left_to_right(Align::Center)));
|
||||
let words = sidebar_ui::shorten_width(&at, &words, at.available_width() - 8.0, 13.5);
|
||||
if waiting {
|
||||
at.label(RichText::new(words).size(FONT_SM).strong().family(crate::bold()).color(col));
|
||||
|
|
@ -4359,12 +4429,6 @@ impl App {
|
|||
self.attachments_poll(ctx, bot.id, had_focus);
|
||||
self.voice_poll(ctx);
|
||||
ui.add_space(4.0);
|
||||
// 目標: how the goal stands, and 清除目標.
|
||||
self.goal_bar(ui, ctx, bot);
|
||||
// 計畫: where the plan is, and 取消計畫.
|
||||
self.plan_bar(ui, ctx, bot);
|
||||
// 一律放行: on in every chat while it lasts, with 關閉.
|
||||
self.always_bar(ui, ctx, bot.id);
|
||||
// Quote and attachments sit just above the pill.
|
||||
if let Some(q) = self.quoting.get(&bot.id).cloned() {
|
||||
ui.horizontal(|ui| {
|
||||
|
|
|
|||
|
|
@ -301,42 +301,6 @@ impl App {
|
|||
self.save_now = true;
|
||||
}
|
||||
|
||||
/// The line above the input while there is a goal: how it stands (the goal and the newest
|
||||
/// check on hover) and 清除目標. The words end in … before the button on a narrow window.
|
||||
pub(super) fn goal_bar(&mut self, ui: &mut egui::Ui, ctx: &egui::Context, bot: &Bot) {
|
||||
let Some(g) = bot.goal.as_ref() else { return };
|
||||
let p = self.pal;
|
||||
let now = crate::model::now_ms();
|
||||
let text = if g.active() && self.goal_checking.contains(&bot.id) { t("目標 · 正在檢查有沒有達成…") } else { goal::bar_text(g, now) };
|
||||
let mut tip = format!("{}{}", t("目標:"), g.condition);
|
||||
if !g.reason.is_empty() {
|
||||
tip.push_str(&format!("\n\n{}{}", t("最近一次檢查:"), g.reason));
|
||||
}
|
||||
let col = if g.active() { p.text2 } else { p.text3 };
|
||||
let mut clear = false;
|
||||
ui.horizontal(|ui| {
|
||||
ui.add_space(14.0);
|
||||
ui.with_layout(Layout::right_to_left(Align::Center), |ui| {
|
||||
ui.add_space(10.0);
|
||||
clear = small_button(ui, "清除目標", p).clicked();
|
||||
ui.with_layout(Layout::left_to_right(Align::Center), |ui| {
|
||||
ui.spacing_mut().item_spacing.x = 6.0;
|
||||
let (r, _) = ui.allocate_exact_size(vec2(13.0, 14.0), egui::Sense::hover());
|
||||
crate::icons::paint(ui.painter(), egui::Rect::from_center_size(r.center(), vec2(12.0, 12.0)), crate::icons::Icon::Target, if g.active() { p.accent } else { col });
|
||||
ui.add(egui::Label::new(RichText::new(&text).size(FONT_XS).color(col)).truncate().selectable(false)).on_hover_text(&tip);
|
||||
});
|
||||
});
|
||||
});
|
||||
ui.add_space(2.0);
|
||||
if clear {
|
||||
self.goal_clear(ctx, bot.id);
|
||||
}
|
||||
if g.active() {
|
||||
// The minutes count on.
|
||||
ctx.request_repaint_after(std::time::Duration::from_secs(30));
|
||||
}
|
||||
}
|
||||
|
||||
/// A goal's line in the chat (AnyBot's, not the bot's): small, in the middle.
|
||||
pub(super) fn goal_note_row(&self, ui: &mut egui::Ui, m: &Message) {
|
||||
let p = self.pal;
|
||||
|
|
|
|||
|
|
@ -182,9 +182,11 @@ fn scenes() -> Vec<(&'static str, Open)> {
|
|||
}),
|
||||
),
|
||||
(
|
||||
"聊天:計畫卡(長步驟)與計畫列",
|
||||
"聊天:計畫卡(長步驟)與模式圖示",
|
||||
Box::new(|a: &mut App| {
|
||||
let id = a.state.selected;
|
||||
// 目標, 計畫 and 一律放行 at once: three icons beside the face's words.
|
||||
a.state.always_approve = true;
|
||||
let long = "把客戶服務與售後追蹤小組的每週報表從舊的共用資料夾搬到新的雲端硬碟並保留所有版本紀錄";
|
||||
let args = |n: &str| serde_json::json!({"summary": format!("{long},做完後兩邊的檔案數量和最後修改時間都一樣。"), "steps": [
|
||||
{"title": format!("{n}備份舊資料夾到 /Volumes/Backup/very/deep/path/that/keeps/going/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaEND"), "detail": "Extremely-long-unbreakable-detail-token-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaEND"},
|
||||
|
|
@ -196,6 +198,7 @@ fn scenes() -> Vec<(&'static str, Open)> {
|
|||
b.messages.push(Message { tool_calls: vec![call("audit-p1", "")], ..Message::assistant("", "模型") });
|
||||
b.messages.push(Message::tool_result("audit-p1", crate::plan::SUBMIT_TOOL, &crate::plan::approved_result(&[])));
|
||||
b.messages.push(Message { tool_calls: vec![call("audit-p2", "新版:")], ..Message::assistant("", "模型") });
|
||||
b.goal = Some(crate::goal::Goal::new(long, 0));
|
||||
b.plan = Some(crate::plan::Plan { task: long.into(), since: 0, stage: crate::plan::Stage::Doing, revisions: 0, steps: vec![
|
||||
crate::plan::Step { title: "備份舊資料夾到 /Volumes/Backup/very/deep/path/that/keeps/going/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaEND".into(), status: crate::plan::Status::Done },
|
||||
crate::plan::Step { title: long.into(), status: crate::plan::Status::InProgress },
|
||||
|
|
|
|||
|
|
@ -118,8 +118,8 @@ impl App {
|
|||
self.save_now = true;
|
||||
}
|
||||
|
||||
/// 取消計畫 above the input: on a screen the brain cancels it, as if typed there.
|
||||
fn plan_clear(&mut self, ctx: &egui::Context, bot_id: u64) {
|
||||
/// 取消計畫 (the plan's icon above the input): on a screen the brain cancels it, as if typed there.
|
||||
pub(super) fn plan_clear(&mut self, ctx: &egui::Context, bot_id: u64) {
|
||||
if self.mir.on {
|
||||
self.mirror_send(bot_id, "/plan clear".into(), vec![], None);
|
||||
return;
|
||||
|
|
@ -127,36 +127,6 @@ impl App {
|
|||
self.plan_command(ctx, bot_id, Command::Clear, "/plan clear", vec![], None);
|
||||
}
|
||||
|
||||
/// The line above the input while there is a plan: where it is (the steps on hover) and
|
||||
/// 取消計畫. The words end in … before the button on a narrow window.
|
||||
pub(super) fn plan_bar(&mut self, ui: &mut egui::Ui, ctx: &egui::Context, bot: &Bot) {
|
||||
let Some(pl) = bot.plan.as_ref() else { return };
|
||||
let p = self.pal;
|
||||
let text = t(&plan::bar_text(pl));
|
||||
let mut tip = format!("{}{}", t("要做的事:"), pl.task);
|
||||
if pl.stage == Stage::Doing {
|
||||
tip.push_str(&format!("\n\n{}", plan::checklist(&pl.steps)));
|
||||
}
|
||||
let mut clear = false;
|
||||
ui.horizontal(|ui| {
|
||||
ui.add_space(14.0);
|
||||
ui.with_layout(Layout::right_to_left(Align::Center), |ui| {
|
||||
ui.add_space(10.0);
|
||||
clear = small_button(ui, "取消計畫", p).clicked();
|
||||
ui.with_layout(Layout::left_to_right(Align::Center), |ui| {
|
||||
ui.spacing_mut().item_spacing.x = 6.0;
|
||||
let (r, _) = ui.allocate_exact_size(vec2(13.0, 14.0), egui::Sense::hover());
|
||||
crate::icons::paint(ui.painter(), egui::Rect::from_center_size(r.center(), vec2(12.0, 12.0)), crate::icons::Icon::Summary, p.accent);
|
||||
ui.add(egui::Label::new(RichText::new(&text).size(FONT_XS).color(p.text2)).truncate().selectable(false)).on_hover_text(&tip);
|
||||
});
|
||||
});
|
||||
});
|
||||
ui.add_space(2.0);
|
||||
if clear {
|
||||
self.plan_clear(ctx, bot.id);
|
||||
}
|
||||
}
|
||||
|
||||
/// The plan a bot handed in (`submit_plan`), as a card in its reply: waiting on the person,
|
||||
/// followed (its steps tick as the bot goes: the newest approved plan, while it lasts),
|
||||
/// changed, or not taken. One sent back or not taken shows only its summary.
|
||||
|
|
|
|||
|
|
@ -400,8 +400,8 @@ impl App {
|
|||
},
|
||||
"thinking": b.thinking, "step_model": b.step_model,
|
||||
"queued": live.map(|l| l.steer.lock().unwrap().iter().map(|q| q.text.clone()).collect::<Vec<_>>()).unwrap_or_default(),
|
||||
// 目標: how it stands (the line above the input), worded here so the phone says it the same way.
|
||||
// 計畫: where it is (the line above the input), worded here like the window's.
|
||||
// 目標: how it stands (its icon's words above the input), worded here so the phone says it the same way.
|
||||
// 計畫: where it is (its icon's words above the input), worded here like the window's.
|
||||
"plan": b.plan.as_ref().map(|p| json!({
|
||||
"task": p.task, "stage": p.stage, "line": crate::plan::bar_text(p),
|
||||
"steps": if p.stage == crate::plan::Stage::Doing { crate::plan::checklist(&p.steps) } else { String::new() },
|
||||
|
|
|
|||
|
|
@ -368,6 +368,8 @@ pub const ROWS: &[(&str, &str, &str)] = &[
|
|||
("● Bot 正在操作", "● A bot is operating", "● Bot が操作中"),
|
||||
("● 你正在操作,Bot 已暫停", "● You're in control; the bot is paused", "● あなたが操作中、Bot は一時停止中"),
|
||||
("關閉", "Close", "閉じる"),
|
||||
("關閉一律放行", "Turn off always-approve", "常に許可をオフにする"),
|
||||
("點一下:", "Click: ", "クリック:"),
|
||||
("在瀏覽器用 noVNC 全螢幕開啟", "Open full screen in the browser with noVNC", "ブラウザの noVNC で全画面で開く"),
|
||||
("停止", "Stop", "停止"),
|
||||
("網站,例如 github.com", "Site, e.g. github.com", "サイト(例:github.com)"),
|
||||
|
|
|
|||
Loading…
Reference in New Issue