Skip to content

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

Open
capJavert wants to merge 4 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 4 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 / creating a post on daily.dev, the audience picker (post to "Everyone" plus up to 3 squads) reset the selection on every click, forcing users to re-pick each squad.

The audience picker is implemented twice, split by viewport + experiment:

  • AudienceChip inside SmartComposerModal — used on desktop when the featureSmartComposer experiment is on. Its dropdown also collapsed on each click.
  • MultipleSourceSelect on the /squads/create page — the fallback CreatePostButton navigates to on mobile/tablet (and whenever the experiment is off). Its row click reset the selection to a single item.

This PR fixes both so row selection is an additive toggle.

Changes

  • AudienceChip.tsx: row onSelect now calls event.preventDefault() (keeps the Radix menu open for mouse + keyboard) and routes through the additive toggleOption instead of the replace-selection selectSingleOption (removed).
  • MultipleSourceSelect.tsx: row onRowClick now calls the existing additive toggleSource instead of selectSingleSource (removed). The popover already stayed open (it has an explicit Done button), so only the reset needed fixing.
  • Tests: new MultipleSourceSelect.spec.tsx and rewritten AudienceChip.spec.tsx cover additive add/remove, the 3-squad cap, and (for AudienceChip) the Everyone floor + menu-stays-open contract.
  • AGENTS.md: documents the two-picker split so future audience-UX changes touch both.
  • scripts/typecheck-strict-changed.js: MultipleSourceSelect.tsx added to the strict skip list — it has pre-existing strict-null violations on unrelated lines (verified identical before/after this change); cleanup deferred per the existing convention.

Key decisions

  • Reused the existing toggleOption/toggleSource logic, so the squad cap and floor rules are unchanged.
  • Both pickers intentionally share the same "row click is an additive toggle" model; kept the checkbox as the explicit toggle control on both.
  • No API / GraphQL / data-model changes.

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 10, 2026 9:44am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
storybook Ignored Ignored Jul 10, 2026 9:44am

Request Review

The share/create audience picker is implemented twice. Desktop with the
SmartComposer experiment uses AudienceChip (already fixed); mobile/tablet — and
anyone with the experiment off — falls back via CreatePostButton to the
/squads/create page, which uses MultipleSourceSelect. There, a row click called
selectSingleSource and reset the whole selection, so the reported "dropdown
resets on every selection" persisted on mobile.

Route row clicks through the existing additive toggleSource (matching the
checkbox and AudienceChip), and remove the now-dead selectSingleSource.

MultipleSourceSelect has pre-existing strict-null violations on unrelated lines
(auth user/squad optionality); it is added to the strict migration skip list
per the established convention, to be cleaned up separately.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
On mobile /squads/create the audience picker still closed on each selection.
The row was a custom focusable role="button" that called preventDefault/
stopPropagation to drive selection, suppressing the native <label> click that
the shared Checkbox already provides. Inside the Radix Popover, that extra
focusable element plus the prevented default interferes with the dismissable
layer / focus handling and collapses the popover on touch.

That custom layer only existed to make row click a single-select (#5057);
now that a row is an additive toggle, delete it and let the native
<label>/checkbox handle the click. Simpler, accessible (native keyboard
toggle), and the popover stays open while selecting.

Co-Authored-By: Claude Opus 4.8 (1M context) <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.

1 participant