-
Notifications
You must be signed in to change notification settings - Fork 7
refactor: Updates to isolated hooks #223
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
base: refactor
Are you sure you want to change the base?
Conversation
✅ Deploy Preview ready!
|
gadomski
left a comment
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.
In general, makes sense, thanks for the fixups! One filename nit, and one bug. Don't know quite where it broke, but the collection filtering makes the filter disappear under this case:
Screen.Recording.2025-12-11.at.5.17.58.PM.mov
The same might be an issue for items as well.
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.
Don't love utils/utilties.ts as a file name. I think a top-level utils.tsx should be good enough?
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.
updated to utils/index.ts because didn't know if we wanted a utils/ dir and then a utils.tsx file at the same level
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.
Maybe utils/title.ts?
|
@gadomski thanks for reviewing! I couldn't replicate the bug though... Screen.Recording.2025-12-14.at.7.02.12.PM.movis how its behaving for me locally. wasn't able to get it to dissapear and tried other things - you have other replication steps? |
|
Reproduction steps:
Screen.Recording.2025-12-15.at.6.14.01.AM.mov |
gadomski
left a comment
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.
In general, makes sense, thanks for the fixups! One filename nit, and one bug. Don't know quite where it broke, but the collection filtering makes the filter disappear under this case:
Screen.Recording.2025-12-11.at.5.17.58.PM.mov
The same might be an issue for items as well.
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.
Maybe utils/title.ts?
src/utils/index.ts
Outdated
| @@ -0,0 +1,9 @@ | |||
| import type { StacValue } from "../types/stac"; | |||
|
|
|||
| export default function setDocumentTitle(value: StacValue | undefined) { | |||
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.
| export default function setDocumentTitle(value: StacValue | undefined) { | |
| export default function getDocumentTitle(value: StacValue | undefined) { |
Hey @gadomski, I figured it would be quicker if I just made the changes I was going to comment onto your PR to hopefully be quicker. Let me know what you think? Should be able to follow my commits. I made sure to validate the behavior matched prod and these changes did - feel free to manually validate as well!
Changes:
useDocumentTitleto no longer be a hook and instead made it a fn. The useEffect which depended onvaluefromuseStacValue- I just kept inapp.tsxbecause thats the only place that would need that subscription so I didn't think a separate hook was needed.useHrefParamuseStacFiltersto either return the filtered assets or the original assets array instead ofundefined. This way we dont have to pass incollections&filteredCollectionsseparately (same with items).collections={filteredCollections}and same with items