diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-01-02 17:22:00 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-01-02 17:22:00 +0800 |
| commit | e982cd090efc8786f32818cfd26b2c07dd801930 (patch) | |
| tree | e45598db53d84c00a8e439001994dfe20122e637 /crates/vcs_actions/src/actions | |
| parent | 46e5887d1829cf9aade17aa6e716fcb39ff29878 (diff) | |
Add ref sheet VFS mapping to LatestInfo
This adds a reverse mapping from virtual file IDs to their actual paths
in reference sheets, which is needed for proper file resolution during
operations that reference files by ID.
Diffstat (limited to 'crates/vcs_actions/src/actions')
| -rw-r--r-- | crates/vcs_actions/src/actions/local_actions.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/vcs_actions/src/actions/local_actions.rs b/crates/vcs_actions/src/actions/local_actions.rs index d3f718d..8799930 100644 --- a/crates/vcs_actions/src/actions/local_actions.rs +++ b/crates/vcs_actions/src/actions/local_actions.rs @@ -24,7 +24,7 @@ use vcs_data::{ vault_modified::sign_vault_modified, }, member::MemberId, - sheet::{SheetData, SheetName}, + sheet::{SheetData, SheetName, SheetPathBuf}, vault::{ config::VaultUuid, sheet_share::{Share, SheetShareId}, @@ -214,7 +214,12 @@ pub async fn update_to_latest_info_action( // RefSheet let ref_sheet_data = vault.sheet(&REF_SHEET_NAME.to_string()).await?.to_data(); - latest_info.ref_sheet_content = ref_sheet_data; + latest_info.ref_sheet_content = ref_sheet_data.clone(); + latest_info.ref_sheet_vfs_mapping = ref_sheet_data + .mapping() + .into_iter() + .map(|(path, file)| (file.id.clone(), path.clone())) + .collect::<HashMap<VirtualFileId, SheetPathBuf>>(); latest_info.reference_sheets = ref_sheets; // Members |
