Skip to content

refactor: split card ui experiment into two #4707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

AmarTrebinjac
Copy link
Contributor

@AmarTrebinjac AmarTrebinjac commented Jul 17, 2025

Changes

Split post_ui_improvements into two experiments as requested here. New experiment is card_ui_buttons

Just color
just color

Buttons and color
buttons and color

Just buttons
just buttons

List is the same with either experiment enabled, just adds extra award button
with exp

Post actions with experiment
Screenshot 2025-07-17 at 16 20 44

Events

Did you introduce any new tracking events?

Experiment

Did you introduce any new experiments?

Manual Testing

Caution

Please make sure existing components are not breaking/affected by this PR

Jira ticket

MI-942

Preview domain

https://mi-942.preview.app.daily.dev

Copy link

vercel bot commented Jul 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
daily-webapp ✅ Ready (Inspect) Visit Preview Jul 21, 2025 4:39pm
1 Skipped Deployment
Name Status Preview Updated (UTC)
storybook ⬜️ Ignored (Inspect) Jul 21, 2025 4:39pm

@AmarTrebinjac AmarTrebinjac changed the title Mi 942 refactor: split card ui experiment into two Jul 17, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Button Styling Misapplied to Label

The "Copy" QuaternaryButton incorrectly applies config.copyButtonClassName to both its className and labelClassName props. This class contains styles intended for the button container, not the label text. As a result, the button's container styling is misapplied, and the previous hover:bg-overlay-float-water effect is lost. The copyButtonClassName should be applied to the buttonClassName prop.

packages/shared/src/components/post/PostActions.tsx#L330-L331

color={config.copyButtonColor}
labelClassName={config.copyButtonClassName}

Fix in CursorFix in Web


Comment bugbot run to trigger another review on this PR
Was this report helpful? Give feedback by reacting with 👍 or 👎

Copy link
Contributor

@rebelchris rebelchris left a comment

Choose a reason for hiding this comment

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

Just one remark on tripple definition.
Perhaps a hook witch switch of type would be better?

Comment on lines 57 to 65
// Experiment configuration
const config = {
useNewExperience: colorExp || buttonExp,
showAwardAction: buttonExp,
copyButtonColor: colorExp ? ButtonColor.Water : ButtonColor.Cabbage,
copyButtonClassName: colorExp ? 'hover:text-text-link' : undefined,
background: colorExp ? 'bg-transparent' : 'bg-surface-float',
iconSize: buttonExp ? IconSize.Medium : IconSize.Medium, // Keep Medium for list view
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we abstract this maybe in a helper function/hook?
It being re-used makes for potentially issues on cleanup/additional tests

Comment on lines 68 to 78
// Experiment configuration
const config = {
showVoteButtonsInActions: buttonExp || colorExp,
showVoteButtonsInCard: !buttonExp && !colorExp,
copyButtonColor: colorExp ? ButtonColor.Water : ButtonColor.Cabbage,
copyButtonClassName: colorExp
? 'group text-text-tertiary group-hover:text-text-link'
: 'btn-tertiary-cabbage',
cardBaseClassName:
'flex !flex-row gap-2 hover:border-border-subtlest-tertiary',
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah third one even?

@@ -43,7 +43,7 @@ export const FreeformGrid = forwardRef(function SharePostCard(
const containerRef = useRef<HTMLDivElement>();
const image = usePostImage(post);
const { title } = useSmartTitle(post);
const postUiExp = useFeature(featurePostUiImprovements);
const buttonExp = useFeature(featureCardUiButtons);
Copy link
Member

@sshanzel sshanzel Jul 18, 2025

Choose a reason for hiding this comment

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

Refactored the name unintentionally?

Edit: ah, it is not. The name was just a bit confusing.

@@ -50,7 +50,7 @@ export const ArticleGrid = forwardRef(function ArticleGrid(
}: PostCardProps,
ref: Ref<HTMLElement>,
): ReactElement {
const postUiExp = useFeature(featurePostUiImprovements);
const buttonExp = useFeature(featureCardUiButtons);
Copy link
Member

Choose a reason for hiding this comment

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

Same here with the variable name.

@@ -19,7 +19,7 @@ interface CollectionCardHeaderProps {
export const CollectionCardHeader = ({
post,
}: CollectionCardHeaderProps): ReactElement => {
const postUiExp = useFeature(featurePostUiImprovements);
const buttonExp = useFeature(featureCardUiButtons);
Copy link
Member

Choose a reason for hiding this comment

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

Same here.

Copy link
Member

@sshanzel sshanzel left a comment

Choose a reason for hiding this comment

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

Don't have much to add on top of Chris' comments.

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.

3 participants