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

Added ADR around nested facet logic implementation #3020

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

minhngocd
Copy link
Contributor

https://trello.com/c/OA4zE8m0/3430-ipo-finder-request
https://trello.com/c/4RJusHld/3374-nested-facets-add-new-document

PR where implementation took place: #2923

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Follow these steps if you are doing a Rails upgrade.

Copy link
Contributor

@ryanb-gds ryanb-gds left a comment

Choose a reason for hiding this comment

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

Generally looks good, I think we should take the private Google Doc link out of the public ADR though 😉


Pros:

- Consistency of 2 separate facets being displayed to users upon tagging and viewing metadata.
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 this consistency is really a pro, is it? These are two separate user groups so there isn't really any added value in having a similar UX

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea agreed, i'm also not keen on having validation to cross check across the two fields - but we'd note it here in any case as part of the alternatives we'd considered.

@minhngocd minhngocd force-pushed the adr-nested-facet-merged-list branch from 3facb55 to 59e3f15 Compare February 20, 2025 11:57
@minhngocd
Copy link
Contributor Author

@ryanb-gds updated

Copy link
Contributor

@ryanb-gds ryanb-gds left a comment

Choose a reason for hiding this comment

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

Good ADR, thanks Minno and co!

Copy link
Contributor

@ChrisBAshton ChrisBAshton left a comment

Choose a reason for hiding this comment

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

Thanks for splitting this out into a separate PR. Some comments below :)


### Have tagging done as 2 separate facets with validation

Even on publisher side, surface all of a facet's parents facets as one dropdown, and all of the sub-facets as a separate dropdown. As outlined on [this branch](https://github.com/alphagov/specialist-publisher/compare/intellectual-property-office-finder_2?expand=1).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest linking to the commit instead, as the branch can easily be deleted in future, but the commit should live forever (citation needed!)

Suggested change
Even on publisher side, surface all of a facet's parents facets as one dropdown, and all of the sub-facets as a separate dropdown. As outlined on [this branch](https://github.com/alphagov/specialist-publisher/compare/intellectual-property-office-finder_2?expand=1).
Even on publisher side, surface all of a facet's parents facets as one dropdown, and all of the sub-facets as a separate dropdown. As outlined in [this commit](https://github.com/alphagov/specialist-publisher/commit/c7346db771df5ccafd5fff8f7f687a8211436f6a).

Cons:

- Repeat of information. The sub-facets are also prefixed with parent facet in any case (e.g. to differentiate between multiple "Not Applicable" sub-facet entries). Users will have to tag both parent facet and the sub-facet with the prefix.
- There is no structural tie between the parent facet and the sub-facet when tagging. Nothing stopping the user from tagging mismatching pairs or not tagging a sub-facet.
Copy link
Contributor

Choose a reason for hiding this comment

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

"Not tagging a sub-facet" is allowed though, isn't it? As per our assumptions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm I'm not sure we clarified between

  • Having a mixture of leaf nodes - hence tagging a main-facet because it doesn't have sub-facets
  • Tagging a main-facet only despite it also having sub-facets

I think in the future we do want to support tagging main-facet only despite having sub-facets, but we felt like we could clarify that later down the line, as the current MVP doesn't require it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh fair enough.

What we have implemented:

- On the publisher side for tagging, a single dropdown that merges the facets' values (main facet and sub facets, essentially leaf nodes)
- When we send the document to Publishing API, we write logic into the document model to figure out whether the leaf node is a parent facet or sub-facet value in the dropdown, and split the metadata we send to Publishing API into its own facet and a separate sub-facet in `specialist-publisher/app/models/document.rb`
Copy link
Contributor

Choose a reason for hiding this comment

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

Just checking whether what's written here is what's been implemented. The ADR implies (to me) that publishers can choose both "sub facets" and parent "facets" from the dropdown - but I'm only seeing subfacets in the dropdown on https://specialist-publisher.integration.publishing.service.gov.uk/trademark-decisions/new.

Copy link
Contributor Author

@minhngocd minhngocd Feb 20, 2025

Choose a reason for hiding this comment

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

@ChrisBAshton similar to point above - in our implementation:

  • we allow main facets to be defined without subfacets. It would show up in the dropdown if that is the case. Unfortunately for this finder, it doesn't have any main facets without sub facets.
  • what we don't allow, is if the main facet has sub-facets, then you can only choose the sub-facets (leaf nodes). Reason being we still have things to clarify about that behaviour (is it equivalent to tagging all subs, or no subs). Since the current finder doesn't require it, i thought de-scoping would be fine.

happy to discuss further

Copy link
Contributor

@ChrisBAshton ChrisBAshton left a comment

Choose a reason for hiding this comment

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

LGTM!

@minhngocd minhngocd force-pushed the adr-nested-facet-merged-list branch from 59e3f15 to 1d8af10 Compare February 21, 2025 11:02
.adr-dir file checked in for using the tool `adr-tools` for ADR template generation and management
@minhngocd minhngocd force-pushed the adr-nested-facet-merged-list branch from 1d8af10 to fb44823 Compare February 21, 2025 11:16
@minhngocd minhngocd merged commit 8178af8 into main Feb 21, 2025
11 checks passed
@minhngocd minhngocd deleted the adr-nested-facet-merged-list branch February 21, 2025 11:19
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.

3 participants