Summary:
- Update menus and shortcuts correclt when accounts change or focused
accounts change
- Move menu logic into SidebarCommands to remove duplicated logic
- Make `Window` menu also contain checkboxes
Test Plan: - Manual
Reviewers: evan, bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D2534
- Ensures that it displays the correct set of sidebar items even when
the perspective changes
- Also sets up hotkeys to switch currently focused accounts
- Creates OutlineView generic component and uses that instead of custom
code
- Refactors AccountSidebarStore:
- Split the generation of the state tree into smaller functions
- Adds different types of account sidebar items and sections, which contain
logic and props necessary to be rendered as OutlineViewItems, and
removes that logic from the store
- Removes WorkspaceStore.SidebarItem and removes the ability to register
new sidebar items. If people want to add something to the sidebar they
can just register a Component via the component registry and use the
OutlineView component
- Removes the DraftListSidebarItem, which was basically duplicated code
for an item but with a different data source. This is now handled
generically by the account sidebar by rendering OutlineViewItems with
different props and handlers
- Clean ups here and there:
- TODO
- Add AccountSwitcher
- Revisit calculation and generation of the state tree. Should the
parent store contain and update the entire state all the time.
Should separate items inside the tree have their own data sources?
- This would avoid having the AccountSidebarStore listen to a bunch of
different other stores, and the specific logic wold be contained
inside each item type.
2016-01-15 16:55:21 -08:00
Renamed from internal_packages/account-sidebar/lib/main.cjsx (Browse further)