Repository: supabase/supabase
File: apps/studio/components/interfaces/Auth/Users/UsersV2.tsx (TypeScript)

Code before:
        setSpecificFilterColumn(localStorageFilter)
      }
      if (sortByValue === 'id:asc' && localStorageSortByValue !== 'id:asc') {
        setSortByValue(localStorageSortByValue)
      }
    }
  }, [isLocalStorageFilterLoaded, isLocalStorageSortByValueLoaded, isCountLoaded])

  return (
    <>
      <div className="h-full flex flex-col">
        <div className="flex items-center">
          <FormHeader className="py-4 px-6 !mb-0" title="Users" />

          {showImprovedSearchOptIn && (
            <Button
              icon={<WandSparklesIcon />}
              className="mr-6"
              onClick={() => setShowCreateIndexesModal(true)}
              loading={isUpdatingAuthConfig}
            >
              Create indexes
            </Button>
          )}

          {indexWorkerInProgress && (
            <Button className="mr-6" loading={indexWorkerInProgress}>
              Creating indexes
            </Button>
          )}
        </div>
        <div className="bg-surface-200 py-3 px-4 md:px-6 flex flex-col lg:flex-row lg:items-start justify-between gap-2 border-t">
          {selectedUsers.size > 0 ? (
            <div className="flex items-center gap-x-2">
              <Button type="default" icon={<Trash />} onClick={() => setShowDeleteModal(true)}>
                Delete {selectedUsers.size} users
              </Button>
              <ButtonTooltip
                type="default"
                icon={<X />}
                className="px-1.5"
                onClick={() => setSelectedUsers(new Set([]))}
                tooltip={{ content: { side: 'bottom', text: 'Cancel selection' } }}
              />
            </div>
          ) : (
            <>
              <div className="flex flex-wrap items-center gap-2">
                <UsersSearch
                  search={search}
                  searchInvalid={searchInvalid}

Review comment (suggestion):
I think this would work better as an admonition above the table. It should also have link to `/project/${projectRef}/logs/explorer?q=${encodeURI(INDEX_WORKER_LOGS_SEARCH_STRING)}`.

Code after:
    selectedUsers,
    specificFilterColumn,
  ])

  // [Joshen] Load URL state for filter column and sort by only once, if no respective values found in URL params
  useEffect(() => {
    if (
      isLocalStorageFilterLoaded &&
      isLocalStorageSortByValueLoaded &&
      isCountLoaded &&
      isCountWithinThresholdForSortBy
    ) {
      if (specificFilterColumn === 'email' && localStorageFilter !== 'email') {
        setSpecificFilterColumn(localStorageFilter)
      }
      if (sortByValue === 'id:asc' && localStorageSortByValue !== 'id:asc') {
        setSortByValue(localStorageSortByValue)
      }
    }
  }, [isLocalStorageFilterLoaded, isLocalStorageSortByValueLoaded, isCountLoaded])

  return (
    <>
      <div className="h-full flex flex-col">
        <FormHeader className="py-4 px-6 !mb-0" title="Users" />

        {showImprovedSearchOptIn && (
          <Alert_Shadcn_ className="rounded-none mb-0 border-0 border-t">
            <InfoIcon className="size-4" />
            <AlertTitle_Shadcn_>Opt-in to an improved search experience</AlertTitle_Shadcn_>
            <AlertDescription_Shadcn_ className="flex justify-between items-center">
              <div>
                Creating the necessary indexes will provide a safer and more performant search
                experience.
              </div>
              <Button
                icon={<WandSparklesIcon />}
                onClick={() => setShowCreateIndexesModal(true)}
                loading={isUpdatingAuthConfig}
                type="default"
              >
                Create indexes
              </Button>
            </AlertDescription_Shadcn_>
          </Alert_Shadcn_>
        )}

        {indexWorkerInProgress && (
          <Alert_Shadcn_ className="rounded-none mb-0 border-0 border-t">
            <InfoIcon className="size-4" />
            <AlertTitle_Shadcn_>Index creation is in progress</AlertTitle_Shadcn_>