Conversation
Co-authored-by: cubap <1119165+cubap@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add TPEN interface for image annotation recording
Add browser-only line detection components and TPEN 3 annotation interface
Feb 20, 2026
Member
|
@copilot add a netlify deployment on PRs so we can see what the changes are |
Co-authored-by: cubap <1119165+cubap@users.noreply.github.com>
Author
Done in commit 9a40f27. Added:
Two repository secrets need to be configured for the workflow to succeed: |
Copilot
AI
changed the title
Add browser-only line detection components and TPEN 3 annotation interface
Add browser-only line detection components, TPEN 3 annotation interface, and Netlify PR previews
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the foundation of this repo as a multi-component line detection library with a TPEN 3 interface for recording detected lines as annotations — all running entirely in the browser, no backend required.
Components (
components/line-detection/)detection.js— Three exported async detection strategies, all operating on the Canvas 2D API:detectLines()— horizontal projection profiledetectLinesWithBusyness()— block-level horizontal colour-change analysisdetectHandwritingLines()— combined: morphological region isolation → busyness per region, with fallback to full-image busynessAll return
Array<{x, y, width, height}>in image-pixel coordinates.index.js—<handwriting-line-detector>Custom Element:Key departure from TPEN-interfaces PR #493: removes the
localhost:3009CORS proxy (backend dependency) — images are loaded withcrossOrigin="anonymous", which works against IIIF-compliant servers. Uses DOM construction (notinnerHTML) for user-controlled content.TPEN 3 Interface (
interfaces/line-detection/)Standalone page wired to TPEN 3 services. Usage:
Flow:
localStorage(same mechanism as TPEN-interfaces); redirects to TPEN 3 login if missing/expiredAnnotationPagefrom TPEN services API; resolves the canvas and image URL<handwriting-line-detector>on the imagemotivation: "transcribing",FragmentSelectorin canvas-coordinate space) viaPUT /project/:id/page/:idCoordinates are scaled from image-pixel space to canvas space before saving, consistent with TPEN 3 conventions.
Netlify PR Previews
.github/workflows/netlify-preview.yml— triggers on every PR targetingmain, deploys the static site to Netlify, and posts a preview URL comment on the PR (mirrors theTPEN-interfacespattern). RequiresNETLIFY_AUTH_TOKENandNETLIFY_SITE_IDrepository secrets.netlify.toml— configures Netlify to serve the repo root directly with no build step (pure static HTML/JS site).index.html— root landing page for the Netlify preview listing available components and interfaces, with a quick-start code snippet for the<handwriting-line-detector>element.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.