Skip to content

feat: comment-first action row experiment#6159

Open
tsahimatsliah wants to merge 9 commits into
mainfrom
experiment/comment-first-action-row
Open

feat: comment-first action row experiment#6159
tsahimatsliah wants to merge 9 commits into
mainfrom
experiment/comment-first-action-row

Conversation

@tsahimatsliah

@tsahimatsliah tsahimatsliah commented Jun 9, 2026

Copy link
Copy Markdown
Member

Summary

  • Reorder post action rows to put Comment first across five surfaces: feed cards (grid/list/signal), mobile floating bar, reader floating bar, reader rail, and the extension companion menu.
  • The post page (PostActions) keeps its existing action order — it only swaps the comment icon.
  • Swap the comment icon for the new Filled=yes/no design (DiscussIconV2) only inside those action rows; other DiscussIcon consumers (Reply, notifications, sidebar nav, analytics, etc.) are unchanged.
  • When the flag is on, the feed Reply button navigates to the post page with ?comment=true and NewComment auto-opens the composer on arrival (post-type guard dropped so it works for all post types). The feed-level onCommentClick is suppressed so the desktop post modal doesn't open alongside the link navigation.
  • Tooltip copy renamed Comment/CommentsReply on feed cards and reader bars, with matching spec selector updates.
  • Gated behind a single boolean GrowthBook flag comment_first_action (default false). Flag off = identical to today.

Recreated from #5966 on top of the latest main.

Test plan

  • Flag off (default): every action row renders today's order with the existing icon.
  • Flag on: feed cards / mobile bar / reader bars / companion menu render Comment first with the new icon; post page keeps its order with the new icon.
  • Flag on: feed Reply opens the post page with the comment composer focused (mobile keyboard surfaces).
  • Reply button on comment threads still uses the old icon.
  • Notifications, sidebar nav, analytics, customize-new-tab, LiveRooms still use the old icon.

🤖 Generated with Claude Code

Preview domain

https://experiment-comment-first-action.preview.app.daily.dev

Place Comment before Upvote/Downvote across feed cards, mobile floating
bar, reader bars, and the extension companion menu. Swap the comment
icon for a new Filled=yes/no design (DiscussIconV2) only inside those
action rows; other DiscussIcon consumers (Reply, notifications, sidebar)
are untouched. The post page (PostActions) only swaps the icon and keeps
its existing order.

When the flag is on, the feed Reply button navigates to the post page
with ?comment=true so NewComment auto-opens the composer on arrival; the
post-type guard in NewComment is dropped so this works for all post
types. Tooltip copy renamed "Comment"/"Comments" to "Reply" in feed
cards and reader bars, with matching spec selector updates.

All behavior gated behind a new boolean GrowthBook flag
`comment_first_action`, default off.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
daily-webapp Ready Ready Preview Jun 9, 2026 10:24am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
storybook Ignored Ignored Jun 9, 2026 10:24am

Request Review

When comment_first_action is on, the grid variant routes the comment
button through the link branch, which lacked the grid `typo-footnote`
size and used a different label padding than the upvote counter. That
made the comment number render larger and misaligned next to the smaller
upvote number. Share one variant-aware counter className and label
padding across the comment and upvote counters so every number in the
action row matches in size and alignment, as in production.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The counter's footnote line (18px) sat top-aligned inside its 20px (h-5)
box, so the numbers rode ~2px high relative to the action-row icons.
Add leading-5 to the shared counter className so the line fills the box
and the digits center optically against the icons. Animation-safe: the
scroll children are explicit h-5.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The previous leading-5 was silently overridden by typo-footnote, whose
line-height is emitted later in the same Tailwind utilities layer, so the
computed line stayed 18px and the digits kept riding high in the 20px
(h-5) box. Use !leading-5 to win the override. Verified in Storybook: the
digit ink center now sits within 0.25px of each icon's center.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Review fixes so the experiment isolates a single variable (comment
placement) and the control is byte-for-byte production:

- Gate the "Reply" tooltip/aria copy behind the flag. It was rendering
  for everyone, contaminating the control group. Control now keeps
  "Comment"/"Comments"; revert the 6 test selectors accordingly.
- Drop the feed link-navigation behavior: no more ?comment=true href,
  useCommentLink override, or nulled onClick. The comment button keeps
  the production click handler, so LogEvent.CommentsClick analytics and
  the post modal behave identically across both arms.
- Restore the NewComment Welcome/Poll guard removed for the dropped
  ?comment=true flow.
- Gate the reader-bar aria-label alongside the tooltip so they match.

Keeps (gated): comment-first ordering and the DiscussIconV2 swap. The
counter centering fix stays since it applies equally to both arms.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ButtonColor,
ButtonVariant,
} from '@dailydotdev/shared/src/components/buttons/Button';
import {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@tsahimatsliah do we really want to touch companion in this PR?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No, i didn't know he touched it

const commentButton = config.useCommentLink ? (
<LinkWithTooltip
tooltip={{ content: 'Comment' }}
tooltip={{ content: isCommentFirst ? 'Reply' : 'Comment' }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we experiment on the tooltip?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it's becuase I saw Nimrod changed this on his PR, but I can remove it and keep it like in the production

Per review feedback:
- Revert all CompanionMenu changes; the companion menu is out of scope
  for this experiment. Also drop the CompanionMenu strict-skip entry it
  required, restoring scripts/typecheck-strict-changed.js to baseline.
- Stop experimenting on the comment tooltip copy. Feed cards and reader
  bars keep the production "Comment"/"Comments" copy regardless of the
  flag. The experiment is now purely the comment-first ordering plus the
  DiscussIconV2 swap.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The test_webapp job failed on an async findBy* timeout in an unrelated
test (PostPage "should show source name"). Reproduced locally as
suite-level flakiness: different unrelated tests fail across runs and a
full clean pass occurs, with the changed code gated off by default.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

2 participants