Skip to content

Put author details first in Slack unfurls - #158

Merged
HamptonMakes merged 1 commit into
mainfrom
hampton/slack-unfurl-author-first
Jul 23, 2026
Merged

Put author details first in Slack unfurls#158
HamptonMakes merged 1 commit into
mainfrom
hampton/slack-unfurl-author-first

Conversation

@HamptonMakes

@HamptonMakes HamptonMakes commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

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

  • Reorder metadata to author, plan type, then visibility
  • Keep missing plan types compact without empty separators

Risk Assessment

Low — presentation-only change to the Slack unfurl context row.

References

  • Follow-up to Add richer Slack plan unfurls #157
  • bundle exec rspec spec/services/slack_renderer_spec.rb spec/jobs/slack_unfurl_job_spec.rb (5 examples, 0 failures)
  • RuboCop passed for both touched files

Update Jul 23, 17:08: Handle author-only context from review feedback

  • Remove bare by Author metadata before rendering the author-first row
  • Added regression coverage; 6 focused examples pass

Generated with Amp

@HamptonMakes
HamptonMakes marked this pull request as ready for review July 22, 2026 21:12

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

@HamptonMakes
HamptonMakes force-pushed the hampton/slack-unfurl-author-first branch from 20490a6 to 3d5b129 Compare July 23, 2026 21:08
@HamptonMakes
HamptonMakes merged commit b29eefd into main Jul 23, 2026
4 checks passed
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.

1 participant