Implement find in page functionality.#38
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements find-in-page functionality for the Bolt documentation browser, allowing users to search for text within documentation pages. The implementation includes UI components (toolbar with result counters and navigation buttons), state management for search queries and results, and JavaScript-based text highlighting adapted from Firefox iOS.
Key changes include:
- Added find-in-page state management through
SceneStatewith new actions and signals for queries, navigation, and result counts - Integrated a toolbar with previous/next navigation and result counter that appears when viewing documentation pages
- Implemented JavaScript-based text search and highlighting using Mozilla's FindInPage.js (under MPL license)
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updated license information to note that some source code may be under different licenses (MPL) |
| BoltFramework/Package.swift | Added resources directory to package configuration for JavaScript files |
| BoltFramework/BoltModuleExports/SceneState.swift | Added find-in-page actions and signals to scene state management |
| BoltFramework/BoltLookupUI/States/LookupRoutingState.swift | Wired search query to dispatch find-in-page action when viewing doc pages |
| BoltFramework/BoltLookupUI/Scenes/LookupSearchViewController.swift | Added find-in-page toolbar as input accessory view to search bar |
| BoltFramework/BoltLookupUI/Scenes/LookupList/FindInPageToolbar.swift | Implemented toolbar UI with result counter and navigation buttons for search bar |
| BoltFramework/BoltLookupUI/Scenes/FindInPageToolbarViewModel.swift | Created view model to manage toolbar state and button actions |
| BoltFramework/BoltLookupUI/Scenes/Content/ToolbarManager.swift | Extended toolbar manager to support find-in-page mode with dedicated controls |
| BoltFramework/BoltLookupUI/Scenes/Content/LookupContentViewController.swift | Added toolbar mode switching based on lookup list and doc page visibility |
| BoltFramework/BoltBrowserUI/Scenes/Browser/BrowserViewController.swift | Connected scene state find-in-page signals to browser view methods |
| BoltFramework/BoltBrowserUI/Scenes/Browser/BrowserView.swift | Implemented JavaScript injection and message handling for find-in-page operations |
| BoltFramework/BoltBrowserUI/Resources/FindInPage.js | Added JavaScript for text search, highlighting, and navigation (MPL licensed) |
| BoltFramework/BoltBrowserUI/MessageHandlers/FindInPageMessageHandler.swift | Created message handler to receive find results from JavaScript |
| BoltCombineExtensions/Sources/Publisher+weakAssign.swift | Added Combine extension for weak assignment to prevent retain cycles |
| .editorconfig | Added max line length configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e65f550 to
ce08be1
Compare
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.
No description provided.