bubbletea icon indicating copy to clipboard operation
bubbletea copied to clipboard

feat: allow chainable msg filters; add MouseThrottleFilter

Open lrstanley opened this issue 1 month ago • 3 comments

Changes in this PR

Made some tweaks to message filtering, as I think this will help others. If y'all don't think it will be too useful, or would rather approach it a different way, feel free to close this out.

  • Converted WithFilter(filter) to WithFilters(filters...) to allow chainable filters, with a MsgFilter type to clean things up a little.
  • Added an out-of-box MouseThrottleFilter filter, to cover throttling of high-frequency mouse messages. This logic is also used in crush here, and one of my apps, and I suspect such functionality will help others improve performance when they don't need the high-frequency tracking.

lrstanley avatar Nov 16 '25 10:11 lrstanley

Codecov Report

:x: Patch coverage is 4.54545% with 21 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 56.26%. Comparing base (55b3503) to head (59d353c). :warning: Report is 1 commits behind head on v2-exp.

Files with missing lines Patch % Lines
options.go 4.54% 19 Missing and 2 partials :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           v2-exp    #1544      +/-   ##
==========================================
- Coverage   57.28%   56.26%   -1.03%     
==========================================
  Files          25       25              
  Lines        1201     1221      +20     
==========================================
- Hits          688      687       -1     
- Misses        436      455      +19     
- Partials       77       79       +2     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Nov 16 '25 10:11 codecov[bot]

Tests currently breaking due to https://github.com/charmbracelet/bubbletea/blob/f60735dff10c208b3398dde25a39b1d27eb6d266/examples/go.mod#L7

lrstanley avatar Nov 17 '25 02:11 lrstanley

Tests currently breaking due to

https://github.com/charmbracelet/bubbletea/blob/f60735dff10c208b3398dde25a39b1d27eb6d266/examples/go.mod#L7

I removed this in the latest v2-exp commit

aymanbagabas avatar Nov 17 '25 20:11 aymanbagabas