fix: clear + instant public/private toggle in the Muted list#14
Merged
Conversation
The Muted list showed a bare green Lock (private) / gray Unlock (public)
icon with no label or tooltip, and the icon showed the CURRENT state while
clicking did the OPPOSITE — genuinely ambiguous. Toggling was also janky on
a NIP-46 bunker: it ran fetch + decrypt + re-encrypt + sign behind a
blocking spinner, and silently no-oped (no feedback) if the private list
failed to decrypt.
- Labeled control: globe + 'Public' / lock + 'Private', with a tooltip
spelling out the action ('Only you can see this... click to make public').
Drops the unexplained green.
- Coalesced optimistic toggle: the label flips instantly on every click;
underneath we publish at most one mutation per settled target (extra
clicks while in flight just update the pending target), so rapid flipping
never fans out into a cascade of signed events. Reverts + relies on the
toast on failure.
- No silent no-op: the two switch functions now toast when the pubkey isn't
where expected (decrypt-empty), instead of returning quietly.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Deploying jank with
|
| Latest commit: |
e9c9938
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://df688029.jank-4ii.pages.dev |
| Branch Preview URL: | https://fix-mute-visibility-toggle.jank-4ii.pages.dev |
The coalesce loop's catch handler used `break`, which abandoned any newer target a user had queued while a failing publish was in flight (e.g. a slow NIP-46 bunker timing out the first switch). Drop the break: the provider already surfaced the failure toast, so let the loop honor the last click on its next iteration instead of silently dropping the user's most recent intent. The loop still exits cleanly when nothing is queued. Caught in code review. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
The public/private toggle on each user in the Muted column was ambiguous and janky. This makes it labeled, self-documenting, and instant.
Before: a bare green 🔒 Lock (private) / gray 🔓 Unlock (public) icon — no label, no tooltip, and the icon showed the current state while clicking did the opposite. On a NIP-46 bunker, toggling ran fetch → decrypt → re-encrypt → sign behind a blocking spinner, and silently no-op'd (no feedback at all) if the private list failed to decrypt.
After:
🌐 Public/🔒 Privatewith a tooltip spelling out the action ("Only you can see this mute. Click to make it public."). Globe reads far better than "unlock"; the unexplained green is gone.The data pathway itself was already correct (it moves the
p-tag between public/private); this fixes the clarity and the feedback.Ships as v26.14.1.
Test plan
PrivateorPublicwith the matching icon + a tooltip on hovernpm run buildclean, 867 tests pass, lint clean.🤖 Generated with Claude Code