Skip to content

Commit 304fbea

Browse files
feat: sort and space cross-reference lists on /content/detail
The Cross References widget renders comma-separated identifier lists (RefSeq, ENSEMBL, COSMIC, ...). Two issues on the wider website detail card: the lists came back unsorted and the commas were spaced at 2px which made the rows visually run together. - Sort each database group's identifiers naturally in CrossReferences- Component.crossReferences (localeCompare with numeric: true so RefSeq_2 sorts before RefSeq_10). - detail.component.scss overrides ::ng-deep cr-cross-references composition-container with a roomier line-height (1.7) and 8px comma margins. The pathway-browser's compact 2px defaults are unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 911eee9 commit 304fbea

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

projects/pathway-browser/src/app/details/common/cross-references/cross-references.component.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,16 @@ export class CrossReferencesComponent {
2020

2121
if (this._crossReferences().length == 0) return new Map<string, DatabaseIdentifier[]>();
2222
const crossRefs = [...this._crossReferences()];
23-
return this.entity.getGroupedData(crossRefs, ref => ref.databaseName);
23+
const grouped = this.entity.getGroupedData(crossRefs, ref => ref.databaseName);
24+
// Sort the identifiers within each database group so e.g. RefSeq IDs
25+
// come out in stable, human-friendly order. numeric: true keeps
26+
// "NM_000546.5" before "NM_000546.10" instead of lexicographic.
27+
for (const list of grouped.values()) {
28+
list.sort((a, b) =>
29+
a.identifier.localeCompare(b.identifier, undefined, { numeric: true, sensitivity: 'base' }),
30+
);
31+
}
32+
return grouped;
2433
});
2534

2635
constructor(private entity: EntityService) {

projects/website-angular/src/app/content/detail/detail.component.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,19 @@
8383
}
8484
}
8585

86+
// Cross references are dense lists of comma-separated identifiers
87+
// (RefSeq, ENSEMBL, COSMIC, ...); the pathway-browser uses 2px margins
88+
// for the panel, but the wider website detail card benefits from more
89+
// breathing room and stable line wrapping.
90+
cr-cross-references .composition-container {
91+
line-height: 1.7;
92+
column-gap: 0;
93+
94+
> span.margin-right {
95+
margin-right: 8px;
96+
}
97+
}
98+
8699
// Double the ID selector to beat Angular's encapsulated
87100
// #details[_ngcontent-xxx] specificity (0,2,0) with (0,2,1)
88101
#details#details {

0 commit comments

Comments
 (0)