Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| da5dbc70e2 | |||
| 19b7981542 |
10
changelog.md
10
changelog.md
@@ -1,5 +1,15 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-02-21 - 3.43.2 - fix(dees-chart-log)
|
||||||
|
avoid duplicate log entries, optimize incremental updates, enforce maxEntries, and respect filters when writing logs
|
||||||
|
|
||||||
|
- Prevent property-bound logEntries from duplicating entries already present in logBuffer by deduplicating on timestamp|message
|
||||||
|
- Call updateMetrics() when replaying or appending log entries so metrics stay accurate
|
||||||
|
- Skip processing entirely when the incoming logEntries array is unchanged
|
||||||
|
- Optimize append-only updates by writing only the new tail entries instead of full re-render
|
||||||
|
- Enforce maxEntries when appending to the logBuffer to maintain buffer size
|
||||||
|
- Respect filterMode and searchQuery when deciding whether to write appended entries to the terminal
|
||||||
|
|
||||||
## 2026-02-21 - 3.43.1 - fix(dees-chart-log)
|
## 2026-02-21 - 3.43.1 - fix(dees-chart-log)
|
||||||
replay buffered log entries when terminal becomes ready and sync logEntries updates to re-render filtered logs
|
replay buffered log entries when terminal becomes ready and sync logEntries updates to re-render filtered logs
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@design.estate/dees-catalog",
|
"name": "@design.estate/dees-catalog",
|
||||||
"version": "3.43.1",
|
"version": "3.43.2",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.",
|
"description": "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.",
|
||||||
"main": "dist_ts_web/index.js",
|
"main": "dist_ts_web/index.js",
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@design.estate/dees-catalog',
|
name: '@design.estate/dees-catalog',
|
||||||
version: '3.43.1',
|
version: '3.43.2',
|
||||||
description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
|
description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -385,11 +385,23 @@ export class DeesChartLog extends DeesElement {
|
|||||||
this.domtoolsInstance = await this.domtoolsPromise;
|
this.domtoolsInstance = await this.domtoolsPromise;
|
||||||
await this.initializeTerminal();
|
await this.initializeTerminal();
|
||||||
|
|
||||||
// Process any initial log entries
|
// initializeTerminal() already replayed logBuffer (from addLog/updateLog).
|
||||||
if (this.logEntries.length > 0) {
|
// Now handle logEntries set via property binding before terminal was ready.
|
||||||
|
if (this.logEntries.length > 0 && this.logBuffer.length === 0) {
|
||||||
|
this.logBuffer = [...this.logEntries];
|
||||||
for (const entry of this.logEntries) {
|
for (const entry of this.logEntries) {
|
||||||
|
this.updateMetrics(entry.level);
|
||||||
this.writeLogEntry(entry);
|
this.writeLogEntry(entry);
|
||||||
}
|
}
|
||||||
|
} else if (this.logEntries.length > 0 && this.logBuffer.length > 0) {
|
||||||
|
const bufferSet = new Set(this.logBuffer.map(e => `${e.timestamp}|${e.message}`));
|
||||||
|
for (const entry of this.logEntries) {
|
||||||
|
if (!bufferSet.has(`${entry.timestamp}|${entry.message}`)) {
|
||||||
|
this.logBuffer.push(entry);
|
||||||
|
this.updateMetrics(entry.level);
|
||||||
|
this.writeLogEntry(entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -455,7 +467,46 @@ export class DeesChartLog extends DeesElement {
|
|||||||
public updated(changedProperties: Map<string, any>) {
|
public updated(changedProperties: Map<string, any>) {
|
||||||
super.updated(changedProperties);
|
super.updated(changedProperties);
|
||||||
if (changedProperties.has('logEntries') && this.terminalReady && this.logEntries.length > 0) {
|
if (changedProperties.has('logEntries') && this.terminalReady && this.logEntries.length > 0) {
|
||||||
this.logBuffer = [...this.logEntries];
|
const oldEntries: ILogEntry[] = changedProperties.get('logEntries') || [];
|
||||||
|
const newEntries = this.logEntries;
|
||||||
|
|
||||||
|
// Same content? Skip entirely.
|
||||||
|
if (
|
||||||
|
oldEntries.length === newEntries.length &&
|
||||||
|
oldEntries.length > 0 &&
|
||||||
|
oldEntries[oldEntries.length - 1].timestamp === newEntries[newEntries.length - 1].timestamp &&
|
||||||
|
oldEntries[oldEntries.length - 1].message === newEntries[newEntries.length - 1].message
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Append-only? Write only the new tail entries incrementally.
|
||||||
|
if (
|
||||||
|
newEntries.length > oldEntries.length &&
|
||||||
|
oldEntries.length > 0 &&
|
||||||
|
oldEntries[oldEntries.length - 1].timestamp === newEntries[oldEntries.length - 1].timestamp &&
|
||||||
|
oldEntries[oldEntries.length - 1].message === newEntries[oldEntries.length - 1].message
|
||||||
|
) {
|
||||||
|
const tailEntries = newEntries.slice(oldEntries.length);
|
||||||
|
for (const entry of tailEntries) {
|
||||||
|
this.logBuffer.push(entry);
|
||||||
|
this.updateMetrics(entry.level);
|
||||||
|
|
||||||
|
// Enforce maxEntries
|
||||||
|
if (this.logBuffer.length > this.maxEntries) {
|
||||||
|
this.logBuffer.shift();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Respect filter mode
|
||||||
|
if (!this.filterMode || !this.searchQuery || this.entryMatchesFilter(entry)) {
|
||||||
|
this.writeLogEntry(entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Different content — full re-render
|
||||||
|
this.logBuffer = [...newEntries];
|
||||||
this.reRenderFilteredLogs();
|
this.reRenderFilteredLogs();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user