Skip to content

feat(notify): Deny on the left, Approve on the right - #53

Merged
chaodu-agent merged 1 commit into
mainfrom
swap-telegram-button-order
Nov 28, 2026
Merged

chaodu-agent merged 1 commit into
mainfrom
swap-telegram-button-order

Conversation

@chaodu-agent

@chaodu-agent chaodu-agent commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Swaps the order of the two Telegram inline buttons so Deny is on the left and Approve on the right. Labels and callback data are unchanged. The unit test asserts the order and the design doc is updated.

Why: owner decision (2026-11-28). Approve on the right is easier to reach with the right thumb on a phone. The web approval page is unchanged (Approve first, stacked on narrow screens); this is recorded in docs/design/muse-gated-passthrough.md 3.6.2.

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.
@chaodu-agent
chaodu-agent merged commit a63d993 into main Nov 28, 2026
1 of 2 checks passed
@chaodu-agent

Copy link
Copy Markdown
Contributor Author

Important

CHANGES REQUESTED ⚠️ - The swap is correct and minimal, but it has no stated rationale, leaves the web approval page in the opposite order, and no Rust build or test ran on this PR.

What This PR Does

Swaps the two Telegram inline buttons so Deny is on the left and Approve on the right. Labels and callback data are unchanged.

How It Works

TelegramNotifier builds reply_markup.inline_keyboard as one row. The PR reorders the two entries (notify.rs:228-231), updates the index-based assertions in notify/tests.rs:166-170, and changes one sentence in docs/design/muse-gated-passthrough.md:535. The callback handler (notify/poll.rs parse_data) dispatches on the a/d prefix of callback_data, so button position has no effect on what a tap does.

Findings

# Severity Finding Location
1 🟡 Telegram now shows Deny first; the web approval page and its design doc still show Approve first crates/ap-proxy/src/approval/page.rs:546-547, docs/design/webauthn-approval.md:475
2 🟡 No rationale for the swap; existing users' muscle memory flips toward the irreversible action crates/ap-proxy/src/notify.rs:228-231
3 🟡 No Rust build or test ran on this PR (ci.yml is workflow_dispatch only) .github/workflows/ci.yml:3-5
4 🟢 Smallest viable change; label-to-callback pairing is intact and the test asserts both text and callback data per position crates/ap-proxy/src/notify/tests.rs:166-170
Finding Details

🟡 F1: Cross-surface button order

With [notify] buttons = true the owner decides in Telegram (Deny | Approve). With buttons = false the owner decides on the web page, which renders Approve then Deny (page.rs:546-547; side by side above 560px). docs/design/webauthn-approval.md:475 also lists "Approve and Deny". Switching modes now means opposite positions for the same action.

Requested change: either align the web page to Deny-then-Approve in the same PR, or state in the PR and design doc that the Telegram order intentionally differs.

🟡 F2: Unstated rationale and muscle-memory risk

Neither the PR description nor the commit message says why the order changes. Telegram inline buttons have no color, so position is the main cue. If stage-2 buttons are already in use, a habitual tap on the right side, which used to mean Deny, now approves and forwards the request. That cannot be undone. An accidental Deny is recoverable.

Requested change: record the reason (for example a platform convention or an owner preference) in the PR description and the design doc. If the goal is to prevent mis-taps, consider whether one button per row or more distinct labels would serve that better than a left/right swap.

🟡 F3: No CI validation

ci.yml has only a workflow_dispatch trigger, so the only check on this PR is poll-and-review, which does not compile or test anything. The cargo test --workspace result mentioned for this change was run outside CI and is not attached to the PR.

Requested change: dispatch ci.yml on this branch (or attach cargo test --workspace and cargo fmt --all --check output) before merge.

🟢 F4: Minimal and correct

+6/-6 across three files, with no new config, abstraction, or duplication. Deny stays paired with b.deny and Approve with b.approve; the updated test checks both text and callback_data at each index, so a cross-wiring regression would fail.

Baseline Check
  • PR opened: 2026-11-28
  • Head: c93a9b461f4c48000c54f57ce0082add3c22a0de; base: main; merge-base: 9e5f17b453fbb2a04ff427445a60e804183ab522
  • Diff stat: 3 files, +6/-6
  • Main already has: Telegram Approve/Deny buttons in the order Approve, Deny
  • Net-new value: presentation order only; no behavior, security, or callback change
Reviewer Verdicts
Reviewer Verdict Key points
Reviewer A Changes requested F1, F3; no correctness or security defect
Reviewer B Hold for owner clarification F1, F2, F3; smallest viable change
Coordinator baseline Changes requested F1, F3

Two of the four assigned reviewers did not report before the publish deadline.

What's Good (🟢)
  • Diff is limited to the change it describes, plus its test and doc
  • Test asserts order and callback data together
  • Callback parsing is position-independent, so the swap carries no security risk

Three Reasons We Might Not Need This PR

  1. Cosmetic only - no reported Telegram usability problem is cited; the change is presentation order.
  2. Surfaces may differ legitimately - Telegram and the web page have different layouts, so one shared order is not required, and keeping today's order avoids retraining.
  3. Risk shift with no measured benefit - for existing users the right-side tap becomes the irreversible action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant