Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: update workspaces page filter to include organization controls#14597

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Parkreiner merged 34 commits intomainfrommes/filter-work-2
Sep 16, 2024

Conversation

Parkreiner
Copy link
Member

@ParkreinerParkreiner commentedSep 6, 2024
edited
Loading

Part 2/3 for#14435

Changes made

  • Added organizations dropdown to the workspaces page
  • Refactored file names and moved constants around for clarity
  • Updated some CSS for the filter so that the search box doesn't have a risk of shrinking so much that it isn't even usable
  • Updated main Filter container so that it always controls its own skeleton styling
  • Removed some of the previous wonky destructuring syntax that we were using
  • Fixed the skeleton for the audit page to account for its organization dropdown group (this was missed in a prior review)

Screenshots

Screenshot 2024-09-09 at 1 04 43 PM

Notes

  • I really, really think that we need to refactor/rewrite the filter logic. Not only is the control flow hard to understand, but we have a lot of non-idiomatic code that I think we're only doing because we're scared of touching the main logic. We're currently storing JSX in the React Query cache, which seems really, really suspect

<>
<SearchFieldSkeleton />
<MenuSkeleton />
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

We forgot to put a fourthMenuSkeleton here for the orgs dropdown

Copy link
Member

Choose a reason for hiding this comment

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

it needs to be conditional onshowOrganizations :^)

Copy link
MemberAuthor

@ParkreinerParkreinerSep 12, 2024
edited
Loading

Choose a reason for hiding this comment

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

Whoops

@@ -180,101 +175,3 @@ const ResourceTypeMenu: FC<ResourceTypeMenuProps> = ({ menu, width }) => {
/>
);
};

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

All moved to the orgs/filtering file

Comment on lines +200 to +203
<>
<BaseSkeleton width="100%" />
{optionsSkeleton}
</>
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Inlined the base skeleton because:

  1. I don't think there will ever be a situation where we don't want a skeleton for the main search box itself
  2. It felt weird that the component was never in control ofany of its skeletons

@ParkreinerParkreiner marked this pull request as ready for reviewSeptember 9, 2024 17:12
Copy link
Member

@aslilacaslilac left a comment

Choose a reason for hiding this comment

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

wonderful 😄

@@ -1,6 +1,6 @@
import { API } from "api/api";
import type { AuditLogResponse } from "api/typesGenerated";
import { useFilterParamsKey } from "components/Filter/filter";
import { useFilterParamsKey } from "components/Filter/Filter";
Copy link
Member

Choose a reason for hiding this comment

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

MY HERO

@@ -52,7 +52,7 @@ export const SelectFilter: FC<SelectFilterProps> = ({
<SelectMenuTrigger>
<SelectMenuButton
startIcon={selectedOption?.startIcon}
css={{ width, flexGrow: 1 }}
css={{flexBasis:width, flexGrow: 1 }}
Copy link
Member

Choose a reason for hiding this comment

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

flexBasis!!!!! you're literally so good at your job

const addMeAsFirstOption = (options: SelectFilterOption[]) => {
options= options.filter((option) =>option.value !== me.username);
const addMeAsFirstOption = (options:readonlySelectFilterOption[]) => {
const filtered= options.filter((o) =>o.value !== me.username);
Copy link
Member

Choose a reason for hiding this comment

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

the only way this line would make me happier is if you did the thing I like where the closure names the parameterit

Comment on lines 24 to 27
// Have to specify min width so that, as we keep adding more and
// control options to the filter row, the text box doesn't have a
// risk of shrinking so much that it becomes un-clickable
css={{ minWidth: "320px" }}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Have to specify min width so that, as we keep adding more and
// control options to the filter row, the text box doesn't have a
// risk of shrinking so much that it becomes un-clickable
css={{minWidth:"320px"}}
// We specify `minWidth` so that the text box can't shrink so much that
// it becomes un-clickable as we add more filter controls.

<>
<SearchFieldSkeleton />
<MenuSkeleton />
Copy link
Member

Choose a reason for hiding this comment

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

it needs to be conditional onshowOrganizations :^)

menu: StatusFilterMenu;
}>;

export const StatusMenu: FC<StatusMenuProps> = ({ width, menu }) => {
Copy link
Member

Choose a reason for hiding this comment

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

thank you 🙏

Base automatically changed frommes/filter-work-1 tomainSeptember 16, 2024 20:17
@ParkreinerParkreinerenabled auto-merge (squash)September 16, 2024 20:40
@ParkreinerParkreiner merged commit5aa54be intomainSep 16, 2024
27 checks passed
@ParkreinerParkreiner deleted the mes/filter-work-2 branchSeptember 16, 2024 20:45
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 16, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@aslilacaslilacaslilac approved these changes

Assignees

@ParkreinerParkreiner

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@Parkreiner@aslilac

[8]ページ先頭

©2009-2025 Movatter.jp