Skip to content

Migrate annotation changes - #1554

Open
schu96 wants to merge 9 commits into
internetarchive:masterfrom
schu96:annotation-merge
Open

schu96 wants to merge 9 commits into
internetarchive:masterfrom
schu96:annotation-merge

Conversation

@schu96

@schu96 schu96 commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Migrated annotation code to work with newly improved main branch

@codecov

codecov Bot commented Jun 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 34.04255% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.18%. Comparing base (882adbc) to head (9f46490).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/util/TextSelectionManager.js 34.28% 22 Missing and 1 partial ⚠️
src/BookReader.js 27.27% 7 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1554      +/-   ##
==========================================
+ Coverage   63.81%   65.18%   +1.37%     
==========================================
  Files          69       69              
  Lines        6256     6205      -51     
  Branches     1391     1383       -8     
==========================================
+ Hits         3992     4045      +53     
+ Misses       2225     2117     -108     
- Partials       39       43       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cdrini cdrini left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Got through the first half ; will finish the rest later today!

Comment thread src/util/TextSelectionManager.js Outdated
Comment thread src/util/TextSelectionManager.js Outdated
Comment thread src/util/TextSelectionManager.js Outdated
Comment thread src/util/TextSelectionManager.js Outdated
Comment thread src/util/TextSelectionManager.js Outdated
Comment thread src/util/TextSelectionManager.js Outdated
Comment thread src/util/TextSelectionManager.js Outdated
Comment thread src/util/TextSelectionManager.js Outdated
Comment thread src/util/TextSelectionManager.js Outdated
@schu96
schu96 force-pushed the annotation-merge branch 2 times, most recently from b205c70 to 1ac3b87 Compare July 13, 2026 03:21
@schu96
schu96 force-pushed the annotation-merge branch from 467afe4 to 2ed063b Compare August 8, 2026 22:03
Comment thread src/plugins/plugin.annotations.js
Comment thread src/plugins/plugin.annotations.js Outdated
Comment thread src/plugins/plugin.annotations.js Outdated
Comment thread src/plugins/plugin.annotations.js Outdated
Comment thread src/plugins/plugin.annotations.js Outdated
Comment thread src/util/scroll-lock.js
Comment thread src/util/TextSelectionManager.js Outdated
if (!this.activeHighlightNodes) { // highlight selection if not already done
this.handleHighlightSave();
}
this.br.plugins.textSelection?.textSelectionManager.showAnnotationModal(this.activeHighlightNodes, anchorEl);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we need to create the plugin annotations class matching the other plugins, so that we can attach the annotation-specific methods/data/logic to that alone.

That also keeps/fulfills the promise of BR plugins being optional. Letting people load the plugin files only if they support/want to support the associated functionality.

Suggested change
this.br.plugins.textSelection?.textSelectionManager.showAnnotationModal(this.activeHighlightNodes, anchorEl);
this.br.plugins.annotations.showAnnotationModal(this.activeHighlightNodes, anchorEl);

Comment thread src/util/TextSelectionManager.js Outdated
Comment thread src/util/TextSelectionManager.js Outdated
endTextNode.parentElement.classList.contains("BRhighlight")) {
return;
const existingMarks = [];
const walker = document.createTreeWalker(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there anyway we can re-use some of the helper methods we have? Not sure.

@cdrini

cdrini commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

UI feedback:

  1. CSS tweaks for modal
  2. chrome mobile issues

@schu96
schu96 marked this pull request as ready for review September 17, 2026 21:23
cdrini and others added 2 commits September 24, 2026 16:46
Co-Authored-By: Sandy Chu <sandy.chu.40@gmail.com>
Co-authored-by: Sandy Chu <schu96@users.noreply.github.com>
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.

2 participants