Skip to content

Add faceted type-ahead search capability to CSET web interface#1713

Merged
James Frost (jfrost-mo) merged 27 commits intomainfrom
MSc_ui_improvements
Apr 20, 2026
Merged

Add faceted type-ahead search capability to CSET web interface#1713
James Frost (jfrost-mo) merged 27 commits intomainfrom
MSc_ui_improvements

Conversation

@jfrost-mo
Copy link
Copy Markdown
Member

@jfrost-mo James Frost (jfrost-mo) commented Sep 22, 2025

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.

  • Documentation has been updated to reflect change.
  • New code has tests, and affected old tests have been updated.
  • All tests and CI checks pass.
  • Ensured the pull request title is descriptive.
  • Conda lock files have been updated if dependencies have changed.
  • Attributed any Generative AI, such as GitHub Copilot, used in this PR.
  • Marked the PR as ready to review.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 22, 2025

Coverage

@jfrost-mo James Frost (jfrost-mo) changed the title WIP Add search capability to CSET UI Add search capability to CSET UI Sep 24, 2025
@jfrost-mo James Frost (jfrost-mo) changed the title Add search capability to CSET UI Add faceted type-ahead search capability to CSET web interface Oct 17, 2025
@jfrost-mo

This comment was marked as resolved.

@jfrost-mo

This comment was marked as outdated.

@jfrost-mo James Frost (jfrost-mo) force-pushed the MSc_ui_improvements branch 4 times, most recently from 4edac77 to 7ed878c Compare January 9, 2026 16:50
@jfrost-mo James Frost (jfrost-mo) force-pushed the MSc_ui_improvements branch 2 times, most recently from 25f9105 to dff23c5 Compare January 12, 2026 09:13
@jfrost-mo James Frost (jfrost-mo) changed the base branch from main to 1049_cache_busting January 12, 2026 09:15
Base automatically changed from 1049_cache_busting to main January 13, 2026 13:38
@jfrost-mo

This comment was marked as outdated.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 :) .

Comment thread src/CSET/cset_workflow/app/finish_website/file/html/script.js Outdated
Comment thread src/CSET/cset_workflow/app/finish_website/file/html/script.js Outdated
Comment thread src/CSET/cset_workflow/app/finish_website/file/html/script.js Outdated
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.
@jfrost-mo James Frost (jfrost-mo) force-pushed the MSc_ui_improvements branch 2 times, most recently from 66e6494 to 4725fde Compare April 14, 2026 17:21
James Frost (jfrost-mo) and others added 12 commits April 14, 2026 18:39
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.
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.
Copy link
Copy Markdown
Collaborator

@daflack David Flack (daflack) left a comment

Choose a reason for hiding this comment

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

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).

@jfrost-mo James Frost (jfrost-mo) removed this from the CSET v26.2.0 milestone Apr 20, 2026
@jfrost-mo James Frost (jfrost-mo) merged commit 9a9a7f7 into main Apr 20, 2026
8 checks passed
@jfrost-mo James Frost (jfrost-mo) deleted the MSc_ui_improvements branch April 20, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants