Skip to content

feat(log): multi-term comma-separated search with :not() exclusion#3313

Open
limad wants to merge 3 commits into
jeedom:developfrom
limad:feat/log-search-multi-term
Open

feat(log): multi-term comma-separated search with :not() exclusion#3313
limad wants to merge 3 commits into
jeedom:developfrom
limad:feat/log-search-multi-term

Conversation

@limad
Copy link
Copy Markdown
Contributor

@limad limad commented May 5, 2026

Summary

Enhances the log filter search to support multiple comma-separated terms, each optionally negated with :not().

Before

Single-term search: error or :not(daemon)

After

Multi-term, comma-separated:

  • error,warning → show entries matching error OR warning
  • error,:not(daemon) → show entries matching error OR not matching daemon
  • :not(debug),:not(info) → hide debug and info entries

Logic

Each comma-separated term is evaluated independently against the log name. An entry is shown if any term matches (OR semantics). Each term can be negated individually.

Suggested changelog entry

Log filter now supports multiple comma-separated terms and per-term :not() exclusion (e.g. error,warning or error,:not(daemon)).

Known risks / side effects

  • Only desktop/js/log.js is modified — no PHP changes, no impact on other pages.
  • The existing single :not() syntax continues to work as before (backward compatible).
  • No plugin impact (filter is UI-only, client-side).

Notes

Types of changes

  • Bug fix
  • New feature (non-breaking change which adds functionality)
  • Breaking change
  • Documentation improvement

PR checklist

  • I have checked there is no other PR open for the same change.
  • I have read the contribution guidelines.
  • I grant the project the right to include and distribute the code under the GNU.
  • I have added tests to cover my changes.
  • I have verified that the code complies with the projects coding standards.
  • [Required for new sniffs] I have added MD documentation for the sniff.

Testing

  1. Open Logs page
  2. Type error,warning → only logs containing "error" or "warning" shown
  3. Type :not(debug) → logs NOT containing "debug" shown
  4. Type http,:not(daemon) → logs containing "http" OR not containing "daemon" shown
  5. Clear filter → all logs shown again

Enhance the log filter search to support multiple comma-separated terms.

Before: single term, optionally negated with ':not(term)'
After:  comma-separated terms, each independently negatable

Examples:
  - 'error,warning'         → show entries matching error OR warning
  - 'error,:not(daemon)'    → show entries matching error OR not matching daemon
  - ':not(debug),:not(info)' → hide debug and info entries

Implements the approach proposed in jeedom#3270 (Enhance search log filter with
term support), which also covered this global improvement.
@limad
Copy link
Copy Markdown
Contributor Author

limad commented May 7, 2026

Label suggestion for maintainers: changelog-feat + milestone 4.6 (non-breaking UI feature, one file only).

@Mips2648
Copy link
Copy Markdown
Collaborator

Mips2648 commented May 8, 2026

It is not yet planned because there are still at least 2 unresolved questions that need alignement with the team

  • validate the search format: comma or sapce or ...
  • identify others search box where it would make sense to have such feature to make sure to keep coherence in the UI

On top, we need to adapt the documentation as well, or to to define how to explain the feature in the UI directly.

Copy link
Copy Markdown
Collaborator

@Mips2648 Mips2648 left a comment

Choose a reason for hiding this comment

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

On top, this PR is a regression regarding var declaration

@limad
Copy link
Copy Markdown
Contributor Author

limad commented May 8, 2026

Thanks @Mips2648var regression fixed, all 6 declarations in the new handler are now const.

Understood on the broader points: happy to wait for team alignment on the separator format and the scope across other search boxes before this moves forward.

Comment thread desktop/js/log.js
}
const not = search.startsWith(":not(")
if (not) {
search = search.replace(':not(', '')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we need to handle also ), currently if we do :not(toto), search will search toto) and not toto

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants