Skip to content

Commit 7abf0c7

Browse files
committed
block-overview: lift app-block-filters out of the canvas overlay
Previous layout used a fixed $block-filters-height: 110px + negative-margin on app-block-filters > div to overlay the chip rows on top of the WebGL canvas without taking up flow space. That break-even worked while there were ~5-7 flag chips; after the ordpool flag set grew (counterparty, stamp, src721, src101, ots, ...) the chips wrapped to a third row and overflowed the fixed height, clipping under the canvas. Refactor: render <app-block-filters> as a sibling above .block-overview-graph in normal flow. SCSS no longer pins a height; just an 8px margin-bottom. Adding chips now grows the row count naturally. While there: thread block.height into <app-block-filters> via a new blockHeight @input. block-filters uses ordpool-parser's isLabitbuRange() to hide the labitbu chip on blocks outside the mint window.
1 parent ee23c9a commit 7abf0c7

5 files changed

Lines changed: 32 additions & 17 deletions

File tree

frontend/src/app/components/block-filters/block-filters.component.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import { Component, EventEmitter, Output, HostListener, Input, ChangeDetectorRef
22
import { ActiveFilter, FilterGroups, FilterMode, GradientMode, TransactionFilters } from '@app/shared/filters.utils';
33
import { StateService } from '@app/services/state.service';
44
import { Subscription } from 'rxjs';
5+
// HACK -- Ordpool: shared labitbu-window check; hides the labitbu chip on
6+
// blocks outside the mint window.
7+
import { isLabitbuRange } from 'ordpool-parser';
58

69

710
@Component({
@@ -13,6 +16,10 @@ import { Subscription } from 'rxjs';
1316
export class BlockFiltersComponent implements OnInit, OnChanges, OnDestroy {
1417
@Input() cssWidth: number = 800;
1518
@Input() excludeFilters: string[] = [];
19+
// HACK -- Ordpool: block height of the block being viewed (null for the
20+
// mempool / cluster views). Used to hide the labitbu filter chip outside
21+
// the labitbu mint window.
22+
@Input() blockHeight: number | null = null;
1623
@Output() onFilterChanged: EventEmitter<ActiveFilter | null> = new EventEmitter();
1724

1825
filterSubscription: Subscription;
@@ -52,11 +59,18 @@ export class BlockFiltersComponent implements OnInit, OnChanges, OnDestroy {
5259
if (changes.cssWidth) {
5360
this.cd.markForCheck();
5461
}
55-
if (changes.excludeFilters) {
62+
if (changes.excludeFilters || changes.blockHeight) {
5663
this.disabledFilters = {};
5764
this.excludeFilters.forEach(filter => {
5865
this.disabledFilters[filter] = true;
5966
});
67+
// HACK -- Ordpool: gate labitbu chip on the labitbu mint window.
68+
// Show on mempool / cluster views (blockHeight = null) and on blocks
69+
// inside the window. Hide everywhere else: the labitbu experiment is
70+
// done and the chip is meaningless on every other block.
71+
if (this.blockHeight != null && !isLabitbuRange(this.blockHeight)) {
72+
this.disabledFilters['ordpool_labitbu'] = true;
73+
}
6074
}
6175
}
6276

frontend/src/app/components/block-overview-graph/block-overview-graph.component.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11

22
<div class="graph-alignment" [class.grid-align]="!autofit" [style.gridTemplateColumns]="'repeat(auto-fit, ' + resolution + 'px)'">
3+
<!-- HACK -- Ordpool: app-block-filters lifted out of .block-overview-graph
4+
so the chip rows can grow without overlapping the WebGL canvas. The
5+
upstream layout used a fixed-height + negative-margin overlay trick
6+
that broke once we added more flag chips. -->
7+
<app-block-filters *ngIf="webGlEnabled && showFilters && filtersAvailable" [excludeFilters]="excludeFilters" [blockHeight]="blockHeight" [cssWidth]="cssWidth" (onFilterChanged)="setFilterFlags($event)"></app-block-filters>
38
<div class="block-overview-graph">
49
<canvas *browserOnly class="block-overview-canvas" [class.clickable]="!!hoverTx" #blockCanvas></canvas>
510
@if (!disableSpinner) {
@@ -18,7 +23,6 @@
1823
[filterMode]="filterMode"
1924
[relativeTime]="relativeTime"
2025
></app-block-overview-tooltip>
21-
<app-block-filters *ngIf="webGlEnabled && showFilters && filtersAvailable" [excludeFilters]="excludeFilters" [cssWidth]="cssWidth" (onFilterChanged)="setFilterFlags($event)"></app-block-filters>
2226
<div *ngIf="!webGlEnabled" class="placeholder">
2327
<span i18n="webgl-disabled">Your browser does not support this feature.</span>
2428
</div>

frontend/src/app/components/block-overview-graph/block-overview-graph.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ export class BlockOverviewGraphComponent implements AfterViewInit, OnDestroy, On
5656
@Input() auditHighlighting: boolean = false;
5757
@Input() showFilters: boolean = false;
5858
@Input() excludeFilters: string[] = [];
59+
// HACK -- Ordpool: forwarded to <app-block-filters> so it can hide the
60+
// labitbu chip outside the labitbu mint window. null on mempool views.
61+
@Input() blockHeight: number | null = null;
5962
@Input() filterFlags: bigint | null = null;
6063
@Input() filterMode: FilterMode = 'and';
6164
@Input() gradientMode: 'fee' | 'age' = 'fee';

frontend/src/app/components/block/block.component.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ <h1>
137137
[blockConversion]="blockConversion"
138138
[showFilters]="true"
139139
[excludeFilters]="['replacement']"
140+
[blockHeight]="block?.height ?? null"
140141
[relativeTime]="block?.timestamp"
141142
(txClickEvent)="onTxClick($event)"
142143
></app-block-overview-graph>
@@ -279,7 +280,7 @@ <h3 class="block-subtitle" *ngIf="!isMobile"><ng-container i18n="block.expected-
279280
<app-block-overview-graph #blockGraphProjected [isLoading]="!stateService.isBrowser || isLoadingOverview" [resolution]="86"
280281
[blockLimit]="stateService.blockVSize" [orientation]="'top'" [flip]="false" [mirrorTxid]="hoverTx" [auditHighlighting]="showComparison"
281282
(txClickEvent)="onTxClick($event)" (txHoverEvent)="onTxHover($event)" [unavailable]="!isMobile && !showAudit && !block?.stale"
282-
[showFilters]="true" [excludeFilters]="['replacement']" [relativeTime]="block?.timestamp"></app-block-overview-graph>
283+
[showFilters]="true" [excludeFilters]="['replacement']" [blockHeight]="block?.height ?? null" [relativeTime]="block?.timestamp"></app-block-overview-graph>
283284
@if (isMobile && mode === 'actual' || block?.stale) {
284285
<ng-container *ngTemplateOutlet="emptyBlockInfo; context: { $implicit: (isMobile && mode === 'actual' && block?.stale) ? canonicalBlock : block }"></ng-container>
285286
}
@@ -314,7 +315,7 @@ <h3 class="block-subtitle actual" *ngIf="!isMobile">
314315
<app-block-overview-graph #blockGraphActual [isLoading]="!stateService.isBrowser || isLoadingOverview" [resolution]="86"
315316
[blockLimit]="stateService.blockVSize" [orientation]="'top'" [flip]="false" [mirrorTxid]="hoverTx" mode="mined" [auditHighlighting]="showComparison"
316317
(txClickEvent)="onTxClick($event)" (txHoverEvent)="onTxHover($event)" [unavailable]="isMobile && !showAudit && !block?.stale"
317-
[showFilters]="true" [excludeFilters]="['replacement']" [relativeTime]="block?.timestamp"></app-block-overview-graph>
318+
[showFilters]="true" [excludeFilters]="['replacement']" [blockHeight]="block?.height ?? null" [relativeTime]="block?.timestamp"></app-block-overview-graph>
318319
<ng-container *ngTemplateOutlet="emptyBlockInfo; context: { $implicit: block?.stale ? canonicalBlock : block }"></ng-container>
319320
</div>
320321
<ng-container *ngIf="network !== 'liquid'">

frontend/src/styles-ordpool-overrides1.scss

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -112,27 +112,20 @@ app-atomical-viewer {
112112
white-space: normal !important;
113113
}
114114

115-
// moves app-block-filters out of the block overview (no "gray" blocking).
116-
// Must fit "Ordpool Flags" h5 + 2 wrapped rows of badges (11 flags total).
117-
$block-filters-height: 110px;
118-
119-
.block-overview-graph {
120-
margin-top: $block-filters-height;
121-
}
122-
115+
// HACK -- Ordpool: <app-block-filters> renders as a sibling above
116+
// <div class="block-overview-graph"> (lifted in the template), so the chip
117+
// rows take their natural height and the canvas just sits below them in
118+
// normal flow. No fixed pixel height and no overlay trick, so the layout
119+
// stays correct as we add more flag chips.
123120
.block-filters {
124-
height: $block-filters-height !important;
121+
margin-bottom: 8px;
125122

126123
h5 {
127124
margin-top: 0 !important;
128125
margin-bottom: 4px !important;
129126
}
130127
}
131128

132-
app-block-filters > div {
133-
margin-top: -$block-filters-height;
134-
}
135-
136129
// completely hide accelerated status (this is still shown for some txns)
137130
.badge-accelerated {
138131
display: none !important;

0 commit comments

Comments
 (0)