-
Notifications
You must be signed in to change notification settings - Fork 3
Fix blank canvas on pages without line annotations and add user guidance #371
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
Conversation
Handle pages without lines in updateTranscriptionImages by still loading and displaying the canvas even when there are no line annotations. Shows the full page image instead of returning early. Co-authored-by: cubap <1119165+cubap@users.noreply.github.com>
cubap
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also include a dismissible modal that the page has no lines with a line to the annotation interface to define lines manually.
Shows an alert when a page has no line annotations with a link to the annotation interface where users can manually define lines. The alert is dismissible by clicking the "Got it" button. Co-authored-by: cubap <1119165+cubap@users.noreply.github.com>
- Encode URL parameters to prevent injection vulnerabilities - Replace innerHTML with DOM element creation for better security - Add CSS via style element instead of inline styles - Add fallback for potential future public API on AlertContainer Co-authored-by: cubap <1119165+cubap@users.noreply.github.com>
Added in commit 65fa6e2. The modal appears when a page has no lines with a link to |
|
This illustrates some issues in annotator that I believe are being handled elsewhere. The |
Pages with no line annotations displayed blank instead of showing the canvas image.
updateTranscriptionImages()returned early whenthisLinewas undefined, preventing canvas setup.Changes
this.#page.items?.[0]is undefined, extract canvasID from page target viasetCanvasAndSelector(null, this.#page)and render full canvas/interfaces/annotator) with properly encoded project and page IDsSecurity
encodeURIComponent()to prevent injection vulnerabilitiesinnerHTML) for secure content rendering<style>element instead of inline stylesOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.