summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/vcs_actions/src/actions/local_actions.rs9
-rw-r--r--crates/vcs_data/src/data/local/latest_info.rs10
2 files changed, 15 insertions, 4 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
diff --git a/crates/vcs_data/src/data/local/latest_info.rs b/crates/vcs_data/src/data/local/latest_info.rs
index 27409be..a2456fc 100644
--- a/crates/vcs_data/src/data/local/latest_info.rs
+++ b/crates/vcs_data/src/data/local/latest_info.rs
@@ -11,8 +11,11 @@ use crate::{
constants::{CLIENT_FILE_LATEST_INFO, CLIENT_FILE_LATEST_INFO_NOSET},
data::{
member::{Member, MemberId},
- sheet::{SheetData, SheetName},
- vault::sheet_share::{Share, SheetShareId},
+ sheet::{SheetData, SheetName, SheetPathBuf},
+ vault::{
+ sheet_share::{Share, SheetShareId},
+ virtual_file::VirtualFileId,
+ },
},
};
@@ -41,6 +44,9 @@ pub struct LatestInfo {
/// Reference sheet data, indicating what files I can get from the reference sheet
pub ref_sheet_content: SheetData,
+ /// Reverse mapping from virtual file IDs to actual paths in reference sheets
+ pub ref_sheet_vfs_mapping: HashMap<VirtualFileId, SheetPathBuf>,
+
/// Shares in my sheets, indicating which external merge requests have entries that I can view
pub shares_in_my_sheets: HashMap<SheetName, HashMap<SheetShareId, Share>>,