Skip to content

feat: enhance filter display with persistent bordered status - #165

Merged
hrzlgnm merged 5 commits into
mainfrom
feat/impove-filter-popup-behavior
Feb 10, 2026
Merged

hrzlgnm merged 5 commits into
mainfrom
feat/impove-filter-popup-behavior

Conversation

@hrzlgnm

@hrzlgnm hrzlgnm commented Feb 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • 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

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

  • All 192 tests pass
  • Clippy linting passes with no warnings
  • Code follows project formatting standards
  • Manual testing confirms proper filter status display behavior

Screenshots/Examples

[N/A - UI enhancement]

Checklist

  • Code follows project style guidelines
  • All tests pass
  • Clippy linting passes
  • Conventional commit format used
  • Manual testing completed

Summary by CodeRabbit

  • New Features

    • Added a dedicated filter status display area that conditionally appears when filters are active, providing clearer feedback on active filtering operations.
  • Style

    • Improved color consistency across UI controls, status messages, and interface elements for enhanced visual coherence.

- 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.
@hrzlgnm

hrzlgnm commented Feb 10, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@github-actions github-actions Bot added the enhancement New feature or request label Feb 10, 2026
@coderabbitai

coderabbitai Bot commented Feb 10, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Feb 10, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The TUI application's layout system undergoes a refactor: color constants are standardized with suffix naming, the main layout function now accepts a has_filter_status parameter controlling an optional filter-status area rendering, and the filter-status renderer accepts explicit area coordinates. Tests updated accordingly.

Changes

Cohort / File(s) Summary
Color Constant Standardization
src/tui_app.rs
Renamed color constants (STATUS_OKSTATUS_OK_COLOR, STATUS_ERRORSTATUS_ERROR_COLOR) and introduced UI_CONTROLS_COLOR for consistent styling references across render functions.
Layout Function Signature & Structure
src/tui_app.rs
Modified create_main_layout to accept has_filter_status parameter; extended MainLayout struct with filter_status_area: Option<Rect> field; updated all call sites to compute and pass filter status state.
Render Function Signatures
src/tui_app.rs
Changed render_filter_status to accept explicit area parameter; updated all rendering paths to pass appropriate layout areas and conditionally render filter-status panels using layout.filter_status_area.
Test Updates
src/tui_app.rs
Updated test calls to create_main_layout with has_filter_status flag; adjusted assertions for filter_status_area presence; updated color constant references in test expectations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🎨 Layout refactored, colors named with care,
Filter status knows exactly where,
Signatures changed, but the vision stays clear—
Oh boy, someone's gonna get fired for these API gear! 🔧

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main enhancement: adding a persistent bordered filter status widget while updating visual styling. It directly reflects the primary changes in the PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/impove-filter-popup-behavior

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@hrzlgnm

hrzlgnm commented Feb 10, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Feb 10, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Full review triggered.

@hrzlgnm

hrzlgnm commented Feb 10, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Feb 10, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

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.

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.

Comment thread src/tui_app.rs
- 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.
@hrzlgnm

hrzlgnm commented Feb 10, 2026

Copy link
Copy Markdown
Owner Author

Addressed CodeRabbit AI review comments:

  • Fixed integer underflow issue by using instead of direct subtraction in both and functions
  • Ensured consistent arithmetic safety throughout the codebase
  • Corrected constant naming from to for consistency

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.

@hrzlgnm

hrzlgnm commented Feb 10, 2026

Copy link
Copy Markdown
Owner Author

Addressed CodeRabbit AI review comments:

  • Fixed integer underflow issue by using saturating_sub(3) instead of direct subtraction in both create_main_layout and render_filter_input functions
  • Ensured consistent arithmetic safety throughout the codebase

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.

@hrzlgnm
hrzlgnm enabled auto-merge (squash) February 10, 2026 20:48
@hrzlgnm
hrzlgnm merged commit c525ec6 into main Feb 10, 2026
22 checks passed
@hrzlgnm
hrzlgnm deleted the feat/impove-filter-popup-behavior branch February 10, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant