mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-24 06:34:09 +00:00
Update reflection database and enhance deduplication processes
- Updated the `rbx-dom` subproject to the latest commit for improved functionality. - Enhanced the `/audit` command documentation to emphasize the importance of entering Plan mode before executing any actions. - Improved the `atlas-dedup.mdc` file by adding details on user-initiated renames and ensuring ref path integrity during deduplication. - Cleared out deprecated material color entries in `allValues.json` for better clarity. - Updated `database.json` to reflect new properties and classes, including `AssetQualityService` and `BaseCoreGuiConfiguration`. - Introduced new scripts for updating the reflection database, streamlining the process for generating necessary files. These changes improve the overall functionality and maintainability of the project, ensuring better handling of deduplication and reflection updates.
This commit is contained in:
parent
85787f3452
commit
0afe6be441
12 changed files with 3220 additions and 283 deletions
|
|
@ -385,12 +385,22 @@ fn compute_change_count(
|
|||
/// Count own property diffs between a snapshot and a tree instance.
|
||||
/// Each differing property = +1. Tags and Attributes counted granularly.
|
||||
/// Children count diff = +1.
|
||||
///
|
||||
/// Syncback strips default-valued properties from model/meta files, so
|
||||
/// filesystem snapshots may omit properties that the tree (populated from
|
||||
/// Studio via two-way sync) has at their class defaults. To avoid inflating
|
||||
/// match costs with phantom diffs, properties present on only one side are
|
||||
/// skipped when their value matches the class default.
|
||||
fn count_own_diffs(snap: &InstanceSnapshot, inst: &InstanceWithMeta) -> u32 {
|
||||
let mut cost: u32 = 0;
|
||||
|
||||
let snap_props = &snap.properties;
|
||||
let inst_props = inst.properties();
|
||||
|
||||
let class_data = rbx_reflection_database::get()
|
||||
.ok()
|
||||
.and_then(|db| db.classes.get(snap.class_name.as_str()));
|
||||
|
||||
// Properties present on the snapshot side
|
||||
for (key, snap_val) in snap_props.iter() {
|
||||
if let Some(inst_val) = inst_props.get(key) {
|
||||
|
|
@ -398,14 +408,24 @@ fn count_own_diffs(snap: &InstanceSnapshot, inst: &InstanceWithMeta) -> u32 {
|
|||
cost += 1;
|
||||
}
|
||||
} else {
|
||||
cost += 1; // Missing on tree side
|
||||
let is_default = class_data
|
||||
.and_then(|cd| cd.default_properties.get(key.as_str()))
|
||||
.is_some_and(|default| variant_eq(snap_val, default));
|
||||
if !is_default {
|
||||
cost += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Properties present only on the tree side
|
||||
for key in inst_props.keys() {
|
||||
for (key, inst_val) in inst_props.iter() {
|
||||
if !snap_props.contains_key(key) {
|
||||
cost += 1;
|
||||
let is_default = class_data
|
||||
.and_then(|cd| cd.default_properties.get(key.as_str()))
|
||||
.is_some_and(|default| variant_eq(inst_val, default));
|
||||
if !is_default {
|
||||
cost += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ fn compute_children_patches(
|
|||
let instance_children = instance.children().to_vec();
|
||||
let snapshot_children = take(&mut snapshot.children);
|
||||
|
||||
// Use the 3-pass matching algorithm instead of greedy name+class.
|
||||
// Use the recursive change-count scoring + greedy assignment matching algorithm.
|
||||
let match_result = match_forward(snapshot_children, &instance_children, tree);
|
||||
|
||||
// Matched pairs: recursively compute patches.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue