Improve local filetree view state and sidebar performance

This commit is contained in:
lix-2026
2026-05-27 11:31:12 +08:00
parent 58e2fdb5d8
commit 3ae33cc21d
56 changed files with 8614 additions and 461 deletions
+39 -3
View File
@@ -6,9 +6,10 @@ use crate::model::{
AppendAuditInput, AuditLogRecord, AuthSessionRecord, AuthenticatePasswordInput,
CreatePasswordIdentityInput, CreateSessionInput, CreateShareLinkInput, CreatedShareLink,
DirectoryGrantInput, DirectoryGrantLookup, DirectoryGrantRecord, OutboxEventInput,
OutboxEventRecord, ResolvedAccess, ResolvedAuthSession, ShareLinkRecord, SyncStateRecord,
UpsertAiPolicyInput, UpsertAiRuntimeRunInput, UpsertSyncStateInput, UpsertUserInput,
UserRecord, WorkspaceRecord,
OutboxEventRecord, ResolvedAccess, ResolvedAuthSession, ShareLinkRecord, SidebarShortcutRecord,
SyncStateRecord, UpsertAiPolicyInput, UpsertAiRuntimeRunInput, UpsertSidebarShortcutInput,
UpsertSyncStateInput, UpsertUserInput, UpsertUserUiPreferenceInput, UserRecord,
UserUiPreferenceRecord, WorkspaceRecord,
};
pub trait ControlPlaneStore: Send + Sync {
@@ -100,6 +101,41 @@ pub trait ControlPlaneStore: Send + Sync {
fn mark_outbox_delivered(&self, event_id: &str) -> Result<(), ControlPlaneError>;
fn upsert_sidebar_shortcut(
&self,
input: UpsertSidebarShortcutInput,
) -> Result<SidebarShortcutRecord, ControlPlaneError>;
fn list_sidebar_shortcuts(
&self,
user_id: &str,
workspace_id: &str,
) -> Result<Vec<SidebarShortcutRecord>, ControlPlaneError>;
fn list_sidebar_shortcuts_with_global_local(
&self,
user_id: &str,
workspace_id: &str,
) -> Result<Vec<SidebarShortcutRecord>, ControlPlaneError>;
fn delete_sidebar_shortcut(
&self,
user_id: &str,
shortcut_id: &str,
) -> Result<(), ControlPlaneError>;
fn upsert_user_ui_preference(
&self,
input: UpsertUserUiPreferenceInput,
) -> Result<UserUiPreferenceRecord, ControlPlaneError>;
fn list_user_ui_preferences(
&self,
user_id: &str,
workspace_id: Option<&str>,
source_kind: Option<&str>,
) -> Result<Vec<UserUiPreferenceRecord>, ControlPlaneError>;
fn upsert_ai_policy(
&self,
input: UpsertAiPolicyInput,