Paul-Austin-Oswego-CSC480-HCI521 / OZ-CSC-480-HCI-521-Fall-2024

Repo for CSC 480 HCI 521 class of fall 2024
5 stars 16 forks source link

When making a new project, the center heading will show the wrong project title until user refreshes the page #123

Open jbaile20 opened 1 week ago

jbaile20 commented 1 week ago

Problem

When the user creates a new project, if you select that project on the left panel before refreshing the page, it will show the incorrect project title in the center of the screen. On a page refresh, it will show the correct title.

Incidence

Steps to reproduce

Environment

This happens when running locally and on the moxie server OS: Windows Browser: Google Chrome

Subheadings below are optional; remove if not applicable.

Location

any project URL

Behavior

Expected behavior

Project page shows the correct project title when clicked without needing to refresh

Observed behavior

User needs to refresh the page before the correct project title is shown

Subheadings below are optional; remove if not applicable.

Console output/errors

Relevant console output or errors, pasted as text.

Screenshot

before refresh, project 57 is selected but shows project 1 image after refresh, shows project 57 correctly image

Top-level headings below are optional; remove if not applicable.

Suggested fix

N/A

Other notes

Remember to assign the issue exactly one severity label.

PiesArentSquare commented 1 week ago

good catch! the issue is that project creation is handled in PageLayout, and so it does not update TaskPage's projects state. this would have to be fixed by either sending some message from PageLayout to TaskPage on project creation/edit/deletion forcing it to refetch, or probably a better solution is just using React.useContext at the top level