Add column filter row with operator-aware filtering#71
Merged
Conversation
Introduce per-column request filters for method, path, status, and time while preserving the legacy main filter behavior. Implement numeric comparison and range parsing for status/time, including operator-only expressions as no-op filters so incomplete input does not hide all rows. This enables combining multiple column filters at once and adds regression tests for comparisons, ranges, and clear behavior.
Expand filter-mode key handling to navigate request filter columns with left/right arrows, Tab, and Shift+Tab. Keep backspace handling robust by preserving the key set used in filter mode and assert behavior against the active request column filter in tests. This keeps keyboard filtering predictable while editing focused column inputs.
Replace the single header filter display with a dedicated filter row below column headers and render per-column inputs. Keep status/time filter inputs right-anchored while allowing wider filter expressions by borrowing space from the path filter area. Support blinking cursor placement and operator guidance text. Add mouse support for filter-row clicks, align hitboxes with the new layout, and update header/help behavior to reflect column-based filtering.
Refactor renderer color usage to rely on named screen constants instead of raw color-pair integers. Update ANSI mapping, details rendering segments, and scrollbar drawing to use semantic identifiers so color intent is explicit and changes are easier to audit. This reduces hidden coupling to pair indices and keeps styling changes safer across renderers.
Allow clicking sortable request headers to toggle sorting for method, status, and time while leaving path unsortable. Render directional arrows on the active sorted column header and persist ascending/descending direction per selected column. Keep keyboard sort cycling intact, integrate mouse hit-testing for header row clicks, and add tests for toggling behavior and path no-op semantics.
Make request-header sorting tri-state: first click uses the default direction, second click reverses it, and third click clears the column arrow by resetting to TIMESTAMP ASC. Extract request filter-row rendering and layout into a dedicated RequestFilterBar renderer so RequestList stays focused on table rows and headers. Reuse that layout in MouseHandler to keep click hit testing aligned with rendered filter cells. Add and extend tests for third-click reset behavior in both sort and mouse header interactions.
23a609b to
9cabd6a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a dedicated per-column filtering workflow in the request
list and follows through with keyboard/mouse UX, filter expression behavior,
renderer cleanup, and request-header mouse sorting improvements.
What changed
1) Column filter state and matching
Statefor:method,path,status,timestatusandtime:>,>=,<,<=50-100>,<,>=,<=) is treated as no-op(ignored), so incomplete expressions do not hide all rows.
2) Filter mode keyboard behavior
Tab/Shift+Tab3) Dedicated filter row + mouse support
Press f to start filtering, operators allowed: > >= < <= 50-1004) Visual and cleanup improvements
drift.
renderer/ansi.rbrenderer/details.rbrenderer/scrollbar.rb5) Request header sorting via mouse clicks
METHOD,STATUS,and
TIME.PATHremains intentionally unsortable.TIMESTAMP ASCTests
Added/updated tests:
test/test_request_column_filters.rbtest/test_input_handler_filter.rbtest/test_mouse_handler_filter_clicks.rbtest/test_sort_toggle.rbValidation run:
bundle exec standardrbbundle exec rake testBoth pass locally.