Skip to content

Refactor SuggestionsController and Suggestions with clearer responsibility divide #3969

@amyngu

Description

@amyngu

Priorities and help requested (not applicable if asking question):

Are you willing to submit a PR to fix? Yes

Requested priority: Low

Products/sites affected: (if applicable): OWA

Describe the issue:

The suggestionsController and suggestions should be separate, but work well together. Possibly make SuggestionsController a react element whose render function only returns <Suggestions>. That way it can have a ref to suggestions, which in turn exposes an api for stuff like clicking the "search more" button. The main goal, in my mind, is to keep the "state manager" (SuggestionsController, maybe it should get renamed?) separate from the "view" (Suggestions). That way it's easy to mix and match the two and each one is clean, there isn't a conflating of state and form.

I think the BasePicker (or any component that uses suggestions/suggestionsController) has to deal with way to much knowledge of what the suggestions has. If we could create a clearer divide between the responsibilities between the two we might be able to remove some of the suggestion specific logic in the BasePicker for changing selection inside of Suggestions

Mentioned in #3929

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions