Skip to content

msgconv/from-slack: render canvas rich text elements - #156

Merged
iFixRobots merged 6 commits into
mainfrom
iFixRobots/canvas-rich-text-element
Nov 26, 2026
Merged

iFixRobots merged 6 commits into
mainfrom
iFixRobots/canvas-rich-text-element

Conversation

@iFixRobots

@iFixRobots iFixRobots commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

A pasted canvas link arrives as a canvas rich text element with only a file_id. It hit Unsupported Slack rich text section section_type_name=canvas, so a message that was only a canvas link was bridged with an empty body. Sometimes Slack later edits the message to add the canvas as a file, which then rendered with two leading blank lines.

The element now renders the same way as canvas files: the title (looked up with files.info) and an "Open the canvas in Slack" link to the permalink. When the canvas is also in files, it isn't rendered a second time. The element type comes from beeper/slackgo#14.

Before / after

Canvas link posted to a note-to-self DM, with main and this branch both logged in to the same Slack account:

main this branch
Message empty body 🎧️ Huddle notes: 10/17/26 with ma.tt and G
Open the canvas in Slack
After Slack's edit adds the canvas file \n\n**🎧️ Huddle notes…** unchanged, rendered once

View in Indent
Tag @indent to continue the conversation here.

@indent

indent Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Issues

All clear! No issues remaining. 🎉

1 issue already resolved
  • The canvas rich text case renders a bare slack.File{ID: e.FileID}, so every inline canvas triggers files.info, while makeTextPart skips the matching msg.Files entry that already has the title and permalink. If files.info fails (rate limits during backfill, unreadable canvas), the message shows only a bold "Canvas" with no link, where it previously rendered from msg.Files without an API call. (fixed by commit 8b340bc)
    Found by Indent Review Agent

CI Checks

All required CI checks passed on 5aadc71.

Review agents

Select any unchecked box below to run or rerun that agent.

Passed (1)
  • Indent Review Agent · No issues found
Full results

Indent Review Agent

  • Summary: No issues found
  • Last ran on commit: 5aadc71e
  • Latest result
    {
      "summary": "No issues found",
      "findings": []
    }

@iFixRobots
iFixRobots requested a review from tulir November 8, 2026 13:57
Comment thread pkg/msgconv/blocks.go Resolved
Comment thread pkg/msgconv/from-slack.go Outdated
}
}
}
renderedCanvases := make(map[string]struct{})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switch this to an exmaps.Set

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 5aadc71.

@iFixRobots
iFixRobots merged commit a951948 into main Nov 26, 2026
5 checks passed
@iFixRobots
iFixRobots deleted the iFixRobots/canvas-rich-text-element branch November 26, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants