Skip to content

Conversation

@ketphan02
Copy link
Collaborator

@ketphan02 ketphan02 commented May 14, 2024

This PR includes:

  • Adding projects hooks
  • Adding search hooks
  • 2 components:
    • A dropdown to select project sets, this uses outlined project sets API
    • A list showing all projects and can click to switch between project

Demo:

Screen.Recording.2024-05-13.at.8.28.41.PM.mov

@ketphan02 ketphan02 requested a review from Opeyem1a May 14, 2024 01:28
@ketphan02 ketphan02 self-assigned this May 14, 2024
breadcrumbs={[
{title: "Home", href: `/course/${courseId}`},
{title: "Project Sets", href: `/course/${courseId}/project-sets`},
{title: `Project Set Detail`, href: `/course/${courseId}/project-sets/${projectSetId}`},
Copy link
Member

Choose a reason for hiding this comment

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

"Project Set Detail" provides no value as a breadcrumb item.
At minimum, it should just be the name of the project set

}

export const ProjectsProvider: FC<PropsWithChildren> = ({children}) => {
const projectSet = useProjects()
Copy link
Member

Choose a reason for hiding this comment

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

nit;

do we really gain value fro making an entire other hook just so we can use it in one place and set all the values in the provider. Seems like we could just do all the useState and useEffect stuff without putting it in another hook

const ProjectSetContext = createContext<ProjectSetContextType>({
projectSetId: "",
projects: [],
displayProjects: [],
Copy link
Member

Choose a reason for hiding this comment

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

still reviewing but have my doubts if we need the logic of displayProjects to exist at the provider level. I kinda think the left sidebar could handle this logic without anything else under the context needing to be aware of it

Copy link
Member

Choose a reason for hiding this comment

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

let's not do this imo

Copy link
Member

Choose a reason for hiding this comment

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

idk why this is a context tbh? This seems like straight internal behaviour of the search sidebar on its own and really didn't need to be a context. Nothing else consumes this and I don't think anything ever will

setDisplayProjects(filteredProjects)
setSearchText(searchText)

// If the current project is not in the filtered projects, set the current project to the first filtered project
Copy link
Member

Choose a reason for hiding this comment

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

idea;

I think a nice UX flow would be to have the right side of the page render a nice empty state whenever the search changes. Then make it possible to set null for the current project. Then whenever the search changes we set the current project to null.

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