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

Code before:
    isErrorStorage,
    errorStorage,
    users,
    selectedUsers,
    specificFilterColumn,
  ])

  const searchInvalid =
    !search || specificFilterColumn === 'freeform' || specificFilterColumn === 'email'
      ? false
      : specificFilterColumn === 'id'
        ? !search.match(UUIDV4_LEFT_PREFIX_REGEX)
        : !search.match(PHONE_NUMBER_LEFT_PREFIX_REGEX)

  return (
    <>
      <div className="h-full flex flex-col">
        <FormHeader className="py-4 px-6 !mb-0" title="Users" />
        <div className="bg-surface-200 py-3 px-4 md:px-6 flex flex-col lg:flex-row lg:items-center 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}
                  specificFilterColumn={specificFilterColumn}
                  setSearch={setSearch}
                  setFilterKeywords={(s) => {
                    setFilterKeywords(s)
                    sendEvent({
                      action: 'auth_users_search_submitted',
                      properties: {
                        trigger: 'search_input',
                        ...telemetryProps,
                        keywords: search.trim().toLocaleLowerCase(),
                      },
                      groups: telemetryGroups,
                    })

Review comment (bug):
I'm guessing this was accidentally removed? 

It causes a bug where if you open a user info and then search, if you have zero results, it shows empty side panel.

Code after:
    isErrorStorage,
    errorStorage,
    users,
    selectedUsers,
    specificFilterColumn,
  ])

  const searchInvalid =
    !search || specificFilterColumn === 'freeform' || specificFilterColumn === 'email'
      ? false
      : specificFilterColumn === 'id'
        ? !search.match(UUIDV4_LEFT_PREFIX_REGEX)
        : !search.match(PHONE_NUMBER_LEFT_PREFIX_REGEX)

  return (
    <>
      <div className="h-full flex flex-col">
        <FormHeader className="py-4 px-6 !mb-0" title="Users" />
        <div className="bg-surface-200 py-3 px-4 md:px-6 flex flex-col lg:flex-row lg:items-center 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}
                  specificFilterColumn={specificFilterColumn}
                  setSearch={setSearch}
                  setFilterKeywords={(s) => {
                    setFilterKeywords(s)
                    setSelectedUser(undefined)
                    sendEvent({
                      action: 'auth_users_search_submitted',
                      properties: {
                        trigger: 'search_input',
                        ...telemetryProps,
                        keywords: s,
                      },
                      groups: telemetryGroups,