Put author details first in Slack unfurls - #158
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20490a6391
ℹ️ 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".
|
|
||
| "📄 #{context}" | ||
| author = escape(preview.author_name) | ||
| details = context.delete_suffix(" · by #{author}") |
There was a problem hiding this comment.
Handle author-only context without duplicating it
For a published plan that has no plan_type, LinkPreviews.for_plan builds the context as just by Ada because the plan type is optional and Plans::Create defaults it to nil. This deletion only removes · by Ada, so that author-only context is left in details and the Slack row renders as *Ada* · by Ada instead of the intended compact author-first metadata. Handle the bare by #{author} suffix as well before joining.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Resolved by Amp 🤖 — the current head (3d5b129) chains .delete_suffix("by #{author}") after the · by variant, so an author-only context (by Ada, no plan type) collapses to just *Ada*. Covered by the "Untyped Plan" example in spec/services/slack_renderer_spec.rb.
Amp-Thread-ID: https://ampcode.com/threads/T-019f8b50-658b-71d5-85d5-34af2e717c46 Co-authored-by: Amp <amp@ampcode.com>
20490a6 to
3d5b129
Compare
Why
PR #157 merged before its final author-first metadata update reached the branch. This follow-up makes the unfurl match the reviewed visual preview.
What
Risk Assessment
Low — presentation-only change to the Slack unfurl context row.
References
bundle exec rspec spec/services/slack_renderer_spec.rb spec/jobs/slack_unfurl_job_spec.rb(5 examples, 0 failures)Update Jul 23, 17:08: Handle author-only context from review feedback
by Authormetadata before rendering the author-first rowGenerated with Amp