Skip to content

Fix: Log level filter not applying in logs page#781

Merged
chubes4 merged 2 commits intoExtra-Chill:mainfrom
saraichinwag:fix/log-level-filter
Mar 10, 2026
Merged

Fix: Log level filter not applying in logs page#781
chubes4 merged 2 commits intoExtra-Chill:mainfrom
saraichinwag:fix/log-level-filter

Conversation

@saraichinwag
Copy link
Contributor

Problem

The log level dropdown and search field appeared to work but didn't actually filter the logs. Selecting a different level or typing in the search box didn't trigger any data refresh.

Root Cause

Filter state was stored on window.__dmLogsFilters as a hack to avoid prop drilling. LogsTable only read it once during initial render. When filters changed, there was no mechanism to trigger a re-render or refetch the data.

Solution

  • Lifted filter state up to LogsApp component with proper React useState
  • Pass filters and onFiltersChange as props to LogsFilters
  • Pass filters as prop to LogsTable
  • TanStack Query now properly detects filter changes and refetches with new parameters
  • Removed the window.__dmLogsFilters hack

Changes

  • LogsApp.jsx: Added state management for filters
  • LogsFilters.jsx: Accept filters via props instead of local state
  • LogsTable.jsx: Accept filters via props instead of reading from window

Testing

  • Filter changes now immediately trigger API calls with new parameters
  • No breaking changes to existing functionality

Tools now respect their declared contexts ('pipeline', 'chat', etc.) in the admin UI.
Previously, all tools were shown regardless of context, causing confusion.

Changes:
- ToolManager::get_tools_for_api() now accepts optional context parameter
- /tools REST endpoint supports context query parameter
- React useTools() hook defaults to 'pipeline' context
- Added contexts field to API response for transparency

Fixes inconsistency where chat-only tools appeared in pipeline step config.
The log level dropdown and search weren't triggering table refreshes.
State was stored on window object without any reactive connection.

Changes:
- Lifted filter state to LogsApp component
- Pass filters as props to LogsFilters and LogsTable
- Removed window.__dmLogsFilters hack
- Filters now properly trigger query refetch via TanStack Query

Fixes filter UI not affecting log results.
Copy link
Member

@chubes4 chubes4 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Lifting the logs filter state into React state is the right fix and removes the non-reactive window hack. The failing lint check appears to be unrelated to this PR and instead caused by homeboy-action being ahead of the released Homeboy CLI.

@chubes4 chubes4 merged commit 0920bee into Extra-Chill:main Mar 10, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants