Skip to content

feat(treecomponentsTools): Sort by name/id, Search by id/name, filter…#336

Merged
BotellaA merged 30 commits intonextfrom
feat/treecomponent_utils
Mar 26, 2026
Merged

feat(treecomponentsTools): Sort by name/id, Search by id/name, filter…#336
BotellaA merged 30 commits intonextfrom
feat/treecomponent_utils

Conversation

@MaxNumerique
Copy link
Contributor

… model_components

@JulienChampagnol
Copy link
Member

🎉 This PR is included in version 10.7.0-rc.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@MaxNumerique MaxNumerique requested review from BotellaA and JulienChampagnol and removed request for BotellaA March 25, 2026 09:12
@MaxNumerique MaxNumerique marked this pull request as ready for review March 25, 2026 09:27
@MaxNumerique
Copy link
Contributor Author

Capture.video.du.2026-03-25.10-31-06.mp4

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logique de la visibilité des model_components centralisé ici

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction d'une erreur Dexie quand on essayait d'accéder aux model_components :
DexieError2 {name: 'DataError', message: "Failed to execute 'bound' on 'IDBKeyRange': The pa… 'IDBKeyRange': The parameter is not a valid key.", inner: DataError: Failed to execute 'bound' on 'IDBKeyRange': The parameter is not a valid key.
at mak…}

Utilisation de compound indice comme [id+geode_id]

Comment on lines +17 to +25
const MESH_CONFIG = [
{ type: "Corner", group: "corners" },
{ type: "Line", group: "lines" },
{ type: "Surface", group: "surfaces" },
{ type: "Block", group: "blocks" },
];

const MESH_TYPES = MESH_CONFIG.map((config) => config.type);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mapping entre geode types (Corners) et leur groupe de style (Corner) un "s" en moin

Comment on lines +26 to +55
function buildSelection(components, modelStyle, stylesMap) {
const componentsByType = Object.fromEntries(MESH_TYPES.map((type) => [type, []]));
for (const component of components) {
if (componentsByType[component.type]) {
componentsByType[component.type].push(component);
}
}

const selection = [];
for (const { type, group } of MESH_CONFIG) {
const groupComponents = componentsByType[type];
const groupVisible = modelStyle[group]?.visibility ?? true;
let allVisible = true;

for (const component of groupComponents) {
const componentStyle = stylesMap[component.geode_id];
const isVisible = componentStyle?.visibility ?? groupVisible;
if (isVisible) {
selection.push(component.geode_id);
} else {
allVisible = false;
}
}
if (allVisible) {
selection.push(type);
}
}
return selection;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

groupe les model_components par type
Il a la responsabilité de dire si un component doit être visible ou pas pour le statut "sélectionné"

@MaxNumerique MaxNumerique requested a review from BotellaA March 25, 2026 16:09
@BotellaA BotellaA merged commit 3924b74 into next Mar 26, 2026
28 checks passed
@BotellaA BotellaA deleted the feat/treecomponent_utils branch March 26, 2026 09:53
@JulienChampagnol
Copy link
Member

🎉 This PR is included in version 10.9.0-rc.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@JulienChampagnol
Copy link
Member

🎉 This PR is included in version 10.9.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants