Repository navigation
Add advanced search and polish PrettySumatraPDF v1.0.2 - #16
Merged
Merged
Conversation
Add a minimal Inno Setup script for testing and a PowerShell helper that copies the webui to a short path (avoiding long-path issues), sets SHORT_WEBUI_SRC, and runs ISCC. Reorganize the v1.0.2 release notes into Search, Startup and Toolbar, and Annotations and Installer sections, and drop the build artifacts list.
- EnsureAreaVisibility now requires the full title bar and at least 120px of width to be visible, otherwise the window is moved to the work area. Session restore uses it and skips empty window positions. - RenderCache rejects invalid page numbers in RequestRendering and Render to avoid out-of-range requests. - Add SearchResults.* to premake and the VS2022 project and filters. - build.ts copies SumatraPDF-dll.exe to SumatraPDF.exe after the debug build. - Also adds an accidental installer build log (scripts/installer/iscc_build.log) that likely shouldn't be committed.
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved regressions in search correctness and responsiveness, document loading, toolbar initialization, and panel accessibility block approval.
19 open issues
Counting search cannot observe cancellation · New Asynchronous DDE open reorders navigation commands · New Search results and query state leak across documents · New Direct startup skips hybrid toolbar initialization · New Concurrent startup loads reuse the same window without tabs · New Regex direction changes use pattern length instead of match bounds · New Overlapping regex matches diverge from forward search · New Fixed editor height clips controls without scrolling · New Docked editor traps Tab navigation inside the panel · New Captionless editor has no replacement close control · New Recounting the entire document on every match navigation · New Document-wide FindNext blocks the UI during tree selection · New Arrow-key search selection loses tree focus · New Cached layout prevents initial hybrid toolbar positioning · New Trailing-space normalization corrupts regex patterns · New Regex results can bypass the nonempty selection contract · New Color blending darkens muted text and controls · New Clearing search leaves stale workers and native query text · New Host Escape handling prevents toolbar customization exit · New
What changed in this PR
This PR advances PrettySumatraPDF to v1.0.2, extending document search and refining the integration between its native Win32 interface and WebView2 controls.
Changes:
- Adds advanced search options, per-page result counts, and sidebar navigation with highlighting.
- Defers toolbar initialization, introduces asynchronous startup loading, and updates annotation panels, themes, and keyboard interactions.
- Updates build tooling, offline web-asset packaging, and release documentation.
| File | Description |
|---|---|
| vs2022/SumatraPDF.vcxproj.filters | Groups the new search-results files. |
| vs2022/SumatraPDF.vcxproj | Includes the search-results implementation. |
| vs2022/SumatraPDF-dll.vcxproj | Includes search results and regex sources. |
| src/wingui/WebView.cpp | Routes Escape and identifies bridge message sources. |
| src/Version.h | Sets version 1.0.2. |
| src/Theme.h | Declares annotation-panel theme colors. |
| src/Theme.cpp | Implements panel colors and changes muted text. |
| src/TextSearch.h | Declares advanced search and counting support. |
| src/TextSearch.cpp | Implements regex, whole-word matching, and counts. |
| src/SumatraStartup.cpp | Adds asynchronous startup loading. |
| src/SumatraPDF.cpp | Integrates deferred toolbars and docked sidebars. |
| src/SearchResults.h | Declares the results-sidebar interface. |
| src/SearchResults.cpp | Builds page-result rows and handles navigation. |
| src/SearchAndDDE.h | Declares page-targeted search helpers. |
| src/SearchAndDDE.cpp | Publishes counts, highlights results, and changes DDE loading. |
| src/resource.h | Adds the results-header control identifier. |
| src/RenderCache.cpp | Rejects invalid rendering page requests. |
| src/prettysumatra/BridgeDispatcher.h | Extends search synchronization and message routing. |
| src/prettysumatra/BridgeDispatcher.cpp | Handles search options and WebView readiness. |
| src/MainWindow.h | Adds search, sidebar, and WebView state. |
| src/MainWindow.cpp | Cleans up new controls and updates colors. |
| src/HomePage.cpp | Gates home-page visibility on readiness. |
| src/Favorites.cpp | Coordinates favorites with search results. |
| src/EditAnnotations.h | Exposes docked-panel layout and visibility helpers. |
| src/EditAnnotations.cpp | Converts the annotation editor to a themed child panel. |
| src/DisplayModel.cpp | Guards missing page information during zoom lookup. |
| src/AppTools.cpp | Improves restored-window visibility. |
| scripts/installer/README_INSTALLER.md | Updates build and installation instructions. |
| scripts/installer/PrettySumatraPDF.iss | Packages selected offline assets for v1.0.2. |
| scripts/installer/PrettySumatraPDF_minimal.iss | Adds a minimal test installer. |
| scripts/installer/prepare_and_build.ps1 | Stages web assets under a shorter path. |
| scripts/installer/iscc_build.log | Records an installer compilation attempt. |
| scripts/installer/build-webui-fonts.py | Generates optimized web fonts. |
| prettysumatra/webui/vendor/material-icons/material-icons.css | Uses the subset WOFF2 icon font. |
| prettysumatra/webui/vendor/inter/inter.css | Switches retained font weights to WOFF2. |
| prettysumatra/webui/toolbar.css | Adds responsive toolbar and search styling. |
| prettysumatra/webui/home.html | Refines keyboard access, styling, and readiness messages. |
| premake5.files.lua | Registers search-results sources for project generation. |
| ext/mujs/regexp.h | Declares offset-based regex execution. |
| ext/mujs/regexp.c | Implements execution from a supplied offset. |
| docs/releases/RELEASE_NOTES_v1.0.2.md | Documents release features. |
| docs/releases/RELEASE_DRAFT.md | Updates the release draft to v1.0.2. |
| cmd/util.ts | Expands Visual Studio detection and solution selection. |
| cmd/test-plugin.ts | Uses shared toolchain and solution discovery. |
| cmd/run-tests.ts | Uses shared solution selection. |
| cmd/build.ts | Selects the solution and copies the executable. |
| cmd/build-smoke.ts | Uses shared toolchain and solution discovery. |
| cmd/build-codeql.ts | Uses shared solution selection. |
| cmd/build-ci.ts | Uses shared solution selection. |
| cmd/build-ci-daily.ts | Uses shared solution selection. |
| cmd/build-all.ts | Uses shared toolchain and solution discovery. |
Review effort: Balanced
Annotations panel: add a vertical scrollbar, mouse wheel scrolling, an "Annotations" header, and Tab focus that hands off to the main window at the ends. Search: add FindFirstOnPage/FindNextOnPage for per-page highlighting; fix regex search (direction changes, match bounds, empty matches, trailing space); report progress while counting matches; clear search state and sidebar when the query is emptied or the document is closed; keep focus in the results tree on keyboard navigation. Startup/loading: create the hybrid toolbar lazily after the window is shown; allow async load only when tabs are enabled; load synchronously on DDE open. Misc: lighten disabled text color, let WebView handle Escape, add .copilotignore, and update the installer binary.
Replace the internal draft template with release highlights and a direct installer download link, noting that WebView assets are included for offline use.
There was a problem hiding this comment.
🟡 Changes recommended
Startup initialization, regex memory retention, project regeneration, and UI lifecycle regressions remain unresolved.
7 open issues
Add readiness fallback independent of hybrid-shell dispatch · New Show and initialize startup window independently of load success · New Avoid retaining duplicate page buffers for each regex match · New Add missing regex sources to the DLL target · New Restrict wheel interception to panel background events · New Exclude collapsed controls from minimum intrinsic height · New Invalidate layout cache when switching annotation panel tabs · New
19 resolved since last review
Overlapping regex matches diverge from forward search Regex direction changes use pattern length instead of match bounds Concurrent startup loads reuse the same window without tabs Direct startup skips hybrid toolbar initialization Search results and query state leak across documents Asynchronous DDE open reorders navigation commands Counting search cannot observe cancellation Host Escape handling prevents toolbar customization exit Clearing search leaves stale workers and native query text Color blending darkens muted text and controls Regex results can bypass the nonempty selection contract Trailing-space normalization corrupts regex patterns Cached layout prevents initial hybrid toolbar positioning Arrow-key search selection loses tree focus Document-wide FindNext blocks the UI during tree selection Recounting the entire document on every match navigation Captionless editor has no replacement close control Docked editor traps Tab navigation inside the panel Fixed editor height clips controls without scrolling
Review effort: Balanced
Comment on lines
+157
to
+159
| if (!win->homePageWebViewReady) { | ||
| return; | ||
| } |
Comment on lines
+313
to
+315
| if (canLoadAsync) { | ||
| StartLoadDocument(&args); | ||
| return args.win; |
Comment on lines
+1196
to
+1200
| <ClCompile Include="..\ext\mujs\regexp.c"> | ||
| <DisableSpecificWarnings>4310;%(DisableSpecificWarnings)</DisableSpecificWarnings> | ||
| </ClCompile> | ||
| <ClCompile Include="..\ext\mujs\utf.c"> | ||
| <DisableSpecificWarnings>4310;%(DisableSpecificWarnings)</DisableSpecificWarnings> |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Reset last layout state and relayout the window after updating tab visibility. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Add a navigation-completed hook to WebviewWnd (OnNavigationCompleted) wired to the WebView2 NavigationCompleted event. HomePage now uses a HomePageWebviewWnd subclass that calls the new NotifyHomePageWebViewReady once the page finishes loading, instead of relying only on the JS ready message. Also: - LoadArgs::Clone now copies all load flags and the engine. - Show the main window before reporting a load error when showWin is set and the window is hidden. - Link mujs regexp.c and utf.c in premake5.lua with warning 4310 disabled. - Update the VS project and filter files for prettysumatra sources, SearchResults and the notes file. - Rebuild the installer binary.
Strip trailing whitespace in cmd/util.ts, src/EditAnnotations.cpp and src/EditAnnotations.h (formatting only, no behavior change). Delete the stray scripts/installer/iscc_build.log build artifact.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary