Fix default-channel toggle in panel settings and protect the default channel#2563
Merged
Conversation
The shared Toggle component was written against radix-vue's old Switch API (:checked / @update:checked); reka-ui v2 renamed these to modelValue / update:modelValue, so clicking the switch never emitted toggle. Channels was the only consumer, making it impossible to set a channel as the default from the create dialog or edit page. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ting DeleteChannel now rejects the default channel (matching the row action that already hid its delete button) and UpdateChannel rejects unsetting the default flag — it moves by promoting another channel, so a store with channels always has a default. The panel edit page disables the delete button and default toggle accordingly (Toggle gains a disabled prop), the controller maps both failures to translated flash messages, and the new strings ship in all 16 locales. Co-Authored-By: Claude Fable 5 <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
QA of the panel's Settings → Channels section surfaced one bug and one gap:
Togglecomponent was written against radix-vue's old Switch API (:checked/@update:checked); reka-ui v2 renamed these tomodelValue/update:modelValue, so the switch never emitted anddefaultcould never be changed from the create dialog or edit page. Fixed the binding (publicon/toggleAPI unchanged) and added a component test so API drift fails loudly.Default-channel protection
DeleteChannelrejects the default channel (alongside the existing order-history guard).UpdateChannelrejects unsettingdefaulton the current default — the flag moves by promoting another channel, so a store with channels always has a default.Togglegains adisabledprop); the controller maps both failures to translated flash messages as a backstop.Note: the legacy Filament admin doesn't route channel deletes through these core actions, so it can still delete a default channel — wiring its
ChannelResourcethroughDeletesChannel/UpdatesChannelwould be a sensible follow-up.Testing
type-checkandbuildclean.🤖 Generated with Claude Code