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
Resolves #753

Key Changes

  • Add ButtonLink component and consolidates CMSLink to ButtonLink 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

Migration

Rename button_appearance to button_variant

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

@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
@github-actions
Copy link

github-actions bot commented Jan 28, 2026

Migration Safety Check

Found 8 potential issues:

20260128_213937_rename_appearance_to_variant.ts

Warning (line 6): ALTER keyword detected - review for data loss

sql`ALTER TABLE \`home_pages_blocks_link_preview_cards\` RENAME COLUMN "button_appearance" TO "button_variant";`,

Warning (line 6): RENAME keyword detected - review for data loss

sql`ALTER TABLE \`home_pages_blocks_link_preview_cards\` RENAME COLUMN "button_appearance" TO "button_variant";`,

Warning (line 9): ALTER keyword detected - review for data loss

sql`ALTER TABLE \`_home_pages_v_blocks_link_preview_cards\` RENAME COLUMN "button_appearance" TO "button_variant";`,

Warning (line 9): RENAME keyword detected - review for data loss

sql`ALTER TABLE \`_home_pages_v_blocks_link_preview_cards\` RENAME COLUMN "button_appearance" TO "button_variant";`,

Warning (line 12): ALTER keyword detected - review for data loss

sql`ALTER TABLE \`pages_blocks_link_preview_cards\` RENAME COLUMN "button_appearance" TO "button_variant";`,

Warning (line 12): RENAME keyword detected - review for data loss

sql`ALTER TABLE \`pages_blocks_link_preview_cards\` RENAME COLUMN "button_appearance" TO "button_variant";`,

Warning (line 15): ALTER keyword detected - review for data loss

sql`ALTER TABLE \`_pages_v_blocks_link_preview_cards\` RENAME COLUMN "button_appearance" TO "button_variant";`,

Warning (line 15): RENAME keyword detected - review for data loss

sql`ALTER TABLE \`_pages_v_blocks_link_preview_cards\` RENAME COLUMN "button_appearance" TO "button_variant";`,

Review these patterns and add backup/restore logic if needed. See docs/migration-safety.md for guidance.

rchlfryn and others added 3 commits January 28, 2026 14:00
…ig variants (#900)

Co-authored-by: rchlfryn <rachelafryan@gmail.com>
@rchlfryn rchlfryn added this pull request to the merge queue Jan 30, 2026
Merged via the queue into main with commit 3254cba Jan 30, 2026
8 checks passed
@rchlfryn rchlfryn deleted the link-cleanup branch January 30, 2026 23:48
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.

Button block doesn't have a thumbnail Guidance on usage of CMSLink vs. Link + Button with clickWithCapture

3 participants