exploratory-review(segment-membership-ui): proposed fixes for PR #7467 -#7475
exploratory-review(segment-membership-ui): proposed fixes for PR #7467 -#7475talissoncosta wants to merge 1 commit into
Conversation
Apply the design/code review fixes raised on khvn26's #7467: - Drop the private Chip wrapper in SegmentMembershipBadge; use the existing .chip chip--xs SCSS pattern inline (matches BetaFlag, SegmentOverrides, FeatureHistory call sites). - Add a chip--filled modifier in _chip.scss for the borderless filled variant. Removes the need for inline style overrides on the badge. - Restore !important on .chip { align-self } — was only removed to let the inline override win, no longer needed. - Split into two distinct components: SegmentMembershipTotalBadge (row chip) and SegmentMembershipTabCount (muted text count in tab label). Fixes the purple-on-purple contrast issue on the active Identities tab, and removes the heavy chip from a context where a tab badge convention is just a count. - Drop the ~Xs ago suffix from the row badge. It froze on render and duplicated the Last synced: … line in the Identities tab. The full timestamp is the correct surface for freshness. - Remove the `compact` prop — semantically only dropped the noun and not the relative time; misleading and no longer needed. - Rename SegmentMembershipEnvBadge → SegmentMembershipEnvCount and switch from filled chip to muted right-aligned text in the env dropdown options. Inverts the visual hierarchy back so the env name is primary and the count is secondary metadata. - Replace ProjectStore.getEnvs() in CreateSegmentUsersTabContent with useGetEnvironmentsQuery — same data via RTK Query (already cached by EnvironmentSelect), no extra request. Drops the dead-code ProjectStore fallback in SegmentMembershipEnvBadge too. - Add justify-content-between to the env option row so per-env counts right-align to a column — fixes alignment when env names vary in length. E2E selectors (data-test attributes) preserved so the existing spec keeps passing without modification. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Docker builds report
|
|
Closing — opened prematurely without confirmation. Will reopen after Talisson validates the proposed changes locally. |
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Failed testsfirefox › tests/segment-membership-test.pw.ts › Segment membership badges render in list, tab, and env select @oss Details
Failed testsfirefox › tests/segment-membership-test.pw.ts › Segment membership badges render in list, tab, and env select @oss |
Visual Regression16 screenshots compared. See report for details. |
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Stacked on top of #7467 (
feat/segment-membership-counts-ui). Proposed fixes for the review concerns raised on that PR — opening as a PR so the diff is reviewable side-by-side. Cherry-pick what resonates, drop what doesn't.Design-system / SCSS
!importanton.chip { align-self }. Was removed in feat(Segment membership inspection PoC): Surface identity counts in segments UI #7467 only so the new badge's inlinealignSelf: 'center'could win. Reverting it avoids a global regression risk for every other.chipconsumer (Feature-Specificon the segment row,BetaFlag,FeatureHistory,SegmentOverrides, …)..chip--filledmodifier for the borderless filled variant. Removes the need for inlinestyle={{ border: 'none', alignSelf: 'center', verticalAlign: 'middle' }}overrides on the badge.Component shape
<Chip>wrapper inSegmentMembershipBadge.tsx. The codebase already uses.chip chip--xsdirectly with bg utility classes everywhere else — half-introducing a private wrapper inside a feature file was the worst of both worlds (not extracted tocomponents/base/, but also no longer matching the inline pattern). Now the badge composes.chip chip--xs chip--filledinline like its neighbours.compactprop:SegmentMembershipTotalBadge— filled chip on the segments-list row (unchanged appearance besides losing~ago).SegmentMembershipTabCount— muted(71)count next to the Identities tab label. Fixes the purple-on-purple contrast issue on the active Identities tab, and matches the visual weight of a tab badge convention.compactprop. It only dropped the noun, not the~ago, so the "compact" tab badge still rendered as71 ~23s ago— not compact, and misleading-named.Behaviour
shortAgo/~Xs ago. It froze on render (Date.now()evaluated once), and duplicated the preciseLast synced: 7th May 2026 14:23:01line that already lives below the env select in the Identities tab. The full timestamp is the right surface for freshness.ProjectStore.getEnvs()→useGetEnvironmentsQueryinCreateSegmentUsersTabContent.tsx.EnvironmentSelectalready uses the same hook, so RTK Query caches the result — no extra request. Also drops the dead-codeProjectStorefallback inSegmentMembershipEnvBadge(the only caller always passedenvironment).Env dropdown options
justify-content-between flex-grow-1on the option row. Fixes the visual misalignment when env names vary in length (thetrow in the screenshot vs.Development).SegmentMembershipEnvBadge→SegmentMembershipEnvCount— switches from a filled chip to muted right-aligned text. Inverts the visual hierarchy so the env name is the primary read and the count is secondary metadata. Matches the convention used elsewhere for in-option counts.Not addressed (out of scope, worth a follow-up discussion)
Across N envs), scope to one env, or accept-and-document. Asking on feat(Segment membership inspection PoC): Surface identity counts in segments UI #7467 directly.membershipsomits an env entirely, no chip renders — but the user can't distinguish "0 identities" from "not yet synced". Probably wants a backend contract decision (always emit a row per env withcount: 0?).E2E test
The existing
e2e/tests/segment-membership-test.pw.tsselectors ([data-test="segment-membership-total"],[data-test="segment-membership-${api_key}"]) are preserved so the spec keeps passing without modification.How did you test this code?
Manually with a local
transformResponsemock injecting syntheticmembershipsinto the segments responses (since the backend PR isn't merged yet). Verified:~agosuffix.(N)count, readable on both inactive (light) and active (purple) tab states.Last synced:line populates with the precise timestamp.1 identity) when count is 1.Existing Playwright spec (
segment-membership-test.pw.ts) was inspected to confirmdata-testselectors still match — not re-run because it requires the seeded segments project.