client: Add CloudUserStore (#35370)

This PR adds a new `CloudUserStore` for storing information about the
user retrieved from Cloud instead of Collab.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-07-30 18:43:10 -04:00 committed by GitHub
parent 289f420504
commit bb1a7ccbba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 68 additions and 4 deletions

View file

@ -15,6 +15,7 @@ mod toast_layer;
mod toolbar;
mod workspace_settings;
use client::CloudUserStore;
pub use toast_layer::{ToastAction, ToastLayer, ToastView};
use anyhow::{Context as _, Result, anyhow};
@ -839,6 +840,7 @@ pub struct AppState {
pub languages: Arc<LanguageRegistry>,
pub client: Arc<Client>,
pub user_store: Entity<UserStore>,
pub cloud_user_store: Entity<CloudUserStore>,
pub workspace_store: Entity<WorkspaceStore>,
pub fs: Arc<dyn fs::Fs>,
pub build_window_options: fn(Option<Uuid>, &mut App) -> WindowOptions,
@ -911,6 +913,7 @@ impl AppState {
let client = Client::new(clock, http_client.clone(), cx);
let session = cx.new(|cx| AppSession::new(Session::test(), cx));
let user_store = cx.new(|cx| UserStore::new(client.clone(), cx));
let cloud_user_store = cx.new(|cx| CloudUserStore::new(client.cloud_client(), cx));
let workspace_store = cx.new(|cx| WorkspaceStore::new(client.clone(), cx));
theme::init(theme::LoadThemes::JustBase, cx);
@ -922,6 +925,7 @@ impl AppState {
fs,
languages,
user_store,
cloud_user_store,
workspace_store,
node_runtime: NodeRuntime::unavailable(),
build_window_options: |_, _| Default::default(),
@ -5689,6 +5693,7 @@ impl Workspace {
let client = project.read(cx).client();
let user_store = project.read(cx).user_store();
let cloud_user_store = cx.new(|cx| CloudUserStore::new(client.cloud_client(), cx));
let workspace_store = cx.new(|cx| WorkspaceStore::new(client.clone(), cx));
let session = cx.new(|cx| AppSession::new(Session::test(), cx));
@ -5696,6 +5701,7 @@ impl Workspace {
let app_state = Arc::new(AppState {
languages: project.read(cx).languages().clone(),
workspace_store,
cloud_user_store,
client,
user_store,
fs: project.read(cx).fs().clone(),