fix(slack): one select instead of four rating buttons
ci / lint-test (push) Successful in 47s

Slack's mobile client gives every button in an actions block its own
full-width row, so the four ratings rendered as four stacked bars and the
nudge filled the screen (user, with a screenshot). A select is one row
and still one decision.

The interactive route now resolves both shapes — a button carries
`value`, a select carries it on `selected_option`. Reading only the
former would have left sharing working while rating silently did
nothing.
This commit is contained in:
2026-07-28 16:22:49 +10:00
parent aaa36dd75e
commit 8fbcbc5f83
2 changed files with 22 additions and 8 deletions
+16 -7
View File
@@ -69,16 +69,25 @@ export function nudgeBlocks(s: NudgeState) {
},
],
},
// A select, not four buttons. Slack's mobile client gives every button in
// an actions block its own full-width row, so four ratings became four
// stacked bars and the card filled the screen. One select is one row and
// still one decision; the extra tap to open it is the price of a nudge you
// can read at a glance.
{
type: "actions",
block_id: "rate",
elements: RATINGS.map((r) => ({
type: "button",
action_id: `rate_${r}`,
text: { type: "plain_text", text: RATING_LABEL[r] },
style: r === "never" ? "danger" : undefined,
value: `${s.transactionId}:rate:${r}`,
})),
elements: [
{
type: "static_select",
action_id: "rate",
placeholder: { type: "plain_text", text: "How was it?" },
options: RATINGS.map((r) => ({
text: { type: "plain_text", text: RATING_LABEL[r] },
value: `${s.transactionId}:rate:${r}`,
})),
},
],
},
{
type: "context",