Skip to content

[FIX]: PR Actions buttons open the PR view instead of posting the command - #159

Open
austin-rt wants to merge 3 commits into
RocketChat:mainfrom
austin-rt:fix/pr-link-actions
Open

austin-rt wants to merge 3 commits into
RocketChat:mainfrom
austin-rt:fix/pr-link-actions

Conversation

@austin-rt

@austin-rt austin-rt commented Oct 2, 2026 •

Copy link
Copy Markdown

Issue(s)

Closes #158
Related to #135

Acceptance Criteria fulfillment

  • Pull request alerts carry a PR Actions button that opens the PR view in one click
  • PR Actions on pull request links in messages puts the command in the message box instead of posting it
  • Separate settings turn off the alert button and the link button, both on by default
  • The app's own alerts no longer get the link button as well
  • Pull request alerts also carry a View on GitHub button

Proposed changes (including videos or screenshots)

Rocket.Chat 8.x only runs a slash command typed in the composer. A legacy message attachment button sends its text through the send flow without allowing slash commands, so the PR Actions button posted /github owner/repo pulls N to the room.

  • endpoints/githubEndpoints.ts: pull request alerts get a UIKit actions block with a PR Actions button. It uses the existing VIEW_GITHUB_SEARCH_RESULT_PR_CHANGES block action, which opens the PR view directly. A View on GitHub link button sits next to it.
  • handlers/GithubPRlinkHandler.ts: the button on links in user messages sets msg_processing_type: RespondWithMessage, which puts the command in the composer so Enter runs it. An app cannot add UIKit blocks to another user's message, so a link button cannot open the view directly.
  • GithubApp.ts: messages sent by the app are skipped, so alerts do not get both buttons.
  • settings/settings.ts, i18n/en.json: one boolean setting per button, on by default.

The PR view the button opens, shown here for #144:

PR view opened from the PR Actions button

Further comments

…mand

Rocket.Chat only runs a slash command typed in the composer, so the
legacy button on pull request links posted /github owner/repo pulls N
to the room as a plain message.

- Pull request alerts from the webhook now carry a UIKit PR Actions
  button that opens the PR view in one click.
- Pull request links in user messages keep a legacy button, now with
  respondWithMessage, which puts the command in the composer instead
  of posting it. The app's own alerts no longer get this button.
- A new setting turns both buttons off.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@austin-rt
austin-rt marked this pull request as ready for review October 2, 2026 17:46
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.

PR Actions button posts the slash command as a message instead of running it

2 participants