Add richer Slack plan unfurls#157
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-019f8b50-658b-71d5-85d5-34af2e717c46 Co-authored-by: Amp <amp@ampcode.com>
| from the `chat.unfurl` payload. In the app's **Basic Information → Display | ||
| Information** settings, use: | ||
|
|
||
| - **App name:** `CoPlan` |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f5ac4cef9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if preview.author_avatar_url.present? | ||
| elements << { type: "image", image_url: preview.author_avatar_url, alt_text: preview.author_name.to_s.first(2000) } |
There was a problem hiding this comment.
Guard Slack renderer against older engine previews
When coplan-slack is installed with an existing coplan-engine 0.4.x (still allowed by integrations/slack/coplan-slack.gemspec), CoPlan::LinkPreview objects do not expose the new author_avatar_url/author_name accessors, so rendering any unfurl raises NoMethodError before chat.unfurl is called. Either require the engine version that adds these fields or make these accesses backward-compatible.
Useful? React with 👍 / 👎.
Why
CoPlan link previews currently communicate the plan title and summary but lack the visual identity and author context that make an unfurl easy to recognize and trust in Slack.
What
Risk Assessment
Low — this only changes optional Slack unfurl rendering and extends the internal link-preview value object. Avatar URLs retain the existing HTTPS-only validation.
References
bundle exec rspec spec/services/link_previews_spec.rb spec/services/slack_renderer_spec.rb spec/jobs/slack_unfurl_job_spec.rb spec/requests/slack_events_spec.rb(17 examples, 0 failures)Generated with Amp