mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 12:56:01 -06:00
fix(feishu): preserve button command values in fallback text and add Feishu comment guidance with callback privacy (#94385)
* fix(interactive): preserve button command values in fallback text for degraded approval UX * fix(interactive): keep callback values private in fallback text and narrow Feishu interactive detection - P1: Skip rendering action.type === "callback" values in renderMessagePresentationFallbackText to avoid leaking opaque channel/plugin data into user-visible text. Command and legacy values are still rendered. - P2: Replace hasMessagePresentationBlocks/hasInteractiveReplyBlocks with isMessagePresentationInteractiveBlock so Feishu comment guidance only appears when the presentation actually contains buttons or selects, not for text-only blocks. - Update tests: callback button now shows label-only; all 137 tests pass. * fix(interactive): only render typed command values in fallback text, keep legacy value private * fix(feishu): gate document-comment command guidance on actual command action * docs(message-presentation): document command/callback value fallback visibility * fix(feishu): omit command guidance when URL overrides fallback command text * docs: regenerate docs_map.md * fix(interactive): exclude disabled buttons from fallback command rendering and guidance * fix(interactive): extract hasRenderedCommandAction, exclude disabled buttons from command fallback * fix(feishu): preserve command guidance marker through core presentation rendering * fix(feishu): type-narrow channelData.feishu with isRecord before reading rendered-command marker * fix(feishu): move hasRenderedCommandAction from public SDK into Feishu plugin as local helper Keep the helper local to the only caller (Feishu outbound) instead of adding a new public plugin SDK API contract. The shared fallback renderer in renderMessagePresentationFallbackText already inlines the same command-visibility logic; a local helper is sufficient for the Feishu comment-thread guidance gate. * refactor(feishu): tighten fallback command marker --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
@@ -344,6 +344,26 @@ Fallback text includes:
|
||||
- button labels, including URLs for link buttons
|
||||
- select option labels
|
||||
|
||||
### Button value fallback visibility
|
||||
|
||||
When a channel cannot render interactive controls, button and select values
|
||||
fall back to plain text. The fallback behavior preserves usability while
|
||||
keeping opaque callback data private:
|
||||
|
||||
- **`command`-typed actions** render as `label: \`command\`` so users can
|
||||
copy the command and run it manually in the channel input.
|
||||
- **`callback`-typed actions** and legacy **`value`** fields render as
|
||||
label-only. The opaque callback value is not exposed in fallback text.
|
||||
- **`url` / `webApp`** buttons render the URL text alongside the button
|
||||
label, since the URL is user-facing.
|
||||
- **Select options** render as label-only. The underlying option value is not
|
||||
exposed in fallback text.
|
||||
|
||||
Channel adapters that add manual-command guidance in their fallback UI (e.g.
|
||||
Feishu document-comment instructions) must derive the command-present check
|
||||
from the same presentation blocks that the fallback renderer uses, so the
|
||||
guidance text only appears when a manual command is actually shown.
|
||||
|
||||
Unsupported native controls should degrade rather than fail the whole send.
|
||||
Examples:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user