Skip to content

Commit

Permalink
feat: force scroll to bottom of logs after summary display
Browse files Browse the repository at this point in the history
  • Loading branch information
tblivet committed Dec 17, 2024
1 parent 742a656 commit 4dd3898
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions _dev/src/ts/components/LogsViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export default class LogsViewer extends ComponentAbstract implements DomLifecycl

// -- virtual scroll configuration --
private static CONFIG = {
BUFFER_SIZE: 3, // The multiplier for the viewport height used to define the buffer zone for virtual scrolling.
DEBOUNCE_TIME: 100, // The delay time (in ms) for debouncing the `refreshView` method.
LOG_BEFORE_SCROLL: 70 // The number of logs to process before automatically scrolling to the bottom.
BUFFER_SIZE: 6, // The multiplier for the viewport height used to define the buffer zone for virtual scrolling.
DEBOUNCE_TIME: 50, // The delay time (in ms) for debouncing the `refreshView` method.
LOG_BEFORE_SCROLL: 120 // The number of logs to process before automatically scrolling to the bottom.
};

#templateLogLine = this.queryElement<HTMLTemplateElement>(
Expand Down Expand Up @@ -250,6 +250,8 @@ export default class LogsViewer extends ComponentAbstract implements DomLifecycl

this.#logsSummary.appendChild(fragment);
this.#isSummaryDisplayed = true;

this.#scrollToBottom();
};

/**
Expand Down

0 comments on commit 4dd3898

Please sign in to comment.