Feed cards have no edit option #136
Labels
No labels
bug
devops
duplicate
enhancement
good first issue
layout
next major release
next minor release
question
research
testing
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lvl0/fedi-feed-router#136
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Feed cards on
/feedsoffer only an active/inactive toggle. There is no way to change a feed's name, provider, language, or description after creation — the only recourse is deleting the feed and recreating it, which makes managing feeds painful.app/Livewire/Feeds.phpcurrently exposes onlytoggle(),openCreateModal(),closeCreateModal()andcreateFeed(). No edit path exists.Expected
Each feed card has an edit action that opens a modal prefilled with the feed's current values, allowing name, provider, language and description to be updated and saved.
Implementation reference
app/Livewire/Routes.phpalready implements this pattern —openEditModal()/closeEditModal()/updateRoute()with dedicatedediting*properties. Follow the same shape here.Validation should match
createFeed(), including the provider/language availability check that currently throwsInvalidArgumentExceptionand is surfaced as an error on the provider field.Acceptance criteria
Validation mirrors create, including the provider-not-available-for-language case— not applicable under the agreed scope. That check exists only to guard a provider/language change, which is now impossible by design. Name validation mirrors create (required|string|max:255).Scope decision (agreed before implementation)
Editable: name and description. Immutable: provider and language.
CreateFeedActionderivesfeeds.urlfrom the provider+language pair, andfeeds.urlcarries a unique constraint. Editing either field would re-point the feed at a different source, could collide on that unique index, would changetype(also provider-derived), and would leave already-fetched articles attached to a feed that no longer points where they came from.This matches the safer default that #137 "Channel cards have no edit option" proposes for the community/instance pairing.
Delivered in
41a1be7.What shipped
x-form-modalprefilled with the feed's name and descriptionFeeds::openEditModal()/closeEditModal()/updateFeed()witheditingFeedId/editName/editDescription, following theRoutes.phpshapenull, matchingcreateFeed()Scope
Name and description only — provider and language are immutable. Reasoning is in the ticket body above. The immutability is enforced in code, not just the UI:
updateFeed()builds an explicit two-key array, so a replayed Livewire request cannot reachurl,provider,language_idortype.FeedsTest::test_update_feed_leaves_the_source_identity_untouchedasserts all four survive an edit, so widening the scope later has to be deliberate.One deliberate divergence from the
Routes.phpreference:updateFeed()usesfindOrFail()whereRoutes::updateRoute()scopes a query-builderupdate().Routes' version silently no-ops if the row is gone; this one 404s.Pre-existing bug found and fixed
Feed::$descriptionwas documented@property stringwhile the column is->nullable(). PHPStan trusted the docblock, so two legitimateassertNull($feed->description)calls inCreateFeedActionTestwere flaggedmethod.impossibleType— and had been suppressed inphpstan-baseline.neonrather than fixed. Correcting the type tostring|nullmade that suppression stale and it was removed; the assertions now pass on their own merit. Worth checking other models for the same pattern — a baseline entry naming a model property is a signal the docblock is wrong.Verification
10 new feature tests: edit action present, prefill (including a null description prefilling blank), successful update, blank-to-null coercion, required and max-length validation, discard on close, no-op without an open modal, and source-identity immutability.
1153 tests / 2833 assertions green, Pint clean (338 files), PHPStan clean.
code-reviewerreturned no critical issues and requested no changes. Confirmed working in a browser.Note on tooling: this was built directly in the main checkout rather than via
/fullTicketFlow. That flow's worktree isolation does not work on this project —docker/dev/docker-compose.ymlbind-mounts the main checkout into the app container, so the gates silently lint and test the main tree regardless of the worktree path passed. Recorded inPLATFORM.md.