Skip to content

Commit ff4b1d3

Browse files
fix: put download bar + diagram after the Overview content, drop type chip
Adam's feedback: the diagram and download bar were stacked above the Overview section, so the page started with the visuals and the "Overview" header sat awkwardly between the title and the stable-id table. Also the "Pathway" / "Reaction" chip beside the entity name duplicated the Overview's Type row. - Move the <ng-content> projection slot from above the section loop into the overviewTemplate, so callers' projected children render AFTER the Overview's description-overview + summation rows but BEFORE the next section divider (Locations / Events / etc.). - Update /content/detail to pass the download-bar + diagram through that slot. - Remove the typeLabel computed, the type-chip span, and its scss. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e76d9fa commit ff4b1d3

4 files changed

Lines changed: 9 additions & 47 deletions

File tree

projects/pathway-browser/src/app/details/tabs/description-tab/description-tab.component.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030
</mat-slide-toggle>
3131
}
3232
</span>
33-
@if (typeLabel()) {
34-
<span class="type-chip">{{ typeLabel() }}</span>
35-
}
3633
</div>
3734
<div class="details-button">
3835
<a mat-button [routerLink]="`${CONTENT_DETAIL}/${obj().stId}`" target="_blank">
@@ -118,6 +115,11 @@
118115
</div>
119116
</div>
120117
}
118+
<!-- Caller-projected content (e.g. /content/detail puts the download
119+
bar + pathway diagram here, so they sit after the Overview's
120+
summation and before the next section divider). PathwayBrowser
121+
passes no children, so this stays empty there. -->
122+
<ng-content></ng-content>
121123
</ng-template>
122124

123125
<!-- xRefs -->

projects/pathway-browser/src/app/details/tabs/description-tab/description-tab.component.scss

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,6 @@
7979
padding-right: 2px;
8080
}
8181

82-
& .type-chip {
83-
flex-shrink: 0;
84-
font-size: 12px;
85-
font-weight: 600;
86-
letter-spacing: 0.3px;
87-
text-transform: uppercase;
88-
padding: 2px 8px;
89-
border-radius: 10px;
90-
background: var(--secondary-container, rgba(0, 110, 144, 0.12));
91-
color: var(--on-secondary-container, var(--primary));
92-
line-height: 1.4;
93-
}
9482
}
9583

9684
.details-button {

projects/pathway-browser/src/app/details/tabs/description-tab/description-tab.component.ts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -194,35 +194,6 @@ export class DescriptionTabComponent implements OnDestroy {
194194
});
195195

196196
readonly symbol = computed(() => this.getSymbol(this.obj()));
197-
198-
// Human-friendly schema-class label rendered as a chip beside the
199-
// entity name in the description-tab header (e.g. "Pathway",
200-
// "Reaction", "Protein"). Maps the few Reactome schema classes whose
201-
// raw name is jargon; falls back to splitting CamelCase otherwise.
202-
private static readonly TYPE_LABELS: Record<string, string> = {
203-
TopLevelPathway: 'Pathway',
204-
Pathway: 'Pathway',
205-
Reaction: 'Reaction',
206-
BlackBoxEvent: 'Reaction',
207-
Polymerisation: 'Reaction',
208-
Depolymerisation: 'Reaction',
209-
FailedReaction: 'Reaction',
210-
ReactionLikeEvent: 'Reaction',
211-
EntityWithAccessionedSequence: 'Protein',
212-
SimpleEntity: 'Small Molecule',
213-
ChemicalDrug: 'Drug',
214-
ProteinDrug: 'Drug',
215-
RNADrug: 'Drug',
216-
OtherEntity: 'Other Entity',
217-
};
218-
readonly typeLabel = computed(() => {
219-
const sc = (this.obj() as DatabaseObject & { schemaClass?: string }).schemaClass;
220-
if (!sc) return '';
221-
if (DescriptionTabComponent.TYPE_LABELS[sc]) {
222-
return DescriptionTabComponent.TYPE_LABELS[sc];
223-
}
224-
return sc.replace(/([a-z])([A-Z])/g, '$1 $2');
225-
});
226197
readonly literatureRefs: Signal<LiteratureReference[]> = computed(() =>
227198
getProperty(this.obj(), DataKeys.LITERATURE_REFERENCE)
228199
);

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ <h2>Entity not found</h2>
2020
</div>
2121
} @else if (obj()) {
2222
<div class="detail-container">
23-
<app-detail-download-bar [obj]="obj()!" />
24-
<app-detail-diagram [obj]="obj()!" />
25-
<cr-description-tab [obj]="obj()!" [showLocations]="true" />
23+
<cr-description-tab [obj]="obj()!" [showLocations]="true">
24+
<app-detail-download-bar [obj]="obj()!" />
25+
<app-detail-diagram [obj]="obj()!" />
26+
</cr-description-tab>
2627
</div>
2728
}
2829
</app-page-layout>

0 commit comments

Comments
 (0)