fivem icon indicating copy to clipboard operation
fivem copied to clipboard

feat(conhost-v2): add log filter to console

Open DaniGP17 opened this issue 8 months ago • 2 comments

Goal of this PR

Add a text input field to allow users to filter the displayed logs in the console. This improves usability by enabling users to search for specific log entries or categories quickly.

Whenever I've wanted to search for specific logs, I've had to open the log in a text editor, and this makes it much more convenient to search for something specific throughout the console.

https://github.com/user-attachments/assets/cd9b5a6b-08d9-4af7-b216-b6b965127b4b

How is this PR achieving the goal

Created a FilterBuf buffer to store the filter text inputted by the user, then modified the log rendering loop to check if the FilterBuf is empty, if not, display only log entries or categories that contain the filter text.

This PR applies to the following area(s)

FiveM

Successfully tested on

Platforms: Window

Checklist

  • [x] Code compiles and has been tested successfully.
  • [x] Code explains itself well and/or is documented.
  • [x] My commit message explains what the changes do and what they are for.
  • [x] No extra compilation warnings are added by these changes.

DaniGP17 avatar Jun 07 '25 14:06 DaniGP17

This needs some adjustments to not break the text selection feature when filtering is active. Item rendering should still use the ImGUI clipper while filtering. Nice change though!😄

tens0rfl0w avatar Jun 07 '25 15:06 tens0rfl0w

This needs some adjustments to not break the text selection feature when filtering is active. Item rendering should still use the ImGUI clipper while filtering. Nice change though!😄

I'll check that, thanks for pointing that out

DaniGP17 avatar Jun 07 '25 15:06 DaniGP17