[PR #713] [MERGED] Add initial global search setup #860

Closed
opened 2026-03-03 00:23:32 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BoostIO/BoostNote-App/pull/713
Author: @Komediruzecki
Created: 12/4/2020
Status: Merged
Merged: 12/22/2020
Merged by: @Rokt33r

Base: masterHead: feature/improve-global-search


📝 Commits (10+)

  • ee9fb64 Add initial global search setup
  • 14e0924 Fix initial focus preview out of focus if selection is below preview
  • 1f19c89 Refactor SearchModal
  • 14209c7 Improve style of search modal
  • 2809ab1 Implement preview control
  • 24e68f3 Adjust layout style
  • 833a6a3 Style search modal note result item component
  • 2370c1b Fix first line search bug
  • f2310f2 Discard comments in lib/search
  • 7efd4b3 Apply overflow to container to trim coners of preview

📊 Changes

18 files changed (+924 additions, -85 deletions)

View changed files

📝 src/components/PreferencesModal/styled.tsx (+21 -5)
📝 src/components/molecules/SearchModalNoteResultItem.tsx (+243 -25)
📝 src/components/organisms/NoteDetail.tsx (+13 -4)
📝 src/components/organisms/NoteStorageNavigator.tsx (+4 -6)
📝 src/components/organisms/SearchModal.tsx (+369 -37)
📝 src/components/pages/NotePage.tsx (+22 -1)
📝 src/components/pages/WikiNotePage.tsx (+33 -2)
src/lib/colors.ts (+40 -0)
📝 src/lib/keyboard.ts (+11 -0)
src/lib/search/search.ts (+91 -0)
📝 src/lib/storageRouter.ts (+16 -3)
📝 src/lib/string.ts (+8 -0)
📝 src/lib/styled/BaseTheme.ts (+8 -0)
📝 src/themes/dark.ts (+9 -0)
📝 src/themes/legacy.ts (+9 -1)
📝 src/themes/light.ts (+9 -1)
📝 src/themes/sepia.ts (+9 -0)
📝 src/themes/solarizedDark.ts (+9 -0)

📄 Description

Add tag colors setup (#219, #629, #681, #570):

  • Add search functionality and result data structures
  • Add preview of found items, highlighted style, the rows of found items
  • Add note preview
  • Add selection of items in search
  • Add text highlight in editor preview
  • Add editor preview focus
  • Add editor preview while clicking on found item
  • Add better ID management and state update fix
  • Add some stability updates (max searched content, max result line length)
  • Add double click on search item to lead to focused item in editor
  • Add focusLine number for editor to route params
  • Add better colors across themes for search

General functionality:

Currently searches throught the content only (with some restrictions).
Setup for title/tags is commented out and can be added (title/tags highlighted etc) easily
When user clicks on any found item inside one note, that item is focused in preview (as seen in images below)
When user double clicks on an item in found items list of note, focused navigation takes place (navigates to note and focus the selected line in editor), the search dialog is closed

Currently the binding is still CTRL+P for searching globally, but we could easily replace this with CTRL+SHIFT+F for global and CTRL+F for local search (already set).

Restrictions:
First 10k lines of each note searched

Todo:

  • Add global replace functionality
  • Add content only, title only, tag only (or combinations)
  • See mock for focus at first found item example (needs specification)
  • Navigate Button
  • Global search as menu item (so no shortcut is needed for using it)

Few search examples:

ProtoV1DarkSearch
ProtoV1DarkSearchLightEditor
ProtoV1LightSearch
ProtoV1SepiaSearch

Popup on hover when line is too long so it won't show the whole line
ProtoV1ShowingPopupOfAllTextIfLineTooLong

Test:

  • In electron Linux App (dev)
  • In electron Linux App production version (appImage)

🔄 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/BoostIO/BoostNote-App/pull/713 **Author:** [@Komediruzecki](https://github.com/Komediruzecki) **Created:** 12/4/2020 **Status:** ✅ Merged **Merged:** 12/22/2020 **Merged by:** [@Rokt33r](https://github.com/Rokt33r) **Base:** `master` ← **Head:** `feature/improve-global-search` --- ### 📝 Commits (10+) - [`ee9fb64`](https://github.com/BoostIO/BoostNote-App/commit/ee9fb64a877298aaddaa77af5dd3307c332abe10) Add initial global search setup - [`14e0924`](https://github.com/BoostIO/BoostNote-App/commit/14e09244e6e9d948b8e5af8c522a49677128a0fb) Fix initial focus preview out of focus if selection is below preview - [`1f19c89`](https://github.com/BoostIO/BoostNote-App/commit/1f19c89fb6ff089983be5fec7f1766b5a7f45ab0) Refactor SearchModal - [`14209c7`](https://github.com/BoostIO/BoostNote-App/commit/14209c70bbfc4f07150a9edd98c74185f243060f) Improve style of search modal - [`2809ab1`](https://github.com/BoostIO/BoostNote-App/commit/2809ab1cc17a08610a2502acbf76643fafafbe61) Implement preview control - [`24e68f3`](https://github.com/BoostIO/BoostNote-App/commit/24e68f3247c797a41d82cda25ecbf038d9a69015) Adjust layout style - [`833a6a3`](https://github.com/BoostIO/BoostNote-App/commit/833a6a381d5fa0ca869caa99d2cc1980253e60db) Style search modal note result item component - [`2370c1b`](https://github.com/BoostIO/BoostNote-App/commit/2370c1b44b74f0099911eee1ff0a7f999981e9fd) Fix first line search bug - [`f2310f2`](https://github.com/BoostIO/BoostNote-App/commit/f2310f2fa93271b90b1e42f4b4f2f7c69d2641ce) Discard comments in lib/search - [`7efd4b3`](https://github.com/BoostIO/BoostNote-App/commit/7efd4b34ee7e9cdf9cf6f8ae301cb55cccfe549c) Apply overflow to container to trim coners of preview ### 📊 Changes **18 files changed** (+924 additions, -85 deletions) <details> <summary>View changed files</summary> 📝 `src/components/PreferencesModal/styled.tsx` (+21 -5) 📝 `src/components/molecules/SearchModalNoteResultItem.tsx` (+243 -25) 📝 `src/components/organisms/NoteDetail.tsx` (+13 -4) 📝 `src/components/organisms/NoteStorageNavigator.tsx` (+4 -6) 📝 `src/components/organisms/SearchModal.tsx` (+369 -37) 📝 `src/components/pages/NotePage.tsx` (+22 -1) 📝 `src/components/pages/WikiNotePage.tsx` (+33 -2) ➕ `src/lib/colors.ts` (+40 -0) 📝 `src/lib/keyboard.ts` (+11 -0) ➕ `src/lib/search/search.ts` (+91 -0) 📝 `src/lib/storageRouter.ts` (+16 -3) 📝 `src/lib/string.ts` (+8 -0) 📝 `src/lib/styled/BaseTheme.ts` (+8 -0) 📝 `src/themes/dark.ts` (+9 -0) 📝 `src/themes/legacy.ts` (+9 -1) 📝 `src/themes/light.ts` (+9 -1) 📝 `src/themes/sepia.ts` (+9 -0) 📝 `src/themes/solarizedDark.ts` (+9 -0) </details> ### 📄 Description Add tag colors setup (#219, #629, #681, #570): - Add search functionality and result data structures - Add preview of found items, highlighted style, the rows of found items - Add note preview - Add selection of items in search - Add text highlight in editor preview - Add editor preview focus - Add editor preview while clicking on found item - Add better ID management and state update fix - Add some stability updates (max searched content, max result line length) - Add double click on search item to lead to focused item in editor - Add focusLine number for editor to route params - Add better colors across themes for search General functionality: Currently searches throught the content only (with some restrictions). Setup for title/tags is commented out and can be added (title/tags highlighted etc) easily When user clicks on any found item inside one note, that item is focused in preview (as seen in images below) When user double clicks on an item in found items list of note, focused navigation takes place (navigates to note and focus the selected line in editor), the search dialog is closed Currently the binding is still CTRL+P for searching globally, but we could easily replace this with CTRL+SHIFT+F for global and CTRL+F for local search (already set). Restrictions: First 10k lines of each note searched Todo: - [ ] Add global replace functionality - [x] Add content only, title only, tag only (or combinations) - [x] See mock for focus at first found item example (needs specification) - [ ] Navigate Button - [ ] Global search as menu item (so no shortcut is needed for using it) Few search examples: ![ProtoV1DarkSearch](https://user-images.githubusercontent.com/18196945/101221517-23dbed80-3688-11eb-93f1-dba8def1f695.png) ![ProtoV1DarkSearchLightEditor](https://user-images.githubusercontent.com/18196945/101221519-25a5b100-3688-11eb-9fc7-0b7a669e3ca1.png) ![ProtoV1LightSearch](https://user-images.githubusercontent.com/18196945/101221525-276f7480-3688-11eb-8c65-15834ce99151.png) ![ProtoV1SepiaSearch](https://user-images.githubusercontent.com/18196945/101221529-29393800-3688-11eb-80ff-1045696db09d.png) Popup on hover when line is too long so it won't show the whole line ![ProtoV1ShowingPopupOfAllTextIfLineTooLong](https://user-images.githubusercontent.com/18196945/101221533-2a6a6500-3688-11eb-9742-c6d3db428d3d.png) Test: - In electron Linux App (dev) - In electron Linux App production version (appImage) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 00:23:32 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/BoostNote-App#860
No description provided.