Skip to content

DR-3549: Emma repo offboarding#338

Merged
7emansell merged 13 commits intomainfrom
DR-3549/repo-offboarding
Jun 6, 2025
Merged

DR-3549: Emma repo offboarding#338
7emansell merged 13 commits intomainfrom
DR-3549/repo-offboarding

Conversation

@7emansell
Copy link
Copy Markdown
Collaborator

@7emansell 7emansell commented May 28, 2025

Ticket:

This PR does the following:

Repo offboarding and clean up:

  • Reorganizes code into folders where possible, renames types more strictly
  • Deletes unused hooks and mocks
  • Makes changelog update from Husky pre-commit on qa only
  • Minor adjustments to README

Open Questions

How has this been tested? How should a reviewer test this?

Accessibility concerns or updates

Checklist:

  • I have added relevant accessibility documentation for this pull request.
  • All new and existing tests passed.
  • I have updated the CHANGELOG.md.

@vercel
Copy link
Copy Markdown

vercel bot commented May 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
digital-collections ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 8:27pm

@7emansell 7emansell marked this pull request as ready for review June 2, 2025 13:52
Copy link
Copy Markdown
Member

@EdwinGuzman EdwinGuzman left a comment

Choose a reason for hiding this comment

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

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:

Screenshot 2025-06-02 at 6 08 28 PM
  • 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 = {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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) ?? []
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 = (
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this no longer relevant?

}
};

// If no subcontainers, don't display collection structure
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No longer relevant?

console.error("Toggle failed:", error);
} finally {
setTimeout(() => {
setToggledUuid(null);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm having a hard time following this but why and how is parentUuid used? I see it being set but not read.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Used to fetch siblings of the current node in buildTreeWithPathToUuid

@EdwinGuzman
Copy link
Copy Markdown
Member

Besides the comments above, the actual offboarding updates in this PR look fine, thanks.

@7emansell
Copy link
Copy Markdown
Collaborator Author

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:

Screenshot 2025-06-02 at 6 08 28 PM * 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.

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.

  • Some subcollections do have obscure titles like "Vol II", not sure what we can do besides always include the collection title as well ex. "Posada Collection: Vol II". Something to check with Lana on
  • Dimmed state not a true loading state but mainly meant to prevent user from doing what you describe above– clicking around so quickly that the collection structure gets stuck or seems to be jumping around as it catches up
  • Tldr this should be addressed separately in the work here: Collection structure refinement PR

@7emansell 7emansell merged commit 936a069 into main Jun 6, 2025
4 checks passed
@7emansell 7emansell deleted the DR-3549/repo-offboarding branch June 6, 2025 19:32
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