Skip to content

Commit 7faee0c

Browse files
committed
block-filters: hide labitbu chip outside mint window; default OTS on
- Labitbu gate now hides the chip on every view that isn't a block inside the historical mint window. Mempool / cluster / Next Block views (blockHeight = null) previously kept the chip visible; no new labitbu tx will ever land in the mempool so the chip is pure noise there. Flipped from "show if null OR in-window" to "show only if explicitly in-window". - OpenTimestamps chip is now selected by default. ordpool_ots was the only Ordpool Flag missing from activeGoggles$.filters; users shouldn't have to opt in to see OTS commits on the block-overview graph out of the box. - Re-sync filters on disabledFilters change. The activeGoggles$ subscription runs once in ngOnInit before [blockHeight] flows in, so any filter that started disabled (labitbu by default, since blockHeight starts null) was pruned from activeFilters and never came back when the gate later opened. Extracted the subscribe-body into applyActiveGoggles() and call it again whenever excludeFilters / blockHeight change.
1 parent 34434a0 commit 7faee0c

2 files changed

Lines changed: 28 additions & 14 deletions

File tree

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

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,7 @@ export class BlockFiltersComponent implements OnInit, OnChanges, OnDestroy {
4343

4444
ngOnInit(): void {
4545
this.filterSubscription = this.stateService.activeGoggles$.subscribe((active: ActiveFilter) => {
46-
this.filterMode = active.mode;
47-
this.gradientMode = active.gradient;
48-
for (const key of Object.keys(this.filterFlags)) {
49-
this.filterFlags[key] = false;
50-
}
51-
for (const key of active.filters) {
52-
this.filterFlags[key] = !this.disabledFilters[key];
53-
}
54-
this.activeFilters = [...active.filters.filter(key => !this.disabledFilters[key])];
55-
this.onFilterChanged.emit({ mode: active.mode, filters: this.activeFilters, gradient: this.gradientMode });
46+
this.applyActiveGoggles(active);
5647
});
5748
}
5849

@@ -66,13 +57,35 @@ export class BlockFiltersComponent implements OnInit, OnChanges, OnDestroy {
6657
this.disabledFilters[filter] = true;
6758
});
6859
// HACK -- Ordpool: gate labitbu chip on the labitbu mint window.
69-
// Show on mempool / cluster views (blockHeight = null) and on blocks
70-
// inside the window. Hide everywhere else: the labitbu experiment is
71-
// done and the chip is meaningless on every other block.
72-
if (this.blockHeight != null && (this.blockHeight < LABITBU_FIRST_HEIGHT || this.blockHeight > LABITBU_LAST_HEIGHT)) {
60+
// The labitbu experiment is done; minting is complete. Show the chip
61+
// ONLY on blocks inside the historical mint window. Hide everywhere
62+
// else, including mempool / cluster / Next Block views (blockHeight
63+
// null) — no new labitbu tx will ever land in the mempool, so the
64+
// chip is pure noise there.
65+
if (this.blockHeight == null || this.blockHeight < LABITBU_FIRST_HEIGHT || this.blockHeight > LABITBU_LAST_HEIGHT) {
7366
this.disabledFilters['ordpool_labitbu'] = true;
7467
}
68+
// HACK -- Ordpool: re-sync active filters whenever `disabledFilters`
69+
// changes. Without this, a filter that started disabled (e.g. labitbu
70+
// when the component mounted before `blockHeight` flowed in) stays
71+
// pruned from `activeFilters` even after the gate later opens.
72+
if (this.filterSubscription) {
73+
this.applyActiveGoggles(this.stateService.activeGoggles$.value);
74+
}
75+
}
76+
}
77+
78+
private applyActiveGoggles(active: ActiveFilter): void {
79+
this.filterMode = active.mode;
80+
this.gradientMode = active.gradient;
81+
for (const key of Object.keys(this.filterFlags)) {
82+
this.filterFlags[key] = false;
83+
}
84+
for (const key of active.filters) {
85+
this.filterFlags[key] = !this.disabledFilters[key];
7586
}
87+
this.activeFilters = [...active.filters.filter(key => !this.disabledFilters[key])];
88+
this.onFilterChanged.emit({ mode: active.mode, filters: this.activeFilters, gradient: this.gradientMode });
7689
}
7790

7891
setFilterMode(mode): void {

frontend/src/app/services/state.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ export class StateService {
247247
'ordpool_stamp',
248248
'ordpool_src721',
249249
'ordpool_src101',
250+
'ordpool_ots',
250251
],
251252
gradient: 'fee'
252253
});

0 commit comments

Comments
 (0)