Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(tags): sort applied tag chips alphabetically (#4625)

gbirmana4880826fe1b
diff --git a/js/app/packages/property/src/tags/useDocTags.ts b/js/app/packages/property/src/tags/useDocTags.ts
index 693233ee56..4e6abe5fca 100644
--- a/js/app/packages/property/src/tags/useDocTags.ts
+++ b/js/app/packages/property/src/tags/useDocTags.ts
@@ -27,6 +27,14 @@ function optionLabel(option: PropertyOptionResponse): string {
return option.value.type === 'string' ? option.value.value : '';
}
+function compareTags(a: ResolvedTag, b: ResolvedTag): number {
+ return (
+ a.label.localeCompare(b.label) ||
+ a.scope.localeCompare(b.scope) ||
+ a.optionId.localeCompare(b.optionId)
+ );
+}
+
function definitionDomain(
definition: PropertyDefinitionDetailResponse
): PropertyDefinitionDomain {
@@ -87,7 +95,7 @@ function createDocTags(
if (tag) resolved.push(tag);
}
}
- return resolved;
+ return resolved.sort(compareTags);
});
const isApplied = (optionId: string): boolean =>