summaryrefslogtreecommitdiff
path: root/crates/vcs_data/src/data/local/latest_info.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-01-02 02:22:09 +0800
committer魏曹先生 <1992414357@qq.com>2026-01-02 02:22:09 +0800
commit46e5887d1829cf9aade17aa6e716fcb39ff29878 (patch)
treecb2fecd3fa2bca5b85055840ecf07603f56c73e3 /crates/vcs_data/src/data/local/latest_info.rs
parentf6a918848b499b9ec6fab8124d714d64af8afae2 (diff)
Add host mode and update sheet visibility model
- Add `using_host_mode` field to LocalConfig with getter/setter - Replace `my_sheets`/`other_sheets` with `visible_sheets`/`invisible_sheets` - Add `reference_sheets` set for host-owned sheets - Add `shares_in_my_sheets` map to track external merge requests - Update `use_sheet` to check `visible_sheets` instead of `my_sheets`
Diffstat (limited to 'crates/vcs_data/src/data/local/latest_info.rs')
-rw-r--r--crates/vcs_data/src/data/local/latest_info.rs22
1 files changed, 18 insertions, 4 deletions
diff --git a/crates/vcs_data/src/data/local/latest_info.rs b/crates/vcs_data/src/data/local/latest_info.rs
index ce45372..27409be 100644
--- a/crates/vcs_data/src/data/local/latest_info.rs
+++ b/crates/vcs_data/src/data/local/latest_info.rs
@@ -1,4 +1,5 @@
use std::{
+ collections::{HashMap, HashSet},
path::{Path, PathBuf},
time::SystemTime,
};
@@ -11,6 +12,7 @@ use crate::{
data::{
member::{Member, MemberId},
sheet::{SheetData, SheetName},
+ vault::sheet_share::{Share, SheetShareId},
},
};
@@ -23,13 +25,25 @@ const ACCOUNT: &str = "{account}";
#[cfg_file(path = CLIENT_FILE_LATEST_INFO_NOSET)]
pub struct LatestInfo {
// Sheets
- /// My sheets, indicating which sheets I can edit
- pub my_sheets: Vec<SheetName>,
- /// Other sheets, indicating which sheets I can export files to (these sheets are not readable to me)
- pub other_sheets: Vec<SheetInfo>,
+ /// Visible sheets,
+ /// indicating which sheets I can edit
+ pub visible_sheets: Vec<SheetName>,
+
+ /// Invisible sheets,
+ /// indicating which sheets I can export files to (these sheets are not readable to me)
+ pub invisible_sheets: Vec<SheetInfo>,
+
+ /// Reference sheets,
+ /// indicating sheets owned by the host, visible to everyone,
+ /// but only the host can modify or add mappings within them
+ pub reference_sheets: HashSet<SheetName>,
+
/// Reference sheet data, indicating what files I can get from the reference sheet
pub ref_sheet_content: SheetData,
+ /// 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>>,
+
/// Update instant
pub update_instant: Option<SystemTime>,