Skip to content
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

web: add filter to own commits button #43

Merged
merged 4 commits into from
Oct 18, 2023

Conversation

scallaway
Copy link
Contributor

Ultimately, this PR does what it says on the tin, but I included two other refactoring-ish commits ahead of them with other stuff that I found whilst working on this.

This just sets up the component to make it easier to work with for the
comming commits, but I did want to pull this out on its own to make it
clear what code is just moved around and what is added as a result of
the new feature.
Does what it says on the tin, because unfortunately MUI doesn't give
that to us for free when using `<TextField />` - they do on
`<Autocomplete />`, however.
I thought of a few ways about implementing this, but figured the
cleanest was to just add the login data that we already have as an
`endAdornment` on the `<TextField />`.

In the event that we don't have `loginData` (for whatever reason), we
just don't show the button - but this doesn't affect any of the existing
functionality.
@scallaway scallaway changed the title feat: add filter to own commits button web: add filter to own commits button Oct 18, 2023
tommilligan
tommilligan previously approved these changes Oct 18, 2023
Copy link
Collaborator

@tommilligan tommilligan left a comment

Choose a reason for hiding this comment

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

Looks great, just two code points but happy

qvet-web/src/components/CommitSummary.tsx Outdated Show resolved Hide resolved
</IconButton>
{loginData.data ? (
<IconButton
onClick={() => setSearch(loginData.data.login)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this (and onChange above) be useCallback'd to avoid child rerendering?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Possibly.

However, realistically the entire component will be rerendering due to the fact that we're passing search down to it, and that will change each time the user types something.

I thought of ways around this, but figured it didn't really matter for this use case.

Copy link
Collaborator

@tommilligan tommilligan left a comment

Choose a reason for hiding this comment

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

LG, thanks!

@tommilligan tommilligan merged commit 9564327 into qvet:master Oct 18, 2023
1 check passed
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.

None yet

2 participants