Refactor syncback process and improve code readability

- Reformatted the `SYNCBACK_SERVICES` list for better readability by aligning entries vertically.
- Simplified the `performSyncback` function by removing unnecessary Promise wrapping, enhancing clarity and maintainability.
- Updated the `NotConnectedPage` component to improve the structure of button elements and their associated tooltips.
- Refactored the `hydrate` and `matching` modules to streamline function calls and improve code organization.

These changes enhance the overall readability and maintainability of the syncback process and related components.
This commit is contained in:
Joe 2026-02-18 05:58:17 -06:00
parent 372a422b3d
commit 93ea0bdef6
16 changed files with 546 additions and 375 deletions

View file

@ -1350,6 +1350,13 @@ impl JobThreadContext {
Some(new_dir_path.join(file_name));
new_ref_segment =
Some(slugified_new_name.clone());
if patch_set.stage_ids.contains(&id) {
let old_init = dir_path.join(file_name);
pending_stage_paths
.retain(|p| *p != old_init);
pending_stage_paths
.push(new_dir_path.join(file_name));
}
let old_meta = grandparent.join(format!(
"{}.meta.json5",
dir_name
@ -1511,6 +1518,10 @@ impl JobThreadContext {
} else {
overridden_source_path = Some(new_path.clone());
new_ref_segment = Some(new_file_name.clone());
if patch_set.stage_ids.contains(&id) {
pending_stage_paths.retain(|p| *p != *path);
pending_stage_paths.push(new_path.clone());
}
let old_meta = parent
.join(format!("{}.meta.json5", old_base));
let new_meta = parent.join(format!(
@ -1689,6 +1700,11 @@ impl JobThreadContext {
);
} else {
overridden_source_path = Some(new_path.clone());
if patch_set.stage_ids.contains(&id) {
pending_stage_paths
.retain(|p| *p != actual_file);
pending_stage_paths.push(new_path.clone());
}
// For standalone files, the ref path
// segment changes with the extension.
// For init files, the directory name