fix: keep audience dropdown open and additive when sharing links#6299
Open
capJavert wants to merge 2 commits into
Open
fix: keep audience dropdown open and additive when sharing links#6299capJavert wants to merge 2 commits into
capJavert wants to merge 2 commits into
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
AudienceChipbehave like the checkbox — an additive toggle — and keeps the dropdown open across selections.Changes
AudienceChip.tsx: the row'sonSelectnow callsevent.preventDefault()(so Radix keeps the menu open on both mouse and keyboard selection) and routes through the existing additivetoggleOptioninstead of the replace-selectionselectSingleOption, which is removed.AudienceChip.spec.tsx: rewritten to cover additive add/remove, the 3-squad cap, the Everyone floor, and last-squad fallback. TheDropdownMenumock now mirrors the Radix contract (content renders only while open; selecting closes unlesspreventDefaultis called) so the "menu stays open" assertions genuinely guard the fix.Key decisions
toggleOption→toggleEveryone/toggleSquad, so the squad cap, Everyone-floor, and last-squad-fallback rules are unchanged.AudienceChip— no props added to the sharedDropdownMenuprimitive, 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