|
6 | 6 | #include <vector> |
7 | 7 |
|
8 | 8 | inline constexpr size_t CLIPPING_CHAPTER_TITLE_MAX = 48; |
9 | | -// CrossInk Notes: 1024 (upstream 512) ≈ 150-180 words per highlight, so long |
10 | | -// passages are not truncated. Since v1.5.0 clipping text lives outside the |
11 | | -// record (textOffset/textLength) and is read on demand, so a larger cap no |
12 | | -// longer costs resident RAM per clipping. |
| 9 | +// CrossInk Notes: 1024 (upstream 512) ≈ 150-180 words per highlight. Since |
| 10 | +// v1.5.0 clipping text lives outside the record (textOffset/textLength) and is |
| 11 | +// read on demand, so a larger *read* cap no longer costs resident RAM. |
13 | 12 | // |
14 | | -// Known, accepted one-way incompatibility. readFromFile() below rejects the |
15 | | -// WHOLE file if any record's textLength exceeds this cap, so a highlight over |
16 | | -// 512 characters written here cannot be read by stock CrossInk/CrossPoint: |
17 | | -// that book reads as having no clippings, and the next highlight made there |
18 | | -// rewrites the file with only that one — destroying the rest. Back in |
19 | | -// CrossNotes, pruneMissing() then drops the now-orphaned notes too. |
20 | | -// |
21 | | -// Judged not worth fixing: it needs a >512-character highlight AND a switch |
22 | | -// back to stock firmware AND a new highlight made there, and the damage is |
23 | | -// confined to that one book. The fix, if it is ever wanted, is to write 512 |
24 | | -// here (enough to locate the passage) and keep the full text in the notes |
25 | | -// file we own — see NoteStore, which already has the binding and the |
26 | | -// delete/move/prune hooks for it. |
27 | | -inline constexpr size_t CLIPPING_TEXT_MAX = 1024; |
| 13 | +// Upstream rejects the WHOLE file if any record's textLength exceeds 512, so |
| 14 | +// a long highlight written here made stock CrossInk read that book as empty; |
| 15 | +// a new highlight there then rewrote the file with only that one. New captures |
| 16 | +// are truncated to CLIPPING_TEXT_PORTABLE_MAX at the addClipping call site |
| 17 | +// (owned). This read cap stays 1024 so books we already wrote still load. |
| 18 | +// Existing long records are not rewritten. |
| 19 | +inline constexpr size_t CLIPPING_TEXT_MAX = 1024; // read: accept what we already wrote |
| 20 | +inline constexpr size_t CLIPPING_TEXT_PORTABLE_MAX = 512; // write: upstream's cap |
28 | 21 | inline constexpr uint16_t CLIPPING_MAX_PER_BOOK = 256; |
29 | 22 | inline constexpr uint16_t CLIPPING_MAX_PAGE_MATCHES = 16; |
30 | 23 |
|
|
0 commit comments