Add faceted type-ahead search capability to CSET web interface#1713
Add faceted type-ahead search capability to CSET web interface#1713James Frost (jfrost-mo) merged 27 commits intomainfrom
Conversation
dcb8464 to
281677c
Compare
This comment was marked as resolved.
This comment was marked as resolved.
06d6e99 to
47e766b
Compare
This comment was marked as outdated.
This comment was marked as outdated.
4edac77 to
7ed878c
Compare
25f9105 to
dff23c5
Compare
3a00a7b to
e5c20e5
Compare
This comment was marked as outdated.
This comment was marked as outdated.
e5c20e5 to
bc07f67
Compare
Pierre Siddall (Pierre-siddall)
left a comment
There was a problem hiding this comment.
This looks really good James, you've definitely had a good understanding of the lexer and have implemented clever regex to match the different range of search queries a user may input. Equally, you clearly have demonstrated that you know how the DOM functions by construing HTML elements being added to or removed from the DOM via javascript. I only have a couple of tiny improvements here regarding informative variable names in order to help future developers understand the control flow of your javascript by knowing what is being operated on. However, overall I think this is a well justified piece of work, great job :) .
Using more descriptive names clarifies what data is being used.
We now add the templated variables into the written out recipe.
The primary optimisation here is to batch the addition of elements to the DOM. This reduces the number of rerenders/layouts triggered and minimises the number of events fired. This is especially useful as uBlock Origin watches DOM mutations, which slows things down a lot.
66e6494 to
4725fde
Compare
Runs a localhost webserver in a separate thread for serving the content under test to make it self contained. Playwright is therefore added as a testing dependency.
This means the browser shall be installed in CI. Playwright won't redownload if already downloaded, but will update if needed.
These facets can only take a single value, are hard to interpret, and don't allow any selection that can't be done with category instead.
This is far more efficient, leading to lower memory usage, and faster performance. Rendering was still expensive, so to keep it performant the number of rendered diagnostics is limited to 500.
I keep accidentally git adding it. This symlink allows testing the web interface with real data during development.
This makes it more visible while the user is still near the filter controls.
When more than two Conditions were specified separated by implicit ANDs, Conditions would sometimes not apply. For example the query "a b c" would check for a and b, but not c. This was due to an incorrect array index increment inside the and parsing logic, which caused the next Condition after a pair of implicitly ANDed Conditions to be skipped.
f815f88 to
0957f76
Compare
It now remains visible even when scrolled down, so you know that you don't have the full list of results. We also use it to display a message while the diagnostics are loading.
This will potentially allow for theming in future, and lets us see the range of colours we are using to ensure consistency.
As it is a UI element we should use the UI font. The placeholder/plot pages have been felt alone, as they contain more prose for which san-serif is better.
David Flack (daflack)
left a comment
There was a problem hiding this comment.
Having had a brief look at the example website provided, and tested the capability that was breaking and not as clear I find the changes really helpful and beneficial. Website looks really clear and easy to navigate with useful factors considered. Great job! (Probably want multiple approving reviews rather than just one for this PR).
CSET output web interface improvements developed during my MSc project.
GitHub Copilot was used for review and fix suggestions for the prototype python parser, which was then hand ported to JavaScript. That code has been rebased away.
Thank you to Pierre Siddall (@Pierre-siddall) for reviewing the JavaScript code.
Contribution checklist
Aim to have all relevant checks ticked off before merging. See the developer's guide for more detail.