Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Before I approve, can you link to the ticket for the collectionStructure refactor/update? It's not significant but want to make be clear on the reqs for the forced loading state.
A few notes:
- For a page such as https://digital-collections-git-dr-3549-repo-offboarding-nypl.vercel.app/collections/2589a880-c52c-012f-2cb4-58d385a7bc34, it's confusing to see just the letter applied as a filter without more context... I'm sure it's clear because the user is intentionally selecting that filter, but otherwise, it's confusing if you're looking at it randomly:
- The dimmed style state works well but it's not a "true" loading state where the buttons are disabled. I can still click around while the results update and get the next set of results. I guess it's scope creep but the buttons should be disabled to not queue up fetch requests.
- I thought this was a problem with this PR but I can replicate it on prod: clicking around sibling filters, I can toggle one, select another, and try to toggle back but then either 1) I land on an indefinite loading state with no search results (and no error message in the console), or 2) the previously clicked filter is toggled and then it seems to jump around. It will be better to show you in person.
.husky/post-merge
Outdated
There was a problem hiding this comment.
Just adding a comment as a reminder to review this once it's merged as we discussed offline.
| import { CollectionsApi } from "@/src/utils/apiClients/apiClients"; | ||
| import { AvailableFilterOption } from "@/src/types/AvailableFilterType"; | ||
|
|
||
| export type CollectionSearchParamsType = { |
There was a problem hiding this comment.
This isn't wrong but moving the type to this file now makes this file a dependency for /app/collections/page.tsx, and this also means importing AvailableFilterOption just for this type. Again, not wrong but it's a code smell and this tends to end up creating circular dependencies.
| items, | ||
| toggle, | ||
| targetUuid, | ||
| toggledUuid, |
There was a problem hiding this comment.
Add documentation for this prop to the comment above. It's not clear that this is used for the dimmed style.
| toggledUuid: string; | ||
| }) => { | ||
| const ancestorUuids = targetUuid | ||
| ? findAncestorUuids(items, targetUuid) ?? [] |
There was a problem hiding this comment.
Since findAncestorUuids is only used in this file, why not make it return an empty array instead of null so you don't have to ?? [] here?
| ); | ||
| }; | ||
|
|
||
| const findAncestorUuids = ( |
There was a problem hiding this comment.
I don't think you need comment documentation for all functions, but this recursive function is a good candidate for further documentation. At first glance, it's complicated enough that makes me think it's related to how the component functions and renders, but it's only used for styling properly.
| searchManager.setLastFilter(null); | ||
|
|
||
| /* | ||
| If opening the item, add the subcollection filter. If closing, remove |
| } | ||
| }; | ||
|
|
||
| // If no subcontainers, don't display collection structure |
| console.error("Toggle failed:", error); | ||
| } finally { | ||
| setTimeout(() => { | ||
| setToggledUuid(null); |
There was a problem hiding this comment.
By doing this, aren't you rerendering the entire AccordionTree with this state update? It seems unnecessary for the style update.
| isOpen: boolean; | ||
| hasSubContainers: boolean; | ||
| children?: OpenStateItem[]; | ||
| parentUuid?: string | null; |
There was a problem hiding this comment.
I'm having a hard time following this but why and how is parentUuid used? I see it being set but not read.
There was a problem hiding this comment.
Used to fetch siblings of the current node in buildTreeWithPathToUuid
|
Besides the comments above, the actual offboarding updates in this PR look fine, thanks. |
As discussed in person, no ticket/reqs for this loading state, this work likely needs to be more clearly defined before it can be completed.
|

Ticket:
This PR does the following:
Repo offboarding and clean up:
qaonlyOpen Questions
How has this been tested? How should a reviewer test this?
Accessibility concerns or updates
Checklist: