Skip to content

NickAkhmetov/CAT-1533 Improve human readability of shared search links#3957

Merged
NickAkhmetov merged 2 commits intomainfrom
nickakhmetov/cat-1533-search-state-enhancements
Mar 17, 2026
Merged

NickAkhmetov/CAT-1533 Improve human readability of shared search links#3957
NickAkhmetov merged 2 commits intomainfrom
nickakhmetov/cat-1533-search-state-enhancements

Conversation

@NickAkhmetov
Copy link
Copy Markdown
Collaborator

@NickAkhmetov NickAkhmetov commented Mar 13, 2026

Summary

This PR adjusts the search parameter URL state mapping so that faceted data is human-readable, while maintaining the compressed URL approach for UUID-based search states and less important facets (e.g. sample category).

Existing links remain functional/compatible.

Additional mapped facets can be added by extending the READABLE_PARAM_FIELDS constant in searchParams.ts. The current implementation only took into account the main fields on the dataset search.

Design Documentation/Original Tickets

https://hms-dbmi.atlassian.net/browse/CAT-1533

Testing

  • Added unit tests for parsing logic
  • Copied compressed URL query states from production to local, confirmed queries are identical

Screenshots/Video

Left lung RNAseq data:
image

Published left lung RNAseq data:
image

Checklist

  • Code follows the project's coding standards
    • Lint checks pass locally
    • New CHANGELOG-your-feature-name-here.md is present in the root directory, describing the change(s) in full sentences.
  • Unit tests covering the new feature have been added
  • All existing tests pass
  • Any relevant documentation in JIRA/Confluence has been updated to reflect the new feature
  • Any new functionalities have appropriate analytics functionalities added

Additional Notes

Selecting parent facets (e.g. "RNA-seq") adds all children to the url state; this was necessary to support handling cases where only a subset of the child facets are selected. Sharing a link with only the parent facet (e.g. /search/datasets?dataset_type=RNAseq) automatically selects all of the child facets.

john-conroy
john-conroy previously approved these changes Mar 17, 2026
Copy link
Copy Markdown
Collaborator

@john-conroy john-conroy left a comment

Choose a reason for hiding this comment

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

The nested conditionals are a bit rough on the eyes, but seem mostly necessary.


// Determine the facet type based on the field
// raw_dataset_type and mapped_status are HIERARCHICAL; others are TERM
if (field === 'raw_dataset_type' || field === 'mapped_status') {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we get the hierarchical fields from a constant defined somewhere?

@NickAkhmetov NickAkhmetov merged commit 6e4515e into main Mar 17, 2026
8 checks passed
@NickAkhmetov NickAkhmetov deleted the nickakhmetov/cat-1533-search-state-enhancements branch March 17, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants