feat(logs): add a clear button to drop displayed logs#1756
Merged
Conversation
Contributor
|
🔎 A preview has been automatically published : https://clever-components-preview.cellar-c2.services.clever-cloud.com/logs/add-clear/index.html. This preview will be deleted once this PR is closed. |
florian-sanders-cc
approved these changes
Jun 2, 2026
Contributor
florian-sanders-cc
left a comment
There was a problem hiding this comment.
I like this feature, I expected this to be hard to review but actually the code was easy to understand, great PR! 😎
hsablonniere
approved these changes
Jun 2, 2026
Member
hsablonniere
left a comment
There was a problem hiding this comment.
Very easy to review PR, nice work @pdesoyres-cc 👍
Preparing the upcoming "clear logs" UI: clearing the view should restart the overflow watermark check without affecting the underlying total fetched. Introduces a dedicated `_visibleValue` counter and a `resetVisible()` method on `LogsProgress` (forwarded by `LogsStream`) so the clear action can reset the overflow signal independently.
Users accumulating long log sessions had no way to clear the view and focus on fresh output. Add a clear button in the control header that dispatches a new CcLogsClearEvent, leaving the actual clearing logic to the consumer. The smart wiring that handles the event lives in a separate commit so the component change stays independently reviewable.
…yed logs Wires the clear button (added in e04781b) to the app-runtime smart controller so users can drop the currently displayed logs without interrupting the live stream. Resets the visible log tracking alongside the component clear so overflow detection stays accurate.
a36bb83 to
7ca4cc9
Compare
Contributor
|
🔎 The preview has been automatically deleted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Long log sessions accumulate noise and there was no way to wipe the view without tearing down
the live stream.
Changes
CcLogsClearEventand a clear button (eraser icon) in thecc-logs-controlheader.cc-logs-addon-runtime,cc-logs-app-access,cc-logs-app-runtime) listen forcc-logs-clearand call a newclearVisibleLogs()ontheir controller, which clears the displayed logs without closing the stream.
LogsProgressnow tracks a separate_visibleValueand exposesresetVisible(), so theoverflow watermark is computed against what's actually displayed rather than the total
fetched since the stream opened.
Implementation notes
The overflow detector previously used the cumulative
_value, which would have kept theoverflow signal stuck after a clear (total ≥ watermark even though the view is empty).
Splitting
_visibleValuefrom_valueletsresetVisible()restore the overflow signalwithout losing the historical count used elsewhere.
The smart wiring lives in a separate commit per consumer so each integration stays
independently reviewable.
How to review
2 approvals reviewer