M12: head Advanced Search results with the page label (#7870) #7871
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.46) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 460 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.367
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #7871"
general
weight: 0.35
mansur-akhmadi
What this changes
The Advanced Search panel (⇧⌘F) now heads each page's results with the page's label, not its physical number. In a book whose front matter is numbered i, ii, iii and the body 1, 2, 3, a hit on the fourth page was headed
Page 4; it is nowPage 1, the name the page box, the Pages panel, the Comments panel and the Fields panel already use for that page.The heading already used the
Page {label}string;search_ui::panelfilled it withp + 1. The panel now gets the document's pages (&info.pagesinstead ofinfo.pages.len()) and showsPageInfo::label, which the inspector always fills (the physical number for unlabelled pages, so documents without/PageLabelslook the same). A page index past the list falls back to the number, as before.Fixes #7870
How you verified it
cargo fmt --check -p pdfcraft-ui-eguicargo clippy -p pdfcraft-ui-egui --all-targets --no-deps -- -D warnings: clean. Without--no-deps, clippy 1.99.1 stops onclippy::collapsible_matchincrates/xfdf/src/xfdf.rs:326, a file this PR does not touch.cargo test -p pdfcraft-ui-egui: lib 1052 passed;it1934 passed, 10 failed, 4 ignored. The 10 are eightocr::tests,comments::the_selection_bar_stays_inside_the_pages_areaandediting::a_custom_property_whose_name_the_tools_refuse_is_listed_and_left_alone, the same set #7542 reports failing locally onmain; none touch the Search panel.viewer::advanced_search_heads_results_with_page_labels: labels a two-page document i, ii, searches, and expects the headingsPage iandPage iiand noPage 1/Page 2. With the twosrcfiles reverted it fails atget_by_label("Page i"); restored, it passes, together withadvanced_search_lists_results_with_context.cargo xtask parity,cargo xtask layers: OK.cargo check -p pdfcraft-ui-egui --target wasm32-unknown-unknown: OK.Never-crash
unwrap/expect/panic!/unreachable!/todo!outside testspage_info.get(p))unsafeProvenance
Security
Parity and reach
view.advanced-searchnotes and evidence updated; status stayspartial(other documents, folders and indexes are still missing).text_findkeeps reporting physical page numbers anddoc_infolists each page's label, so an agent can map one to the other; the notes say so. I did not add a label totext_find's output.Anything a reviewer should look at first
Not changed: two other places put a physical number into the
Page {label}string,dialogs/pageboxes.rs:213(Set Page Boxes) andworkflows/combine_grid/card.rs:49(Combine cards, which show files that are not open, so there is noDocInfoto read). No screenshot: the only visible change is the heading text, which the test asserts.<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
Advanced Search results now display each page’s label when available, including labels such as Roman numerals, instead of always showing the physical page number.
* Pages without a label continue to display their one-based page number.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->