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

Circulars: Lucene Shortcuts and Archive Page Documentation #2589

Closed
wants to merge 12 commits into from

Conversation

tylerbarna
Copy link
Member

@tylerbarna tylerbarna commented Sep 18, 2024

Description

This adds a brief explanation of Lucene queries to the Circulars Archive page as well as shortcut buttons to populate the search bar with common Lucene search syntax

Related Issue(s)

Tracked by #2288

Testing

  1. Navigate to Circulars Archive
  2. Click on the "Advanced Search" (Tentative Label) Accordion Menu
  3. The menu should expand
  4. Any Shortcut buttons should be clickable, resulting in the addition of the selected lucene query to the query. This should be reflected directly in the search bar and should not clear the existing query

this contains a basic accordion menu, following a similar implementation by @Courey in a seperate branch. Additional commits will add documentation, as well as a series of modals to automatically populate the search bar with common lucene search syntax
Copy link

codecov bot commented Sep 18, 2024

Codecov Report

Attention: Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.

Project coverage is 6.07%. Comparing base (6ab395c) to head (71f10d4).
Report is 85 commits behind head on main.

Files with missing lines Patch % Lines
.../circulars._archive._index/CircularsLuceneMenu.tsx 0.00% 9 Missing ⚠️
app/routes/circulars._archive._index/route.tsx 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #2589      +/-   ##
========================================
- Coverage   6.10%   6.07%   -0.04%     
========================================
  Files        164     165       +1     
  Lines       4061    4082      +21     
  Branches     442     450       +8     
========================================
  Hits         248     248              
- Misses      3811    3832      +21     
  Partials       2       2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tylerbarna tylerbarna marked this pull request as ready for review September 25, 2024 19:28
@@ -227,6 +228,7 @@ export default function () {
name="query"
type="search"
defaultValue={inputQuery}
value={inputQuery}
Copy link
Member

Choose a reason for hiding this comment

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

I don't remember where I read this, but I think it's considered a common mistake to have an input that, on change, updates a state variable, and whose value comes from a state variable. @dakota002, @Courey, have you heard that? Or am I misremembering?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure on that, I think it might be dependent on where in the general hierarchy of components those state values are used. Like if they need to affect a value in a child/parent component. And if they are basic inputs vs more complex components. But I think generally speaking your idea sounds correct

I think there was something going on here where, when the page reloads due to a form submission, the value was not updating correctly, like the defaultValue would still show the previous value, even though the query string would update. @tylerbarna is this correct or am I thinking of another thing?

Copy link
Member Author

@tylerbarna tylerbarna Oct 8, 2024

Choose a reason for hiding this comment

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

@dakota002 without setting value the search bar won't update to reflect the current query string inside the search bar until the page is reloaded, so there's not visual feedback that one of the quick action buttons have been pressed until you reload the page; we don't want the page to reload every time a quick action button is pressed since the contents of the quick action button is likely not the exact term users are looking to search for

Copy link
Member

Choose a reason for hiding this comment

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

Sorry that this has been holding things up. I am still not sure if this is the right way to programmatically modify the search field. To unblock this, let's just not automatically fill in the search field right now.

Copy link
Member Author

Choose a reason for hiding this comment

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

@lpsinger apologies for missing this last week, I'm going to close this PR and open a new one with just the in-page documentation

@tylerbarna
Copy link
Member Author

The documentation portion of this PR has been moved to #2713. The quick action buttons will be addressed in a future PR.

@tylerbarna tylerbarna closed this Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants