Repair an issue with localStorage in the multi-repo switcher.
When the localStorage value doesn't match any of the loaded repos, we fall back to the first option in the list. Unfortunately, this is causing a bug where changing the filter option will unselect the first option. This shouldn't happen, as toggling on one repo should never toggle off another. The issue here is that the list of selected keys is not in sync with the list of options.
To repair this, check the list of matching options immediately upon creating the hook state. In the case where there are no matches, choose the key for the first loaded option.
This requires that state is not determined until the workspace query is finished loading. To that end, split up the component so that the hook only runs when options have loaded.