From c93a9b461f4c48000c54f57ce0082add3c22a0de Mon Sep 17 00:00:00 2001 From: chaodu-agent <274062505+chaodu-agent@users.noreply.github.com> Date: Sat, 28 Nov 2026 09:18:07 -0500 Subject: [PATCH] feat(notify): show Deny on the left and Approve on the right Swap the order of the two inline buttons in the Telegram message. Labels, callback data and checks are unchanged. The unit test and the design doc state the new order. Verified on macmini (arm64, umask 022): cargo test --workspace, all passed. --- crates/ap-proxy/src/notify.rs | 2 +- crates/ap-proxy/src/notify/tests.rs | 8 ++++---- docs/design/muse-gated-passthrough.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/ap-proxy/src/notify.rs b/crates/ap-proxy/src/notify.rs index e3898ff..e5f5336 100644 --- a/crates/ap-proxy/src/notify.rs +++ b/crates/ap-proxy/src/notify.rs @@ -226,8 +226,8 @@ impl Notifier for TelegramNotifier { if let Some(b) = buttons { body["reply_markup"] = serde_json::json!({ "inline_keyboard": [[ - { "text": "Approve", "callback_data": b.approve }, { "text": "Deny", "callback_data": b.deny }, + { "text": "Approve", "callback_data": b.approve }, ]], }); } diff --git a/crates/ap-proxy/src/notify/tests.rs b/crates/ap-proxy/src/notify/tests.rs index 1e538d8..a625bfa 100644 --- a/crates/ap-proxy/src/notify/tests.rs +++ b/crates/ap-proxy/src/notify/tests.rs @@ -164,10 +164,10 @@ async fn buttons_message_has_only_fixed_text_id_link_and_buttons() { format!("{TEXT}\nRequest: {HOLD_ID}\n{VIEW_URL}") ); let row = &json["reply_markup"]["inline_keyboard"][0]; - assert_eq!(row[0]["text"], "Approve"); - assert_eq!(row[1]["text"], "Deny"); - assert_eq!(row[0]["callback_data"], buttons.approve); - assert_eq!(row[1]["callback_data"], buttons.deny); + assert_eq!(row[0]["text"], "Deny"); + assert_eq!(row[1]["text"], "Approve"); + assert_eq!(row[0]["callback_data"], buttons.deny); + assert_eq!(row[1]["callback_data"], buttons.approve); assert_eq!(buttons.approve.len(), poll::CALLBACK_DATA_LEN); assert_eq!(buttons.deny.len(), poll::CALLBACK_DATA_LEN); let text = json["text"].as_str().unwrap(); diff --git a/docs/design/muse-gated-passthrough.md b/docs/design/muse-gated-passthrough.md index 759acfc..f3d6a63 100644 --- a/docs/design/muse-gated-passthrough.md +++ b/docs/design/muse-gated-passthrough.md @@ -532,7 +532,7 @@ login. Approve and deny happen in Telegram. Config: `[notify] buttons = true`, w and `view_base_url`. `buttons = false` restores option C (3.6.1) with no code change. - **The message.** Text: the fixed sentence, `Request: `, the link `{view_base_url}/view/`, - and one row of two buttons, `Approve` and `Deny`. Nothing else leaves p1: no body, header, route + and one row of two buttons, `Deny` on the left and `Approve` on the right. Nothing else leaves p1: no body, header, route path, Discord token, digest or fingerprint. The view token is in the link, and it is the one value in the message that reads a request (accepted risk 1). - **Callback data.** `a` or `d`, then the 32-hex request id, then a 24-hex nonce: 57 bytes, under