Skip to content

Commit 1e82155

Browse files
Merge branch 'main' into feat-debug-only
2 parents 78b01ca + 0fd82e0 commit 1e82155

5 files changed

Lines changed: 33 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020
- Show the pointer cursor by default when hovering the Timeline.
2121
- Show the grabbing cursor when the mouse is pressed down on the Timeline, to indicate drag is now possible.
2222
- Show the default cursor when hovering a Timeline event.
23+
- Timeline event marker clarity improvements ([#115][#115])
24+
- Skipped-Lines and Max-Size-reached marker color from green to blue. Green normal mean things are ok, blue better represents information.
25+
- Added faint grey lines between the event markers to seperates them. This helps when two error are next to each other.
2326

2427
## [1.10.3] - 2023-11-07
2528

@@ -293,6 +296,7 @@ Skipped due to adopting odd numbering for pre releases and even number for relea
293296
<!-- Unreleased -->
294297

295298
[#86]: https://github.com/certinia/debug-log-analyzer/issues/86
299+
[#115]: https://github.com/certinia/debug-log-analyzer/issues/115
296300
[#423]: https://github.com/certinia/debug-log-analyzer/issues/423
297301
[#209]: https://github.com/certinia/debug-log-analyzer/issues/209
298302

log-viewer/modules/components/LogViewer.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ApexLog, parse } from '../parsers/ApexLogParser.js';
88
import { hostService } from '../services/VSCodeService.js';
99
import { globalStyles } from '../styles/global.styles.js';
1010
import './AppHeader.js';
11-
import { Notification } from './notifications/NotificationPanel.js';
11+
import { Notification, type NotificationSeverity } from './notifications/NotificationPanel.js';
1212

1313
@customElement('log-viewer')
1414
export class LogViewer extends LitElement {
@@ -90,13 +90,15 @@ export class LogViewer extends LitElement {
9090

9191
const localNotifications = Array.from(this.notifications);
9292
apexLog.logIssues.forEach((element) => {
93-
const severity = element.type === 'error' ? 'Error' : 'Warning';
93+
const severity = this.toSeverity(element.type);
9494

9595
const logMessage = new Notification();
9696
logMessage.summary = element.summary;
9797
logMessage.message = element.description;
9898
logMessage.severity = severity;
9999
localNotifications.push(logMessage);
100+
101+
console.debug('s,', severity, logMessage);
100102
});
101103
this.notifications = localNotifications;
102104

@@ -135,6 +137,15 @@ export class LogViewer extends LitElement {
135137
}
136138
}
137139

140+
severity = new Map<string, NotificationSeverity>([
141+
['error', 'Error'],
142+
['unexpected', 'Warning'],
143+
['skip', 'Info'],
144+
]);
145+
private toSeverity(errorType: 'unexpected' | 'error' | 'skip') {
146+
return this.severity.get(errorType) || 'Info';
147+
}
148+
138149
private parserIssuesToMessages(apexLog: ApexLog) {
139150
const issues: Notification[] = [];
140151
apexLog.parsingErrors.forEach((message) => {
@@ -150,7 +161,6 @@ export class LogViewer extends LitElement {
150161
>report unsupported type</a
151162
>`
152163
: message.slice(message.indexOf(':') + 1);
153-
logMessage.severity = 'Info';
154164
issues.push(logMessage);
155165
});
156166
return issues;

log-viewer/modules/components/notifications/NotificationPanel.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class NotificationPanel extends LitElement {
7878
}
7979
8080
.info {
81-
background-color: var(--notification-info-background);
81+
background-color: var(--notification-information-background);
8282
}
8383
8484
.text-container {
@@ -127,8 +127,9 @@ export class NotificationPanel extends LitElement {
127127
}
128128
}
129129

130+
export type NotificationSeverity = 'Error' | 'Warning' | 'Info' | 'None';
130131
export class Notification {
131132
summary = '';
132133
message: string | TemplateResult<1> = '';
133-
severity: 'Error' | 'Warning' | 'Info' | 'none' = 'none';
134+
severity: NotificationSeverity = 'None';
134135
}

log-viewer/modules/styles/notification.styles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import { css } from 'lit';
22

33
export const notificationStyles = css`
44
--notification-error-background: var(--vscode-editorError-background, rgba(255, 128, 128, 0.2));
5-
--notification-warning-background: rgba(128, 255, 128, 0.2);
6-
--notification-information-background: rgba(128, 128, 255, 0.2);
5+
--notification-warning-background: rgba(128, 128, 255, 0.2);
6+
--notification-information-background: rgb(30, 128, 255, 0.2);
77
`;

log-viewer/modules/timeline/Timeline.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface TimelineColors {
2727

2828
const truncationColors: Map<string, string> = new Map([
2929
['error', 'rgba(255, 128, 128, 0.2)'],
30-
['skip', 'rgba(128, 255, 128, 0.2)'],
30+
['skip', 'rgb(30, 128, 255, 0.2)'],
3131
['unexpected', 'rgba(128, 128, 255, 0.2)'],
3232
]);
3333

@@ -330,6 +330,9 @@ function drawTruncation(ctx: CanvasRenderingContext2D) {
330330
}
331331
let i = 0;
332332

333+
ctx.strokeStyle = '#808080';
334+
ctx.beginPath();
335+
333336
while (i < len) {
334337
const thisEntry = issues[i++],
335338
nextEntry = issues[i];
@@ -352,10 +355,17 @@ function drawTruncation(ctx: CanvasRenderingContext2D) {
352355
w = w - widthOffScreen;
353356
}
354357

358+
ctx.moveTo(x, -displayHeight);
359+
ctx.lineTo(x, 0);
360+
361+
ctx.moveTo(x + w, -displayHeight);
362+
ctx.lineTo(x + w, 0);
363+
355364
ctx.fillStyle = truncationColors.get(thisEntry.type) || '';
356365
ctx.fillRect(x, -displayHeight, w, displayHeight);
357366
}
358367
}
368+
ctx.stroke();
359369
}
360370

361371
function calculateSizes() {

0 commit comments

Comments
 (0)