Repository: payloadcms/payload
File: packages/next/src/views/List/handleGroupBy.ts (TypeScript)

Code before:
        trash,
        user,
        where: {
          ...(whereWithMergedSearch || {}),
          [groupByFieldPath]: { equals: filterValue },
        },
      })

      // Extract heading
      let heading: string

      if (relationship === null) {
        heading = req.i18n.t('general:noValue')
      } else if (groupByField?.type === 'relationship') {
        const relationshipConfig = Array.isArray(groupByField.relationTo)
          ? undefined
          : clientConfig.collections.find((c) => c.slug === groupByField.relationTo)
        heading = extractRelationshipDisplayValue(relationship, clientConfig, relationshipConfig)
      } else if (groupByField?.type === 'date') {
        heading = formatDate({
          date: String(filterValue),
          i18n: req.i18n,
          pattern: clientConfig.admin.dateFormat,
        })
      } else if (groupByField?.type === 'checkbox') {
        heading = filterValue === true ? req.i18n.t('general:true') : req.i18n.t('general:false')
      } else {
        heading = String(filterValue)
      }

      // Create serializable value for client
      const serializableValue = createSerializableValue(filterValue)

      if (groupData.docs && groupData.docs.length > 0) {
        const { columnState: newColumnState, Table: NewTable } = renderTable({
          clientCollectionConfig,
          collectionConfig,
          columns,
          customCellProps,
          data: groupData,
          drawerSlug,
          enableRowSelections,
          groupByFieldPath,
          groupByValue: serializableValue,
          heading: heading || req.i18n.t('general:noValue'),
          i18n: req.i18n,
          key: `table-${serializableValue}`,
          orderableFieldName: collectionConfig.orderable === true ? '_order' : undefined,
          payload: req.payload,
          query,
          useAsTitle: collectionConfig.admin.useAsTitle,

Review comment (suggestion):
This is not right, only explicitly false values should display false. Undefined or null values behave differently. I think we should bring the old logic back and potentially even write a test for this.

Code after:
            equals: valueOrRelationshipID,
          },
        },
      })

      // Extract heading
      let heading: string

      if (potentiallyPopulatedRelationship === null) {
        heading = req.i18n.t('general:noValue')
      } else if (groupByField?.type === 'relationship') {
        const relationshipConfig = Array.isArray(groupByField.relationTo)
          ? undefined
          : clientConfig.collections.find((c) => c.slug === groupByField.relationTo)
        heading = extractRelationshipDisplayValue(
          potentiallyPopulatedRelationship,
          clientConfig,
          relationshipConfig,
        )
      } else if (groupByField?.type === 'date') {
        heading = formatDate({
          date: String(valueOrRelationshipID),
          i18n: req.i18n,
          pattern: clientConfig.admin.dateFormat,
        })
      } else if (groupByField?.type === 'checkbox') {
        if (valueOrRelationshipID === true) {
          heading = req.i18n.t('general:true')
        }
        if (valueOrRelationshipID === false) {
          heading = req.i18n.t('general:false')
        }
      } else {
        heading = String(valueOrRelationshipID)
      }

      // Create serializable value for client
      const serializableValue = createSerializableValue(valueOrRelationshipID)

      if (groupData.docs && groupData.docs.length > 0) {
        const { columnState: newColumnState, Table: NewTable } = renderTable({
          clientCollectionConfig,
          collectionConfig,
          columns,
          customCellProps,
          data: groupData,
          drawerSlug,
          enableRowSelections,
          groupByFieldPath,
          groupByValue: serializableValue,
          heading: heading || req.i18n.t('general:noValue'),