Better error message for linkify if too many elements are selected#2848
Better error message for linkify if too many elements are selected#2848jmcouffin merged 1 commit intopyrevitlabs:developfrom
Conversation
There was a problem hiding this comment.
PR Summary:
This PR enhances the error message when the linkify function encounters URLs exceeding the 2000 character limit. Instead of a generic "URL was too long and discarded" message, users now see the actual URL length and how many elements could fit within the limit versus the total selected. Also removes an unused DB import.
Review Summary:
The implementation correctly calculates the URL length accounting for separators and provides actionable feedback to users. The logic properly reconstructs the URL format (element[]=id with & separators) and matches the original construction pattern. Code follows Black formatting and PEP 8 naming conventions as required for IronPython 2.7. The fix directly addresses issue #2847 with a clean, straightforward solution.
No critical issues identified. ✅
Description
Adds a detailed count of displayable elements as well as total selected elements to the error message. Calculation is only run inside the if statement.
Checklist
Before submitting your pull request, ensure the following requirements are met:
pipenv run black {source_file_or_directory}Related Issues
If applicable, link the issues resolved by this pull request:
Additional Notes
Include any additional context, screenshots, or considerations for reviewers.
Thank you for contributing to pyRevit! 🎉