Skip to content

feat(logs): add a clear button to drop displayed logs#1756

Merged
pdesoyres-cc merged 6 commits into
masterfrom
logs/add-clear
Jun 2, 2026
Merged

feat(logs): add a clear button to drop displayed logs#1756
pdesoyres-cc merged 6 commits into
masterfrom
logs/add-clear

Conversation

@pdesoyres-cc
Copy link
Copy Markdown
Contributor

@pdesoyres-cc pdesoyres-cc commented May 28, 2026

Context

Long log sessions accumulate noise and there was no way to wipe the view without tearing down
the live stream.

Changes

  • New CcLogsClearEvent and a clear button (eraser icon) in the cc-logs-control header.
  • The three smart wrappers (cc-logs-addon-runtime, cc-logs-app-access,
    cc-logs-app-runtime) listen for cc-logs-clear and call a new clearVisibleLogs() on
    their controller, which clears the displayed logs without closing the stream.
  • LogsProgress now tracks a separate _visibleValue and exposes resetVisible(), so the
    overflow watermark is computed against what's actually displayed rather than the total
    fetched since the stream opened.
  • English / French translations for the new button label.

Implementation notes

The overflow detector previously used the cumulative _value, which would have kept the
overflow signal stuck after a clear (total ≥ watermark even though the view is empty).
Splitting _visibleValue from _value lets resetVisible() restore the overflow signal
without 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

@pdesoyres-cc pdesoyres-cc added the enhancement New feature or request label May 28, 2026
@pdesoyres-cc pdesoyres-cc self-assigned this May 28, 2026
@github-actions
Copy link
Copy Markdown
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.

Copy link
Copy Markdown
Contributor

@florian-sanders-cc florian-sanders-cc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this feature, I expected this to be hard to review but actually the code was easy to understand, great PR! 😎

Copy link
Copy Markdown
Contributor

@HeleneAmouzou HeleneAmouzou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

Copy link
Copy Markdown
Member

@hsablonniere hsablonniere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@pdesoyres-cc pdesoyres-cc merged commit a037a6f into master Jun 2, 2026
7 checks passed
@pdesoyres-cc pdesoyres-cc deleted the logs/add-clear branch June 2, 2026 11:50
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

🔎 The preview has been automatically deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants