(fix) preserve passage highlights across related questions - #5
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5bfc24c1b2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 46f106e54f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const images = [...passage.querySelectorAll("img")].map((image) => [ | ||
| image.getAttribute("src"), | ||
| image.getAttribute("srcset"), | ||
| image.getAttribute("alt"), | ||
| ]); |
There was a problem hiding this comment.
Fingerprint all non-text passage media
When two passages have identical normalized text and <img> attributes but differ through inline SVG, canvas, or object content, this identifier collides and reuses the first passage's sealed baseline. A saved highlight unique to the second passage is then treated as a fresh reader highlight and remains visible. Fresh evidence after the earlier comment is that the follow-up fingerprints only img elements, leaving other non-text media unrepresented; include stable identity for all supported passage media or use a passage-specific identifier.
Useful? React with 👍 / 👎.
Summary
Root cause
Clean Slate collected passage and question highlights under one baseline keyed only by question ID. When AAMC advanced to another question from the same passage, the new question baseline treated the reader's carried passage highlights as annotations from the completed attempt and removed them.
Verification
pnpm check— 139 unit tests and 57 Chrome tests, plus lint, typecheck, production build, and release auditpnpm packagepnpm audit:releaseunzip -t release/mkit-0.2.2.zip(PR written by Codex)