Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENG-1565] Composable Explorer #2009

Open
Brendonovich opened this issue Jan 29, 2024 · 0 comments
Open

[ENG-1565] Composable Explorer #2009

Brendonovich opened this issue Jan 29, 2024 · 0 comments

Comments

@Brendonovich
Copy link
Contributor

The current explorer has a lot going for it, but adding functionality specific to different ExplorerItem types is getting daunting, plus our approach of merging all ExplorerItem types into one object with paths, locations, etc is bound to bite us later.

What I propose instead is that we put the explorer in its own package @sd/explorer, and rip out any usage of ExplorerItem both in @sd/interfaceand sd-core.
@sd/explorer would have no knowledge of how to render its items. Instead, it would manage layout rendering, selection state, data loading, and virtualisation.

To instruct the explorer on how to render an item type, we should make a config object for it containing a bunch of things:

  • Generic for the item type (eg. ExplorerFilePath, ExplorerLabel)
  • Components for how to render
  • Hooks defining how to fetch that particular item (mostly wrappers around useExplorer*Query, gonna be useful for column view since each column will need its own query).
  • Event handlers (click, focus, etc)
  • Context menu items

Using this approach we can easily modify the behaviour of individual item types in the explorer, while keeping the ability to render multiple types of items at once (by providing multiple configs at once).
It will also mean that the explorer only loads functionality that it actually needs, as opposed to considering functionality for all item types all the time.

From SyncLinear.com | ENG-1565

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

No branches or pull requests

1 participant