-
Notifications
You must be signed in to change notification settings - Fork 21
feat: add allow_clickable_annotations_with_text_rendering option #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add a new parameter `allow_clickable_annotations_with_text_rendering` that allows annotations to remain clickable even when `render_text=True`. This is useful for applications that need both text selection capability and clickable annotation regions. When enabled: - Annotations have pointer-events enabled - Annotations use z-index 12 (above text layer at 11) - Click handlers are attached to annotations Note: Text selection will not work through annotation areas when this option is enabled. Defaults to False to maintain backward compatibility.
WalkthroughA new optional parameter Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🔇 Additional comments (8)
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 |
|
Hey @lfoppiano ,
I discovered that these two features are currently mutually exclusive - when text rendering is enabled, annotations lose their click handlers and pointer events. I understand the original design decision (prioritizing text selection over annotation clicks), so I've made this an opt-in feature that defaults to I'm happy to adjust the implementation based on your feedback - whether that's the parameter name, the approach, or anything else. Let me know what you think! |
Summary
This PR adds a new parameter
allow_clickable_annotations_with_text_renderingthat allows annotations to remain clickable even whenrender_text=True.Currently, when
render_text=True, annotations become non-interactive (pointer-events: none). This makes it impossible to have both text selection and clickable annotations in the same viewer.Changes
allow_clickable_annotations_with_text_renderingparameter (defaults toFalse)pointer-events: autoandz-index: 12(above text layer)Usage
Trade-off
Text selection will not work through annotation areas when this option is enabled.
Defaults to
Falseto maintain backward compatibility.Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.