Repository navigation
Feat: add regex-based title cleaning rules configuration and implementation - #112
AminZibayi wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to 18e1877 in 51 seconds. Click for details.
- Reviewed
180lines of code in4files - Skipped
0files when reviewing. - Skipped posting
3draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. aw_watcher_window/config.py:20
- Draft comment:
Inconsistent config access: load_config now returns the full config (without indexing by 'aw-watcher-window') while parse_args still accesses config['aw-watcher-window']. Consider harmonizing how configuration is retrieved. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
2. aw_watcher_window/config.py:26
- Draft comment:
get_title_cleaning_rules() calls load_config_toml() directly, reloading the config. Consider reusing the result from load_config() or caching the cleaning rules to avoid redundant config parsing. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
3. aw_watcher_window/main.py:43
- Draft comment:
In clean_window_title(), regex patterns are recompiled on every call. Consider precompiling the regex patterns (possibly during config loading) to improve performance. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
Workflow ID: wflow_i0pKdKX8Sb5oBQe5
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
|
@AminZibayi thanks, and sorry this sat so long. I re-checked it against current master ( It doesn't cover your case. @ErikBjare: do you want watcher-side title rewriting at all? It permanently changes the raw data, whereas categories work at query time. If yes, I'd carry it as a |
|
@AminZibayi following up on the question above. Two weeks on with no design answer, I'm carrying the useful part of this internally instead of letting it sit: per-app title rewriting becomes an That means this branch won't be merged as-is (it conflicts with master in |
|
The carry is up: #175 adds |
You can configure regex-based title cleaning rules to modify window titles before they are sent to the server. This is useful for removing application-specific suffixes, temporary states (like unread message counts), or other noisy data from window titles, leading to cleaner and more accurate data aggregation.
Important
Add regex-based title cleaning rules to modify window titles before sending to server, with configuration and documentation updates.
clean_window_title()inmain.pyandget_title_cleaning_rules()inconfig.py.example-config.toml.~/.config/activitywatch/aw-watcher-window.toml.app,pattern, andreplacementfields.README.mdwith instructions for configuring title cleaning rules.This description was created by
for 18e1877. You can customize this summary. It will automatically update as commits are pushed.