Skip to content

Conversation

@tbaxter-coveo
Copy link
Contributor

This migrates the handwritten documentation for atomic-facet-manager over to storybook documentation

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the documentation for atomic-facet-manager from handwritten documentation to Storybook's MDX format, aligning it with the documentation pattern used across other Atomic components.

Key Changes

  • Created new atomic-facet-manager.mdx file following the AtomicDocTemplate pattern
  • Documented the component's role in handling facet DOM manipulation and lifecycle
  • Included references to Stencil lifecycle documentation and custom component creation guidance

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 14 to 19
The `atomic-facet-manager` is designed to handle the removal and re-attachment of <a href="?path=/story/atomic-facet--default">facet</a> components
to the DOM.
This means that the [Stencil lifecycle](https://stenciljs.com/docs/component-lifecycle#component-lifecycle-methods) applies to the slotted facets.

If you <a href="https://docs.coveo.com/en/atomic/latest/usage/custom-web-components#custom-component-example">create your own custom facet component</a> and slot it inside of the `atomic-facet-manager`, it will have to be able to handle the Stencil reattachment lifecycle.
Alternately, you can place your custom component outside of the `atomic-facet-manager`, in which case the Stencil lifecycle won’t apply.
Copy link
Contributor

Choose a reason for hiding this comment

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

This documentation is actually outdated because we dont use stencil anymore. This is a doc that I made using copilot and I think it is more accurate and helpful. What do you think ?


The `atomic-facet-manager` is a component that manages facets by performing three key functions:

1. **Sorting facets** - Reorders facets based on the search response to show the most relevant facets first
2. **Managing visibility** - Controls which facets should be visible or hidden based on available values and dependencies
3. **Managing collapse state** - Automatically expands or collapses facets based on the `collapse-facets-after` property

## Usage

Place facets inside the `atomic-facet-manager` component within the "facets" section of your layout:

```html
<atomic-search-interface>
  ...
  <atomic-search-layout>
    <atomic-layout-section section="facets">
      <atomic-facet-manager collapse-facets-after="4">
        <atomic-facet field="author" label="Authors"></atomic-facet>
        <atomic-facet field="source" label="Source"></atomic-facet>
        <atomic-category-facet field="geographicalhierarchy" label="Geography"></atomic-category-facet>
        <atomic-numeric-facet field="ytviewcount" label="Views"></atomic-numeric-facet>
        <atomic-automatic-facet-generator desired-count="3"></atomic-automatic-facet-generator>
      </atomic-facet-manager>
    </atomic-layout-section>
  </atomic-search-layout>
</atomic-search-interface>

Collapse Behavior

The collapse-facets-after property controls how many facets remain expanded:

  • Default (4): First 4 facets are expanded, remaining facets are collapsed
  • 0: All facets are collapsed
  • -1: All facets remain expanded (useful when you want to control collapse state individually on each facet)

Dynamic Navigation Experience (DNE)

When using the facet manager, facets will automatically reorder based on their relevance to the current search query, providing an optimal filtering experience for users.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most of this does look like an improvement without a doubt, but I'm wary about the Collapse Behaviour section as that is directly duplicating information in the Attributes section of the component. We should be training users to reference that section for the props of the components.

I'm also going to massage the text for DNE and provide pertinent links to the docs site

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with the Collapse part 👍 . Good point

Updated documentation for the atomic-facet-manager component.
- `@coveo/atomic/lang`: exports the localization files used by Coveo Atomic.

## Getting Started

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@louis-bompart Just tagging you to review the updates to the README here.

Comment on lines +36 to 40
```sh
# ❌ Deprecated method
cd package/atomic
pnpm run dev
```
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove this as this just won't work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This 100% does work. Its how I've been running the storybook site until I was corrected (which is why i specifically included this)

[tbaxter:~/Documents/code/ui-kit/packages/atomic]$ pnpm run dev

> @coveo/atomic@3.39.1 dev /Users/tbaxter/Documents/code/ui-kit/packages/atomic
> node ./scripts/dev.mjs

🚀 Starting development servers...
⌛ Waiting for Storybook (4400) and Vite (3333)...
✅ Servers started! Watching for changes...
image

Copy link
Contributor

Choose a reason for hiding this comment

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

oh right my bad !

@alexprudhomme alexprudhomme changed the title feat: migrating facet manager documentation docs: migrating facet manager documentation Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants