Skip to content

Conversation

Abhijay007
Copy link
Contributor

Related to: #5156

invoice.mp4

Copy link
Contributor

coderabbitai bot commented Jun 8, 2025

Walkthrough

The invoice list view is updated to enhance the search input styling with flex-shrink and width constraints. A "Clear All" button is conditionally added next to existing filter dropdowns, displayed only when any status, app, date filters, or search text are active. This button uses Bootstrap secondary styling, has a minimum width of 7rem, and includes a localized tooltip. A client-side script listens for clicks on this button; when triggered, it clears the hidden "SearchText" and "SearchTerm" input values in the filter form and submits the form to reset all filters. Minor whitespace and formatting adjustments are also made. No changes were made to exported or public entity declarations.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 09732f8 and beebe8d.

📒 Files selected for processing (1)
  • BTCPayServer/Views/UIInvoice/ListInvoices.cshtml (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • BTCPayServer/Views/UIInvoice/ListInvoices.cshtml

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Abhijay007
Copy link
Contributor Author

@rockstardev review required

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1602069 and a16046a.

📒 Files selected for processing (1)
  • BTCPayServer/Views/UIInvoice/ListInvoices.cshtml (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build_and_test
🔇 Additional comments (2)
BTCPayServer/Views/UIInvoice/ListInvoices.cshtml (2)

291-296: Well-implemented conditional rendering.

The conditional logic correctly shows the Clear All button when any filters are active (status, app, date, or search text). The button structure includes proper accessibility attributes and ID for JavaScript targeting.


298-317: Solid JavaScript implementation with proper error handling.

The script correctly handles the clear button functionality with:

  • Proper event initialization using DOMContentLoaded
  • Defensive null checks for DOM elements
  • Appropriate clearing of SearchText and SearchTerm fields
  • Form submission to apply the filter reset

The implementation follows good practices and should work reliably.

@Abhijay007 Abhijay007 changed the title Invoice clear filter (Feat) : Added "Clear All" filter to Invoices Jun 8, 2025
@dstrukt dstrukt self-requested a review June 10, 2025 00:48
@dstrukt
Copy link
Member

dstrukt commented Jun 10, 2025

Nice! Thanks for picking this up - will get a review in today or tomorrow!

Copy link
Member

@dstrukt dstrukt left a comment

Choose a reason for hiding this comment

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

Immediate nit:

  • The search bar shrinks with the addition of the Clear All button, but we should bump the column size up one to col-xxl-9 or append the Clear All button and not shrink the search. Defer to you on implementation.

The addition of the Clear button should wrap well onto the next line for mobile, but I need to test this explicitly along with functional tests.

Abhijay007 and others added 6 commits June 10, 2025 17:19
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Abhijay jain <Abhijay007j@gmail.com>
Signed-off-by: Abhijay jain <Abhijay007j@gmail.com>
Signed-off-by: Abhijay jain <Abhijay007j@gmail.com>
Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
@Abhijay007 Abhijay007 requested a review from NicolasDorier June 12, 2025 10:10
@NicolasDorier NicolasDorier merged commit 9a43139 into btcpayserver:master Jun 13, 2025
6 checks passed
MegalithicBTC pushed a commit to MegalithicBTC/btcpayserver that referenced this pull request Jun 27, 2025
Abhijay007 added a commit to Abhijay007/btcpayserver that referenced this pull request Jul 2, 2025
@Abhijay007 Abhijay007 deleted the InvoiceClearFilter branch July 2, 2025 18:22
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.

3 participants