Repository navigation
feat(figures): repair broken figure images and let you crop them - #17
Conversation
Auto-repairs hallucinated image tags to the page photo on import/reparse, lets the agent replace a single figure tag via use_page_image(caption=...), and adds a manual crop dialog in Page Review so any figure (fixed or not) can be cropped from the page photo and re-cropped later if needed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
| "d3-force": "^3.0.0", | ||
| "d3-selection": "^3.0.0", | ||
| "d3-zoom": "^3.0.0", | ||
| "cropperjs": "^1.6.3", |
There was a problem hiding this comment.
The new load-bearing cropperjs dependency was added only to package.json; the tracked Yarn v1 lockfile has no cropperjs resolution. A frozen install will reject the inconsistent manifest, while an ordinary install can silently rewrite the lockfile and resolve a different package graph. Regenerate and include frontend/yarn.lock with this dependency.
Prompt To Fix With AI
This is a comment left during a code review.
Path: frontend/package.json
Line: 15
Comment:
**Lockfile missing dependency**
The new load-bearing `cropperjs` dependency was added only to `package.json`; the tracked Yarn v1 lockfile has no `cropperjs` resolution. A frozen install will reject the inconsistent manifest, while an ordinary install can silently rewrite the lockfile and resolve a different package graph. Regenerate and include `frontend/yarn.lock` with this dependency.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Flagged by review as not needed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
wiki@develop now ships title as Small Text natively, so add_wiki_title_customizations() no longer needs a Property Setter to widen it, and the old assertion (exactly 1 setter) fails with 0. Assert idempotency (count doesn't grow on a second run) instead of a fixed count, so the test holds regardless of the upstream default. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Require read access to the source document before cropping or rewriting its page content (crop_page_figure was reachable with any other document's identifier). - Fix duplicate-tag replacement to target the clicked occurrence by position instead of always replacing the first textual match. - Move Wikify Import/File/Source Page lookups and the crop file write behind wikify/engine/store.py instead of querying them directly from the engine. - Switch FigureCropDialog to Frappe UI v3 useCall instead of the low-level call helper. - Use semantic surface/ink tokens for the figure-hover overlay instead of bg-black/text-white. - Regenerate frontend/yarn.lock so it resolves the cropperjs dependency.
|
Addressed all of Greptile'''s findings in 595221f:
Full backend suite + |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
What this does
Sometimes the PDF parser puts a broken/fake image in place of a real figure. This PR:
Hover over any figure in Page Review to crop/re-crop it: