-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Circulars Archive Group View #2617
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2617 +/- ##
=====================================
Coverage 6.10% 6.11%
=====================================
Files 168 171 +3
Lines 4258 4333 +75
Branches 468 475 +7
=====================================
+ Hits 260 265 +5
- Misses 3996 4066 +70
Partials 2 2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase.
e64cd81
to
d91fa13
Compare
Added "Open/Close All" button on group overview page as requested by @jracusin |
That was the plan as I said in the original PR description:
I rebased and took the PR out of draft status. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are more conflicts. Please rebase again.
f425a78
to
e53c732
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, some high-level UX feedback:
- Please use numbered lists, not bulleted lists, for Circulars in the index view. The list number value should be the Circular number.
- For now, don't have disclosure arrows on the per-group page. Just display all of the Circulars belonging to the group. We can fine-tune the UI to quickly navigate within a group in a future PR.
@@ -29,6 +29,7 @@ export const AstroDataContext = createContext<AstroDataContextProps>({}) | |||
/** | |||
* An Astro Flavored Markdown enriched link. | |||
*/ | |||
// eslint-disable-next-line react/display-name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this addition necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to make the move have no changes to the code if possible
@@ -53,6 +64,7 @@ export default function PaginationSelectionFooter({ | |||
page={page} | |||
limit={limit} | |||
totalPages={totalPages} | |||
view={view} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does the Pagination component need to know about the view?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because in getPageLink if the view is not set as a search param, then when it creates the link, it doesn't include view. If it doesn't include view, then the view defaults to index. If it's always index, then the pagination links will never work for groups. To show you what I mean, here is what happens when I remove the view from getPageLinks. When I hover over the 2 button, this is the link. You will see that it doesn't include the view so when that page is navigated to, it's the index view which is the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see.
The last time that I looked at this component, I noticed that a lot of apparently separate concerns were leaking into it from pages that use it. At some point, I'd like to come back to this and try to refactor it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's a good idea. It did feel odd to have to add view specific code to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Please place the new event pages under /circulars/group/ rather than /group/.
- The synonym IDs make for URLs that are not very presentable. Instead, can we use a slugified form of the event name (any of the event names that belong to the group) as the path component?
I have a couple of concerns about this if I'm understanding correctly.
Can you explain what about uuids feels not presentable to you? |
81d7ea6
to
772831d
Compare
I proposed using "any of the event names that belong to the group" as the path component. So /circulars/groups/GW170817, /circulars/groups/GRB170817A, /circulars/groups/GW170817+GRB170817A would all represent the same resource. (One would need to be reported as the canonical URL for SEO purposes; probably the version with the maximal set of terms.) Another option (but not my preference) would be to do what Stack Overflow does: have an opaque UUID followed by a slug that is ignored. So for example, all of the following refer to the same resource:
although the first is canonical.
It's a usability issue: https://en.wikipedia.org/wiki/Clean_URL |
I don't disagree that RESTfulness is a desirable property for URL routing, but an entity need not have a unique URL, does it? By analogy, files on a filesystem don't have unique paths. It's true that we are using Circular IDs as URL path components, but Circular IDs are part of the publicly-visible bibliographic record of Circulars. UUIDs are an internal detail. |
I disagree that what you are proposing is "clean".
your request violates:
because calling a resource by one of it's members is not restful. not restful != clean and
because of the situations outlined above when the members of the group change. If I have a group of GRB A, GRB B, GRB C, and GRB D. If I bookmark Additionally, is it really worth the complexity that it creates?
|
In a URL like /circulars/group/GW170817, the "group" component is a the resource and "GW170817" is the ID. I view the event names as permanent, stable IDs. The UUIDs are not. Although this approach appears RESTful to me, I don't want to get bogged down in that argument, because this path is not an API endpoint and it is not all that important whether it is RESTful or not. It's more important that they are human-readable and predictable. Here are some examples of style guidelines and advice related to human-readable URLs:
That looks like a reasonable implementation plan. Is there a good open-source slugging library we could use? |
Additional work for this feature:
|
772831d
to
71cdc0d
Compare
This is great, @Courey. I am swamped until the end of the day but I'll try to post a review by tomorrow. Meanwhile, @dakota002, would you please give it a once over? |
I'm currently fixing tests. You are welcome to review the application code while I sort those out, but there could be changes as a result of fixing those tests. |
Perfect. Just ping us when you're ready. I won't bother you until then! |
cb9955b
to
5da3e58
Compare
found a small bug on the moderator view that was introduced by the changes in this branch. fixing that now. |
adds validation and error handling fixes tests adds modal warning prior to delete changes removal button to words instead of only icons code review change requests removing unused className formatting autofill moderator synonym eventId selector adding create sad path test removing feature flag check adding a 3 second debounce Adds grouped view to circulars archive index adds missing route and flag checks
34b9bc1
to
2dae781
Compare
const { query, startDate, endDate, sort, view } = handleSearchParams( | ||
searchParams, | ||
synonymFlagIsOn | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please undo this refactoring.
Refactoring to make code more readable is a good thing, but this refactoring is not related to the objectives of this PR. Please don't mix up refactoring with feature or bug fix PRs. It increases the review burden because I have to check that the refactoring itself is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will undo it, but in the software industry there is something called the campfire rule. This means that if your feature touches existing code, refactoring for readability, performance, etc is encouraged. Not making improvements when working in an area is unusual for most engineers, so that might be something we want to put in the contributing guide or wherever we put our team norms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are good improvements! But please do the refactoring in a separate PR. I would like to review the refactoring itself independently from the functional changes.
When you are working on a new feature or a bug fix and you notice a helpful refactoring, please do the refactoring in a separate commit and open a separate PR for it.
page, | ||
...results, | ||
requestedChangeCount, | ||
synonymFlagIsOn, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to pass this through the loader. This value is already available in components through the useFeature
hook.
Is the review complete? I would like to make all requested changes at once because I do a thorough testing locally to ensure none of the refactoring breaks anything. When we do the review in review after review, it eats up a lot of time with the testing because I have to retest all of it each time. I don't want to skip testing because since we merge each others branches, I want to make sure it is completely tested each time I push in case it gets merged in. |
I'm done. I have some look-and-feel requests about the view toggle button, but I had planned to do that in a separate issue after we merge this. |
This work is based off #2538 and will be turned into a non-draft PR once that work has been merged in and I rebase off main.
Description
This work includes:
Related Issue(s)
Resolves #2544
Testing
This has been thoroughly manually tested locally, but should be tested on dev WITHOUT the feature flag on to ensure that no existing functionality has broken.
Images