Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial global search setup #713

Merged
merged 13 commits into from
Dec 22, 2020

Conversation

Komediruzecki
Copy link
Contributor

@Komediruzecki Komediruzecki commented Dec 4, 2020

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)

@Komediruzecki Komediruzecki force-pushed the feature/improve-global-search branch from 9ef263b to 8739912 Compare December 5, 2020 09:56
@Komediruzecki Komediruzecki self-assigned this Dec 5, 2020
@Komediruzecki Komediruzecki requested a review from Rokt33r December 5, 2020 14:35
Copy link
Member

@Rokt33r Rokt33r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some characters, (, break searching.

Also, this PR can be separated. If you don't mind could you split the PR? Otherwise, we have to wait till everything is ready.

So I think we can split like this:

  1. Show preview of searched notes
  2. Improve search function
  3. Navigate to a specific line from URL.

src/lib/storageRouter.ts Outdated Show resolved Hide resolved
src/lib/search/search.ts Outdated Show resolved Hide resolved
src/lib/routeParams.ts Outdated Show resolved Hide resolved
src/lib/routeParams.ts Outdated Show resolved Hide resolved
src/lib/colors.ts Outdated Show resolved Hide resolved
src/lib/colors.ts Outdated Show resolved Hide resolved
src/lib/colors.ts Outdated Show resolved Hide resolved
src/lib/colors.ts Outdated Show resolved Hide resolved
src/components/pages/WikiNotePage.tsx Outdated Show resolved Hide resolved
src/components/organisms/SearchModal.tsx Outdated Show resolved Hide resolved
@Rokt33r Rokt33r added the awaiting changes 🖊️ Pull request has been reviewed, but contributor needs to make changes. label Dec 6, 2020
@Komediruzecki Komediruzecki force-pushed the feature/improve-global-search branch 2 times, most recently from 01a2bf7 to 837a973 Compare December 8, 2020 21:42
@Komediruzecki Komediruzecki added the awaiting review ❇️ Pull request is awaiting a review. label Dec 9, 2020
@Komediruzecki Komediruzecki force-pushed the feature/improve-global-search branch from 837a973 to 02b0858 Compare December 9, 2020 16:43
@Komediruzecki Komediruzecki removed the awaiting changes 🖊️ Pull request has been reviewed, but contributor needs to make changes. label Dec 10, 2020
@Komediruzecki Komediruzecki force-pushed the feature/improve-global-search branch from 9a160d6 to 72dfd99 Compare December 12, 2020 12:00
Komediruzecki and others added 6 commits December 21, 2020 19:57
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

Fix multiline search
Add all previous features in multiline search
Focus at correct item on multiple items (local column)
Focus at correct editor position (line and column) via route hash
Add auto focus (scrollIntoView) if user selects the item below editor preview pane
@Rokt33r Rokt33r force-pushed the feature/improve-global-search branch from 4a38d57 to 24e68f3 Compare December 21, 2020 10:57
@Rokt33r Rokt33r merged commit a3c0de4 into BoostIO:master Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review ❇️ Pull request is awaiting a review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants