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

improve PosterHall search by adjusting fuse.js options + related #1460

Merged
merged 21 commits into from
May 28, 2021

Conversation

mike-lvov
Copy link
Contributor

@mike-lvov mike-lvov commented May 27, 2021

Note: This is a re-created PR (to fix CI issues/etc) for the work tested & developed by @yarikoptic in #1443

Edit: While the original PR accidentally overwrote the commit history, that has since been fixed and restored. Details in #1460 (comment)


This is basically a copy of #1443 + some additions/tweaks.

The reason for copying it was to test it & slightly clean up the code

closes #1391
closes #1453

Original PR Description

At large closes #1391 (Edit by @0xdevalias: also closes https://github.com/sparkletown/internal-sparkle-issues/issues/745) although remains notably suboptimal. With settings @margulies came up with seems to go a few steps further than my exploration (initial commit)

  • additional explicit trimming of the search query (we aren't into Whitespace here aren't we? but adding a space trailing space has an immediate detrimental effect)
  • split by space into words and search for each within $and across all keys. See below for more info on how plain fuse.js seems not capable of that
  • allow for " " to enclose phrase to not be split

With the above changes search becomes pragmatically useful! That splitting resolved following gotchas:

  • LastName FirstName would return no result whenever FirstName LastName is ok.
  • results often make no real sense from UX PoV: e.g. there is a poster by Tsai with "connectivity" in the title. Entering Tsai - shows the poster. Entering "Tsai connectivity" shows bunch of posters none of which is of Tsai

edits:

@mike-lvov mike-lvov requested a review from a team May 27, 2021 13:40
@mike-lvov mike-lvov self-assigned this May 27, 2021
@mike-lvov mike-lvov temporarily deployed to feature-preview May 27, 2021 13:40 Inactive
@codeclimate
Copy link

codeclimate bot commented May 27, 2021

Code Climate has analyzed commit 95f4c39 and detected 3 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1
Duplication 2

View more on Code Climate.

@github-actions
Copy link

github-actions bot commented May 27, 2021

Visit the preview URL for this PR (updated for commit 11cca35):

https://co-reality-staging--preview-pr-1460-601g4q77.web.app

(expires Fri, 11 Jun 2021 08:04:55 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@mike-lvov mike-lvov temporarily deployed to feature-preview May 27, 2021 14:04 Inactive
Copy link
Contributor

@yurii-lubynets yurii-lubynets left a comment

Choose a reason for hiding this comment

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

LGTM

@yarikoptic
Copy link
Contributor

yarikoptic commented May 27, 2021

FWIW: 👍 from me! ;-)
Note: Would close #1453 a yet not filed issue about "More posters" button persistently visible.

src/hooks/posters.ts Outdated Show resolved Hide resolved
src/hooks/posters.ts Outdated Show resolved Hide resolved
src/hooks/posters.ts Show resolved Hide resolved
@yarikoptic
Copy link
Contributor

Note: Would close #1453 a yet not filed issue about "More posters" button persistently visible.

FWIW -- confirming! (after full reload to get rid of Memos)

image

@mike-lvov mike-lvov temporarily deployed to feature-preview May 27, 2021 21:22 Inactive
@mike-lvov mike-lvov temporarily deployed to feature-preview May 27, 2021 21:24 Inactive
src/hooks/posters.ts Show resolved Hide resolved
src/hooks/posters.ts Show resolved Hide resolved
src/hooks/posters.ts Outdated Show resolved Hide resolved
@mike-lvov
Copy link
Contributor Author

@0xdevalias you did the review on a bit outdated code

@0xdevalias
Copy link
Contributor

@0xdevalias you did the review on a bit outdated code

@mike-lvov It wasn’t at the time I was doing it. It wasn’t intended as a deep thorough review anyway, more to point out some things I noticed on my phone while in bed.

@0xdevalias 0xdevalias self-assigned this May 28, 2021
@0xdevalias 0xdevalias added the 💪 enhancement Enhancements/improvements to existing functionality label May 28, 2021
@0xdevalias 0xdevalias changed the title Improve poster hall search improve poster hall search by adjusting fuse.js options + related May 28, 2021
@0xdevalias 0xdevalias changed the title improve poster hall search by adjusting fuse.js options + related improve PosterHall search by adjusting fuse.js options + related May 28, 2021
@0xdevalias
Copy link
Contributor

0xdevalias commented May 28, 2021

RE: #1460 (comment)

If @mike-lvov had a moment: for this solution I did $or across all keys unconditionally.
But if split words started with "{key}:" , restricting only to that key (with making to more obscure DB names), would've been awesome. Then I could say eg

@yarikoptic I'm going to call that OOS for this PR in the interest of landing it sooner and avoiding scope creep. If you wanted to open a new backlog issue describing the request, we can handle that as a potential future improvement.


Edit: Backlogged in #1467

Copy link
Contributor

@0xdevalias 0xdevalias left a comment

Choose a reason for hiding this comment

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

[CRO] @mike-lvov I'm going to preemptively approve this to unblock you, as I don't see any huge issues, but note that I haven't tested it yet, and there are a few notes in here that are probably worth checking/fixing before it gets merged.

Edit: The discussion in #1460 (comment) is probably still worth checking through + potentially fixing still.

src/hooks/posters.ts Show resolved Hide resolved
src/utils/text.ts Outdated Show resolved Hide resolved
src/hooks/posters.ts Outdated Show resolved Hide resolved
src/hooks/posters.ts Outdated Show resolved Hide resolved
src/hooks/posters.ts Show resolved Hide resolved
src/components/templates/PosterHall/PosterHall.tsx Outdated Show resolved Hide resolved
src/hooks/posters.ts Outdated Show resolved Hide resolved
@0xdevalias 0xdevalias temporarily deployed to feature-preview May 28, 2021 07:20 Inactive
@0xdevalias 0xdevalias temporarily deployed to feature-preview May 28, 2021 07:23 Inactive
@0xdevalias 0xdevalias temporarily deployed to feature-preview May 28, 2021 07:42 Inactive
@0xdevalias
Copy link
Contributor

0xdevalias commented May 28, 2021

Copying this out of the comment thread for visibility purposes:

In the interest of getting this merged, I'm going to call it OOS to muse on/change the regex/splitting method anymore here.

I've added a @debt comment to it in 11cca35 referencing github/codeql#5964 so that we have the relevant details captured there in future if needed.

Originally posted by @0xdevalias in #1460 (comment)

@0xdevalias 0xdevalias dismissed denisdimitrov’s stale review May 28, 2021 08:52

Changes have been resolved

@0xdevalias 0xdevalias merged commit c0e7e40 into staging May 28, 2021
@0xdevalias 0xdevalias deleted the feature/improve-posterhall-search branch May 28, 2021 08:52
@0xdevalias
Copy link
Contributor

Thanks for all of your work on this @yarikoptic! (and @mike-lvov for your additional cleanup/polish) 🎉

@yarikoptic
Copy link
Contributor

yarikoptic commented May 28, 2021

Woohoo -- thank you @mike-lvov and @0xdevalias !!! de-@dept (it was a false positive) PR #1470

yarikoptic added a commit to yarikoptic/sparkle that referenced this pull request May 28, 2021
* origin/staging:
  add my engineering QoL helper scripts (sparkletown#1466)
  improve PosterHall search by adjusting fuse.js options + related (sparkletown#1460)
  add ability to share a PosterPage on social media (sparkletown#1396)
  add optional scheduleStartDate to DB + force NavBarSchedule to start from that date when present (sparkletown#1419)

Conflicts:
	src/hooks/posters.ts - replaced sampleSize with shuffle around the entire set
yarikoptic added a commit to yarikoptic/sparkle that referenced this pull request May 31, 2021
* origin/staging:
  Fixes object freezing err (sparkletown#1474)
  add chat 'question' mode to highlight questions in the chat (sparkletown#1424)
  Add chat 'poll' mode + related ChatPoll feature (sparkletown#1343)
  add loading when editing venue table (sparkletown#1473)
  add EventModal + cleanup from new schedule implementation (sparkletown#1426)
  add sorting + proper 'show more' button in ScreeningRoom (sparkletown#1464)
  add table topic manage functionality (sparkletown#1377)
  Remove @DEPT - it was a false positive (sparkletown#1470)
  refactor openUrl/openRoomUrl/enterVenue to allow custom openers + use React Router for navigation in PosterPreview / NavBar's back button (sparkletown#1468)
  add my engineering QoL helper scripts (sparkletown#1466)
  improve PosterHall search by adjusting fuse.js options + related (sparkletown#1460)
  add ability to share a PosterPage on social media (sparkletown#1396)
  add optional scheduleStartDate to DB + force NavBarSchedule to start from that date when present (sparkletown#1419)
  ENH: now that posters loading/display is fast - boost to 48 (sparkletown#1445)
  fix logic in Auditorium (v1) where row/column 0 is treated as false instead of being a valid seat (sparkletown#1439)

 Conflicts: seems still trivialto resolve
	src/components/molecules/NavSearchBar/NavSearchBar.tsx
	src/components/organisms/ChatSidebar/components/VenueChat/VenueChat.tsx
	src/settings.ts
htwangtw added a commit to htwangtw/sparkle that referenced this pull request Jun 3, 2021
…-export

* upstream/staging:
  remove venue hook from party map template (sparkletown#1482)
  Fix profile questions page (sparkletown#1481)
  Fixes object freezing err (sparkletown#1474)
  add chat 'question' mode to highlight questions in the chat (sparkletown#1424)
  Add chat 'poll' mode + related ChatPoll feature (sparkletown#1343)
  add loading when editing venue table (sparkletown#1473)
  add EventModal + cleanup from new schedule implementation (sparkletown#1426)
  add sorting + proper 'show more' button in ScreeningRoom (sparkletown#1464)
  add table topic manage functionality (sparkletown#1377)
  Remove @DEPT - it was a false positive (sparkletown#1470)
  refactor openUrl/openRoomUrl/enterVenue to allow custom openers + use React Router for navigation in PosterPreview / NavBar's back button (sparkletown#1468)
  add my engineering QoL helper scripts (sparkletown#1466)
  improve PosterHall search by adjusting fuse.js options + related (sparkletown#1460)
  add ability to share a PosterPage on social media (sparkletown#1396)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 enhancement Enhancements/improvements to existing functionality 🙏 community-contribution For contributions from our community! <3
Projects
None yet
5 participants