Skip to content

Commit 11e6420

Browse files
feat(interface): navigate to network panel on warnings package click (#710)
1 parent 5d4fd0c commit 11e6420

2 files changed

Lines changed: 25 additions & 11 deletions

File tree

public/components/views/warnings/warnings.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export class WarningsView extends LitElement {
124124
125125
:host-context(body.dark) {
126126
--bg: var(--dark-theme-gray);
127-
127+
128128
color: rgb(255 255 255 / 87%);
129129
}
130130
@@ -160,7 +160,7 @@ export class WarningsView extends LitElement {
160160
}
161161
162162
.warnings-subtitle {
163-
font-size: 13px;
163+
font-size: 16px;
164164
color: #7a7595;
165165
margin: 0 0 16px;
166166
}
@@ -179,7 +179,7 @@ export class WarningsView extends LitElement {
179179
display: flex;
180180
align-items: center;
181181
gap: 5px;
182-
font-size: 12px;
182+
font-size: 15px;
183183
font-weight: 600;
184184
padding: 3px 10px;
185185
border-radius: 20px;
@@ -207,7 +207,7 @@ export class WarningsView extends LitElement {
207207
}
208208
209209
.severity-section h2 {
210-
font-size: 11px;
210+
font-size: 14px;
211211
font-weight: 700;
212212
letter-spacing: 1px;
213213
text-transform: uppercase;
@@ -250,14 +250,14 @@ export class WarningsView extends LitElement {
250250
}
251251
252252
.kind-name {
253-
font-size: 14px;
253+
font-size: 16px;
254254
font-weight: 600;
255255
flex: 1;
256256
font-family: mononoki, monospace;
257257
}
258258
259259
.severity-badge {
260-
font-size: 10px;
260+
font-size: 13px;
261261
font-weight: 700;
262262
padding: 2px 7px;
263263
border-radius: 4px;
@@ -267,7 +267,7 @@ export class WarningsView extends LitElement {
267267
}
268268
269269
.docs-link {
270-
font-size: 11px;
270+
font-size: 14px;
271271
color: #7c6fff;
272272
text-decoration: none;
273273
opacity: 0.8;
@@ -282,7 +282,7 @@ export class WarningsView extends LitElement {
282282
:host-context(body.dark) .docs-link { color: #a394ff; }
283283
284284
.kind-card--meta {
285-
font-size: 11px;
285+
font-size: 14px;
286286
color: #7a7595;
287287
padding: 0 16px 10px;
288288
}
@@ -318,7 +318,7 @@ export class WarningsView extends LitElement {
318318
}
319319
320320
.pkg-name {
321-
font-size: 12px;
321+
font-size: 16px;
322322
font-family: mononoki, monospace;
323323
flex: 1;
324324
}
@@ -332,7 +332,7 @@ export class WarningsView extends LitElement {
332332
}
333333
334334
.pkg-count {
335-
font-size: 11px;
335+
font-size: 14px;
336336
font-weight: 600;
337337
color: #7a7595;
338338
background: rgb(0 0 0 / 5%);
@@ -373,7 +373,7 @@ export class WarningsView extends LitElement {
373373
return;
374374
}
375375

376-
window.dispatchEvent(new CustomEvent(EVENTS.TREE_NODE_CLICK, {
376+
window.dispatchEvent(new CustomEvent(EVENTS.WARNINGS_PACKAGE_CLICK, {
377377
detail: { nodeId }
378378
}));
379379
}

public/main.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,20 @@ document.addEventListener("DOMContentLoaded", async() => {
110110
}
111111
});
112112

113+
window.addEventListener(EVENTS.WARNINGS_PACKAGE_CLICK, (event) => {
114+
const { nodeId } = event.detail;
115+
const node = secureDataSet.linker.get(nodeId);
116+
if (!node) {
117+
return;
118+
}
119+
120+
window.navigation.setNavByName("network--view");
121+
setTimeout(() => {
122+
PackageInfo.ForcedPackageMenu = "warnings";
123+
nsn.focusNodeByNameAndVersion(node.name, node.version);
124+
}, 25);
125+
});
126+
113127
await init();
114128
window.dispatchEvent(
115129
new CustomEvent(EVENTS.SETTINGS_SAVED, {

0 commit comments

Comments
 (0)