feat: enhance filter display with persistent bordered status - #165
Conversation
- Add bordered filter status widget that remains visible after filter acceptance - Change filter input color from Yellow to Cyan for visual distinction - Update layout system to reserve dedicated space for active filter status - Ensure consistent visual styling between filter input and status widgets The filter status now displays as a bordered widget with 'Active Filter' title, matching the visual style of the input and providing clear persistent indication of active filters after acceptance with Enter key.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
📝 WalkthroughWalkthroughThe TUI application's layout system undergoes a refactor: color constants are standardized with suffix naming, the main layout function now accepts a Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/tui_app.rs`:
- Around line 1948-1976: The filter-status y coordinate uses plain subtraction
which can underflow on tiny terminals; update both create_main_layout and
render_filter_input to compute the y coordinate using saturating_sub(3) (e.g.,
area.y + area.height.saturating_sub(3)) instead of area.y + area.height - 3,
matching the existing create_filter_input_layout behavior; ensure any other
arithmetic producing area.y or height for the filter status uses saturating_sub
to avoid u16 underflow and invalid Rects.
- Use saturating_sub(3) instead of direct subtraction for y-coordinate calculation - Apply consistent arithmetic safety in both create_main_layout and render_filter_input - Fix constant naming from UI_CONTROLS_COLOR to FILTER_INPUT for consistency Prevents potential u16 underflow on tiny terminals and matches existing saturating pattern used throughout codebase for safe arithmetic operations.
|
Addressed CodeRabbit AI review comments:
All tests pass and clippy linting is clean. The fixes prevent potential u16 underflow on tiny terminals and follow existing safety patterns used throughout the codebase. |
|
Addressed CodeRabbit AI review comments:
All tests pass and clippy linting is clean. The fixes prevent potential u16 underflow on tiny terminals and follow existing safety patterns used throughout the codebase. |
Summary
Changes
The filter status now displays as a bordered widget with 'Active Filter' title, matching visual style of input and providing clear persistent indication of active filters after acceptance with Enter key.
Testing
Screenshots/Examples
[N/A - UI enhancement]
Checklist
Summary by CodeRabbit
New Features
Style