Skip to content

Change back button to last viewed page - #1522

Open
varCepheid wants to merge 37 commits into
devfrom
match-back-button
Open

Change back button to last viewed page#1522
varCepheid wants to merge 37 commits into
devfrom
match-back-button

Conversation

@varCepheid

@varCepheid varCepheid commented Jan 15, 2023

Copy link
Copy Markdown
Collaborator

closes #1497
This PR takes away the back attribute in the Page element. It also adds a link to the event on event-specific pages and new pages for editing reports separate from the pages to view them.

@varCepheid varCepheid self-assigned this Jan 15, 2023
@varCepheid varCepheid added the enhancement Adds a new feature or meets a request. label Jan 15, 2023
@varCepheid
varCepheid requested a review from calebeby January 15, 2023 21:07
@calebeby

Copy link
Copy Markdown
Member

@varCepheid The way I designed the "back system" is that the back button goes "up a level", when that makes sense, and when there is no logical "up a level", it will perform the same action as the browser back button (go to the previous page).

Sometimes, that system is confusing. Instead of changing the behavior on this one individual page, can you propose a new logical system for the back button across all pages?

@calebeby

Copy link
Copy Markdown
Member

I acknowledge that the current system is confusing. Do you think it'd make sense for the back button in all cases to work the same as the browser back button? I would not be opposed to that kind of change.

However, if we did that, then there would be no easy way to, for example, navigate from a match page to the event corresponding to that match, unless that is the page you came from.

What do you think would make the most sense?

@varCepheid

Copy link
Copy Markdown
Collaborator Author

I think your fix makes more sense, and there should be a link to the event page on the match page.

@varCepheid varCepheid added needs work Changes have been suggested and need to be implemented. priority This needs to be addressed before the current changes can be merged to main. wip and removed needs work Changes have been suggested and need to be implemented. labels Jan 26, 2023
@varCepheid varCepheid added the needs work Changes have been suggested and need to be implemented. label Jan 27, 2023
@calebeby
calebeby marked this pull request as draft January 27, 2023 21:46
@varCepheid varCepheid removed the wip label Feb 9, 2023
@varCepheid

Copy link
Copy Markdown
Collaborator Author

Note to self: finish working on match details card, seems to only be updating on event page; then fix the type errors.

@varCepheid varCepheid added question Further information is requested. and removed needs work Changes have been suggested and need to be implemented. labels Feb 10, 2023
@varCepheid

Copy link
Copy Markdown
Collaborator Author

@calebeby routes/report, line 51: The back button had stopped editing mode when the report was being edited without changing the page. Now, the back button will always go to the browser's back no matter what. Should there be a button on the report page to stop editing, or is the Save Report button at the bottom good enough?

@varCepheid
varCepheid marked this pull request as ready for review June 25, 2023 23:42
@varCepheid
varCepheid requested a review from calebeby June 25, 2023 23:42
@varCepheid varCepheid removed the needs work Changes have been suggested and need to be implemented. label Aug 2, 2023

@calebeby calebeby left a comment

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.

Hi @varCepheid! Thanks for your patience with me! I left some feedback. I got a chance to review almost all of the files in this PR, except I haven't had time to closely review the changes to the report editor yet (when big blocks of code are moved the diff view doesn't really show what, if anything was actually changed, so it takes longer to compare)

Comment thread src/routes/event-match.tsx Outdated
Comment thread src/components/match-card.tsx
Comment thread src/components/page.tsx Outdated
Comment thread src/routes/report.tsx Outdated
Comment thread src/routes/report.tsx Outdated
Comment thread src/routes/saved-report-edit.tsx Outdated
Comment thread src/routes/saved-report-edit.tsx Outdated
Comment thread src/routes/event-team.tsx Outdated
@calebeby calebeby added the needs work Changes have been suggested and need to be implemented. label Aug 9, 2023
changed homepage argument of Page & Header to showBackButton and flipped
the logic
changed onEditClick argument of report-viewer to  reportEditorLink and
changed the Button to href
shortened functions in saved-report-edit
@varCepheid

Copy link
Copy Markdown
Collaborator Author

Thanks for all the notes! I went with a text-decoration-color attribute for the last point and I think it looks good. I won't merge until you have a chance to look at the report-editor component.

@varCepheid varCepheid added wip and removed needs work Changes have been suggested and need to be implemented. labels Nov 7, 2023
@varCepheid varCepheid removed the wip label Nov 15, 2023
@calebeby
calebeby self-requested a review November 19, 2023 06:37
@varCepheid

Copy link
Copy Markdown
Collaborator Author

@calebeby I've addressed all of the changes you've requested. Can you add another review or approve the changes?

Comment thread src/colors.ts Outdated
Comment thread src/components/page.tsx Outdated

@calebeby calebeby left a comment

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.

Great work here! I still have yet to review the report editor changes, I can't remember why those are in this PR and I don't have time to look closely right now.

Comment thread src/routes/event-analysis.tsx Outdated
Comment thread src/routes/event-match.tsx Outdated
Comment thread src/routes/event-match.tsx Outdated
Comment thread src/routes/event-team-comments.tsx Outdated
Comment thread src/routes/event-team-matches.tsx Outdated
Comment thread src/routes/event-team.tsx Outdated
@varCepheid

Copy link
Copy Markdown
Collaborator Author

The changes to the report and saved-report routes are because the logic on the back button used to discard changes to a report being edited, but with this PR in order to maintain that logic we needed new pages.

We Do Not Need These Extra Spaces --Caleb Eby

@calebeby
calebeby self-requested a review July 5, 2024 17:27
@calebeby calebeby changed the title change back button to last viewed page Change back button to last viewed page Jul 5, 2024

@calebeby calebeby left a comment

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.

@varCepheid This is looking really good! I finally remembered to come back here to look at the report viewer/editor changes. I left some comments.
Also feel free to bug me on slack if I forget to review things again!

Comment thread src/components/report-viewer.tsx Outdated
Comment thread src/routes/event.tsx
</Heading>
{newestIncompleteMatch && (
<MatchDetailsCard
key={newestIncompleteMatch.key}

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 am not sure why you removed this attribute. Having a key attribute helps Preact with diffing, so that it knows the difference between when items were changed, added, reordered, or removed. I think there was some weird edge case where when this page rerendered (due to the newestIncompleteMatch switching), it might have reset the input on the event matches list, or something like that.

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.

I removed it because the MatchDetailsCard component doesn't have key as a property. I don't know what it's passing into.

Comment thread src/routes/report-edit.tsx Outdated
Comment thread src/routes/saved-report.tsx Outdated
</Card>
</Page>
)
}

@calebeby calebeby Jul 5, 2024

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.

Before this PR, ReportPage was shared between the offline report editor and the "online" report editor. It looks like you split it out here. My concern is that the two pages (which are intended to look and work essentially the same) may now get out of sync in case someone forgets to edit both. For example, someone may make a CSS change in one but not the other. The only real difference between the two is how they handle fetching/storing the report data. Is there a way to combine them back together? (same for the viewer and editor I think)

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.

I did what I thought would work well here, but I didn't do a thorough comparison of every pair of files among the six that existed. There isn't enough overlap between the viewer and the editor to consolidate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Adds a new feature or meets a request. priority This needs to be addressed before the current changes can be merged to main.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

back button from match page

2 participants