[PR #3850] [MERGED] Global search live preview #6269

Closed
opened 2026-02-05 10:28:09 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/3850
Author: @ssddanbrown
Created: 11/14/2022
Status: Merged
Merged: 11/23/2022
Merged by: @ssddanbrown

Base: developmentHead: search_preview


📝 Commits (7)

  • 19a792b Started on a live-preview on global search input
  • 851ab47 Fixed input styles in search preview mode, added animation
  • 2c1f209 Replaced JS logic with CSS focus-within logic
  • c617190 Added global search input debounce and loading indicator
  • e7e83a4 Added new endpoint for search suggestions
  • 0e52898 Extracted keyboard nav. from dropdowns to share w/ search
  • fcff206 Adjusted global search preview for dark mode

📊 Changes

17 files changed (+366 additions, -107 deletions)

View changed files

📝 app/Http/Controllers/SearchController.php (+21 -3)
📝 resources/js/components/dropdown.js (+21 -57)
📝 resources/js/components/entity-selector.js (+1 -1)
resources/js/components/global-search.js (+82 -0)
📝 resources/js/components/index.js (+2 -0)
📝 resources/js/components/page-editor.js (+3 -1)
resources/js/services/keyboard-navigation.js (+89 -0)
📝 resources/js/services/util.js (+3 -3)
📝 resources/sass/_animations.scss (+7 -9)
📝 resources/sass/_blocks.scss (+8 -1)
📝 resources/sass/_forms.scss (+1 -1)
📝 resources/sass/_header.scss (+58 -16)
📝 resources/views/common/header.blade.php (+17 -4)
📝 resources/views/search/parts/entity-selector-list.blade.php (+0 -0)
resources/views/search/parts/entity-suggestion-list.blade.php (+21 -0)
📝 routes/web.php (+2 -2)
📝 tests/Entity/EntitySearchTest.php (+30 -9)

📄 Description

Addition of search results live preview while typing in global search box.

Related to #1235.

Todo

  • Proper Handling of empty search results
  • Maybe dedicated endpoint for easier results formatting and limiting.
  • Handle removal of preview on blur/click of list (via CSS focus-within?)
  • Correct input shading on suggestions show.
  • Disable browser history/suggestions by default to prevent visual conflict.
  • Provide method to show browser suggestions/history (Double click in input?)
  • Add debounce of input handling.
  • Arrow key and escape handling.
  • Dark mode check
  • Testing of any new endpoints

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BookStackApp/BookStack/pull/3850 **Author:** [@ssddanbrown](https://github.com/ssddanbrown) **Created:** 11/14/2022 **Status:** ✅ Merged **Merged:** 11/23/2022 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `development` ← **Head:** `search_preview` --- ### 📝 Commits (7) - [`19a792b`](https://github.com/BookStackApp/BookStack/commit/19a792bc1257ad60cad614d705f0861a2b0e4829) Started on a live-preview on global search input - [`851ab47`](https://github.com/BookStackApp/BookStack/commit/851ab47f8adb2d04555c28fceae371e038d90a40) Fixed input styles in search preview mode, added animation - [`2c1f209`](https://github.com/BookStackApp/BookStack/commit/2c1f20969ad3042b035425b488a754b60e6483a4) Replaced JS logic with CSS focus-within logic - [`c617190`](https://github.com/BookStackApp/BookStack/commit/c617190905fe74cae33bcbd1e90ec2340f68d9b7) Added global search input debounce and loading indicator - [`e7e83a4`](https://github.com/BookStackApp/BookStack/commit/e7e83a4109ab95e58f3772a2d9cd759b43ddbd3f) Added new endpoint for search suggestions - [`0e52898`](https://github.com/BookStackApp/BookStack/commit/0e528986abb94be2160b8d9c9d72a883a41bb60b) Extracted keyboard nav. from dropdowns to share w/ search - [`fcff206`](https://github.com/BookStackApp/BookStack/commit/fcff2068533b3d880d7f9e6a90b8c424803a3d00) Adjusted global search preview for dark mode ### 📊 Changes **17 files changed** (+366 additions, -107 deletions) <details> <summary>View changed files</summary> 📝 `app/Http/Controllers/SearchController.php` (+21 -3) 📝 `resources/js/components/dropdown.js` (+21 -57) 📝 `resources/js/components/entity-selector.js` (+1 -1) ➕ `resources/js/components/global-search.js` (+82 -0) 📝 `resources/js/components/index.js` (+2 -0) 📝 `resources/js/components/page-editor.js` (+3 -1) ➕ `resources/js/services/keyboard-navigation.js` (+89 -0) 📝 `resources/js/services/util.js` (+3 -3) 📝 `resources/sass/_animations.scss` (+7 -9) 📝 `resources/sass/_blocks.scss` (+8 -1) 📝 `resources/sass/_forms.scss` (+1 -1) 📝 `resources/sass/_header.scss` (+58 -16) 📝 `resources/views/common/header.blade.php` (+17 -4) 📝 `resources/views/search/parts/entity-selector-list.blade.php` (+0 -0) ➕ `resources/views/search/parts/entity-suggestion-list.blade.php` (+21 -0) 📝 `routes/web.php` (+2 -2) 📝 `tests/Entity/EntitySearchTest.php` (+30 -9) </details> ### 📄 Description Addition of search results live preview while typing in global search box. Related to #1235. ## Todo - [x] Proper Handling of empty search results - [x] Maybe dedicated endpoint for easier results formatting and limiting. - [x] Handle removal of preview on blur/click of list (via CSS focus-within?) - [x] Correct input shading on suggestions show. - [x] Disable browser history/suggestions by default to prevent visual conflict. - [x] Provide method to show browser suggestions/history (Double click in input?) - [x] Add debounce of input handling. - [x] Arrow key and escape handling. - [x] Dark mode check - [x] Testing of any new endpoints --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:28:09 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6269