Skip to content

fix: keep audience dropdown open and additive when sharing links#6299

Open
capJavert wants to merge 2 commits into
mainfrom
eng-1818-feedback-ux-issue-dropdown-resets-with-each-selection-when
Open

fix: keep audience dropdown open and additive when sharing links#6299
capJavert wants to merge 2 commits into
mainfrom
eng-1818-feedback-ux-issue-dropdown-resets-with-each-selection-when

Conversation

@capJavert

@capJavert capJavert commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What

When sharing a link on daily.dev, the audience picker (post to "Everyone" plus up to 3 squads) collapsed and reset to a single selection on every click, forcing users to re-open the dropdown for each squad.

This makes row selection in AudienceChip behave like the checkbox — an additive toggle — and keeps the dropdown open across selections.

Changes

  • AudienceChip.tsx: the row's onSelect now calls event.preventDefault() (so Radix keeps the menu open on both mouse and keyboard selection) and routes through the existing additive toggleOption instead of the replace-selection selectSingleOption, which is removed.
  • AudienceChip.spec.tsx: rewritten to cover additive add/remove, the 3-squad cap, the Everyone floor, and last-squad fallback. The DropdownMenu mock now mirrors the Radix contract (content renders only while open; selecting closes unless preventDefault is called) so the "menu stays open" assertions genuinely guard the fix.

Key decisions

  • Reused toggleOptiontoggleEveryone/toggleSquad, so the squad cap, Everyone-floor, and last-squad-fallback rules are unchanged.
  • Scoped entirely inside AudienceChip — no props added to the shared DropdownMenu primitive, no API/GraphQL/data-model changes.
  • Dismissal stays via click-outside / Escape / trigger click (no explicit "Done" button).

Closes ENG-1818


Created by Huginn 🐦‍⬛

Preview domain

https://eng-1818-feedback-ux-issue-dropd.preview.app.daily.dev

capJavert and others added 2 commits July 9, 2026 15:16
Clicking an audience row in the Share-a-link composer previously reset the
selection to just that item and collapsed the dropdown, forcing a re-open per
squad. Make row selection additive (toggle) and preventDefault in onSelect so
the menu stays open across selections, matching the checkbox behavior.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…harness

The DropdownMenu mock previously rendered content unconditionally and ignored
preventDefault, so the "menu stays open" assertions passed even if the menu
closed. Teach the mock the Radix contract (content renders only while open;
selecting closes unless onSelect calls preventDefault) so the tests actually
guard the fix. Drop the redundant stateful flag — always use the stateful
harness — and extract openMenu/clickOption helpers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 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 Jul 9, 2026 3:31pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
storybook Ignored Ignored Jul 9, 2026 3:31pm

Request Review

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.

1 participant