Skip to content

Conversation

@rchlfryn
Copy link
Collaborator

@rchlfryn rchlfryn commented Jan 26, 2026

Description

This PR cleans up for we use Button and CMSLink components. We currently use buttons in 3 different ways:

  1. CMSLink - a guided way for a user to choose a link form a collection. Looks like a button but is rendered as an a tag
  2. Link + Button - a link to another page or action
  3. Button - not a link but performs an action

From the linked issue:

This issue should consider the best approach to using links with button styling that also capture events.

I assume the second part of this is referring to Posthog events. All link clicks are autocaptured by posthog.

Related Issues

Resolves #685

Key Changes

  • Add ButtonLink component since we were repeating the components pattern
  • Removed unused button variants destructive and link
  • Updated EventTable and EventPreview to use proper Button component instead of incorrectly used CMSLink
  • Adds clearIrrelevantLinkValues to linkField
  • Refactors linkToPageOrPost to linkField
    • Needed to keep linkToPageOrPost for quickLinks config since the type is array instead of group
  • Clean up defaultLexical url validation
  • Updated coding guide

How to test

There should be no visual differences

Future enhancements / Questions

We could use linkField in navLink, since the configs are identical. Using linkField will change newTab to be the second column which will cause a migration that will create a new table and drop the old one which seems invasive for the change. Do we want to do this?

@github-actions
Copy link

Preview deployment: https://link-cleanup.preview.avy-fx.org

admin: {
hideGutter: true,
style: {
marginBottom: '0',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did not copy this over as it is not necessary.

@rchlfryn rchlfryn self-assigned this Jan 27, 2026
@rchlfryn rchlfryn requested a review from busbyk January 27, 2026 02:35
@rchlfryn rchlfryn marked this pull request as ready for review January 27, 2026 02:35
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.

Guidance on usage of CMSLink vs. Link + Button with clickWithCapture

2 participants