Skip to content

Commit 3bf7143

Browse files
authored
refactor: remove feature views and new badge logic from inspector (#164)
1 parent 84baaf0 commit 3bf7143

4 files changed

Lines changed: 0 additions & 64 deletions

File tree

src/view/frontend/web/css/inspector.css

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -461,19 +461,6 @@
461461
border-bottom-color: var(--mageforge-color-blue);
462462
}
463463

464-
.mageforge-badge-new {
465-
background: linear-gradient(135deg, var(--mageforge-color-amber) 0%, var(--mageforge-color-amber) 100%);
466-
color: white;
467-
font-size: 8px;
468-
padding: 1px 4px;
469-
border-radius: 4px;
470-
font-weight: 700;
471-
text-transform: uppercase;
472-
letter-spacing: 0.05em;
473-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
474-
animation: mageforge-pulse 2s infinite;
475-
}
476-
477464
/* ============================================================================
478465
Info Sections & Data Display
479466
========================================================================== */

src/view/frontend/web/js/inspector.js

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,6 @@ function _registerMageforgeInspector() {
7777
pageTimings: null,
7878
performanceObservers: [],
7979

80-
// Feature Discovery
81-
MAX_NEW_BADGE_VIEWS: 5,
82-
featureViews: {
83-
'performance': 0,
84-
'core-web-vitals': 0
85-
},
86-
8780
// ====================================================================
8881
// Lifecycle
8982
// ====================================================================
@@ -103,7 +96,6 @@ function _registerMageforgeInspector() {
10396
this.createFloatingButton();
10497
this.initWebVitalsTracking();
10598
this.cachePageTimings();
106-
this.loadFeatureViews();
10799

108100
// Dispatch init event for Hyvä integration
109101
this.$dispatch('mageforge:inspector:init');
@@ -143,39 +135,6 @@ function _registerMageforgeInspector() {
143135
}
144136
},
145137

146-
// ====================================================================
147-
// Feature Views
148-
// ====================================================================
149-
150-
loadFeatureViews() {
151-
try {
152-
const stored = localStorage.getItem('mageforge_feature_views');
153-
if (stored) {
154-
this.featureViews = { ...this.featureViews, ...JSON.parse(stored) };
155-
}
156-
} catch (e) {
157-
console.warn('MageForge: Failed to load feature views', e);
158-
}
159-
},
160-
161-
incrementFeatureViews() {
162-
let changed = false;
163-
['performance', 'core-web-vitals'].forEach(feature => {
164-
if (this.featureViews[feature] < this.MAX_NEW_BADGE_VIEWS) {
165-
this.featureViews[feature]++;
166-
changed = true;
167-
}
168-
});
169-
170-
if (changed) {
171-
try {
172-
localStorage.setItem('mageforge_feature_views', JSON.stringify(this.featureViews));
173-
} catch (e) {
174-
// Ignore storage errors
175-
}
176-
}
177-
},
178-
179138
// ====================================================================
180139
// Panel Data
181140
// ====================================================================

src/view/frontend/web/js/inspector/picker.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ export const pickerMethods = {
136136
this.showHighlight(element);
137137
this.updatePanelData(element);
138138
this.showInfoBadge(element);
139-
this.incrementFeatureViews();
140139
}, this.hoverDelay);
141140
} else if (!element && this.hoveredElement) {
142141
// Only hide highlight when leaving element, keep badge visible

src/view/frontend/web/js/inspector/tabs.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,6 @@ export const tabsMethods = {
3737
textSpan.textContent = tab.label;
3838
button.appendChild(textSpan);
3939

40-
// Show "New" badge for Performance and Core Web Vitals if seen < 5 times
41-
if (['performance', 'core-web-vitals'].includes(tab.id) &&
42-
(this.featureViews[tab.id] || 0) < this.MAX_NEW_BADGE_VIEWS) {
43-
const badge = document.createElement('span');
44-
badge.className = 'mageforge-badge-new';
45-
badge.textContent = 'NEW';
46-
button.appendChild(badge);
47-
}
48-
4940
button.onclick = (e) => {
5041
e.preventDefault();
5142
e.stopPropagation();

0 commit comments

Comments
 (0)