Skip to content

Conversation

@Nayte91
Copy link

@Nayte91 Nayte91 commented Dec 13, 2025

Q A
Bug fix? no
New feature? no
Deprecations? no
Documentation? yes
License MIT

WHAT

New demo where we use Live Components to address a common web use case: a facet menu to filter articles, and another Live Component-powered results section where articles are filtered in real time. Bonus: the URL is also updated in real time when facet filters change, ensuring a correct shareable link for the user.

WHY

I believe this is a common use case, and using Live Components for it is relevant. Providing real solutions for real problems on the website offers a lot of value.

DRAFT

Still to do:

  1. Ensure the design is the best possible
  2. Use the latest Live Component URL features for a top-notch implementation
  3. Add more filters for animalz?

@carsonbot carsonbot added Documentation Improvements or additions to documentation Site ux.symfony.com Status: Needs Review Needs to be reviewed labels Dec 13, 2025
@Nayte91 Nayte91 force-pushed the docs/demo-facet-menu branch 3 times, most recently from 779a153 to 7afca0e Compare December 13, 2025 22:53
Copy link
Contributor

@94noni 94noni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some review passing by
I think its a good addition as you mentioned in the PR doc :)

) {
}

#[LiveListener('facetSetted')]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#[LiveListener('facetSetted')]
#[LiveListener('Animalz.FacetMenu.facetSetted')]

as per above suggestion if accepted

public function emitChange(): void
{
$this->nullTheProps();
$this->emit('facetSetted', $this->convertPropertiesToAssociativeArray());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$this->emit('facetSetted', $this->convertPropertiesToAssociativeArray());
$this->emit('Animalz.FacetMenu.facetSetted', $this->convertPropertiesToAssociativeArray());

perhaps be more precise to locate/listen particular event ?

@Nayte91 Nayte91 force-pushed the docs/demo-facet-menu branch from ac93e52 to 4ada80c Compare December 17, 2025 18:14
@Nayte91 Nayte91 requested a review from Kocal as a code owner December 17, 2025 18:14
- Use PascalCase for enum values (Normal instead of NORMAL)
- Use named arguments in Animalz constructor
- Cache this.results in template variable to avoid double call
@Nayte91 Nayte91 force-pushed the docs/demo-facet-menu branch from 4ada80c to 257b970 Compare December 18, 2025 13:37
@smnandre
Copy link
Member

@Nayte91 i'm not sure how to do this now... should i push the changes I made directly there ?
... or I think I can open a PR on your PR for you to see them and merge (or not) in your branch

(disclosure: we discussed this PR on Slack for some time with Nayte and I started the other day some changes / moving things around)

TL;DR; some code clean, simplification, pushed your design a bit in the spirit of what we have already, and anticipate the fact this demo would benefit from alternative choices...


Facet search, "grid of products" is probably what I'm asked the most, about Symfony UX...

And I can say there is no "one-for-all" solution.

I really do like your demo and we will happily publish it.
But after* that I will publish two other ways / alternative "solutions", that are also relevant (even if one is a bit .. original 😅 ) Point is I would not like users to feel "ho, this is THE way". This is why i'm trying to anticipate the reuse of HTML/components, a bit as I did with the scroll.

(but you know how I'm really not able to say right now if "after that" is in two days or two years...)

@smnandre smnandre self-assigned this Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements or additions to documentation Site ux.symfony.com Status: Needs Review Needs to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants